From 44ded5cf927fd428caa596f299ad417df8020cda Mon Sep 17 00:00:00 2001 From: ebotcazou Date: Wed, 18 Oct 2017 10:41:03 +0000 Subject: [PATCH] * gcc-interface/misc.c (gnat_tree_size): Move around. * gcc-interface/utils.c (max_size): Deal with SSA names. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@253852 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ada/ChangeLog | 6 ++++++ gcc/ada/gcc-interface/misc.c | 34 +++++++++++++++++----------------- gcc/ada/gcc-interface/utils.c | 4 ++++ 3 files changed, 27 insertions(+), 17 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 7d50dbba1ec..2139cbf4d86 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,9 @@ +2017-10-18 Eric Botcazou + + * gcc-interface/misc.c (gnat_tree_size): Move around. + + * gcc-interface/utils.c (max_size): Deal with SSA names. + 2017-10-17 Jakub Jelinek * gcc-interface/misc.c (gnat_tree_size): New function. diff --git a/gcc/ada/gcc-interface/misc.c b/gcc/ada/gcc-interface/misc.c index 5083c71db77..7bdb3803c13 100644 --- a/gcc/ada/gcc-interface/misc.c +++ b/gcc/ada/gcc-interface/misc.c @@ -343,23 +343,6 @@ internal_error_function (diagnostic_context *context, const char *msgid, Compiler_Abort (sp, sp_loc, true); } -/* lang_hooks.tree_size: Determine the size of a tree with code C, - which is a language-specific tree code in category tcc_constant, - tcc_exceptional or tcc_type. The default expects never to be called. */ - -static size_t -gnat_tree_size (enum tree_code code) -{ - gcc_checking_assert (code >= NUM_TREE_CODES); - switch (code) - { - case UNCONSTRAINED_ARRAY_TYPE: - return sizeof (tree_type_non_common); - default: - gcc_unreachable (); - } -} - /* Perform all the initialization steps that are language-specific. */ static bool @@ -1387,6 +1370,23 @@ gnat_init_ts (void) MARK_TS_TYPED (EXIT_STMT); } +/* Return the size of a tree with CODE, which is a language-specific tree code + in category tcc_constant, tcc_exceptional or tcc_type. The default expects + never to be called. */ + +static size_t +gnat_tree_size (enum tree_code code) +{ + gcc_checking_assert (code >= NUM_TREE_CODES); + switch (code) + { + case UNCONSTRAINED_ARRAY_TYPE: + return sizeof (tree_type_non_common); + default: + gcc_unreachable (); + } +} + /* Return the lang specific structure attached to NODE. Allocate it (cleared) if needed. */ diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c index 04199769ea3..99453821e41 100644 --- a/gcc/ada/gcc-interface/utils.c +++ b/gcc/ada/gcc-interface/utils.c @@ -3595,6 +3595,10 @@ max_size (tree exp, bool max_p) case tcc_constant: return exp; + case tcc_exceptional: + gcc_assert (code == SSA_NAME); + return exp; + case tcc_vl_exp: if (code == CALL_EXPR) { -- 2.11.4.GIT