From f82a627cf51e998b3d1c5c02f7e7c00b4aef1b0c Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Tue, 30 Jun 2009 17:26:32 +0000 Subject: cgraphunit.c (cgraph_finalize_compilation_unit): Call finalize_size_functions before further processing. * cgraphunit.c (cgraph_finalize_compilation_unit): Call finalize_size_functions before further processing. * stor-layout.c: Include cgraph.h, tree-inline.h and tree-dump.h. (variable_size): Call self_referential_size on size expressions that contain a PLACEHOLDER_EXPR. (size_functions): New static variable. (copy_self_referential_tree_r): New static function. (self_referential_size): Likewise. (finalize_size_functions): New global function. * tree.c: Include tree-inline.h. (push_without_duplicates): New static function. (find_placeholder_in_expr): New global function. (substitute_in_expr) : Return the replacement object on equality. : Likewise. : If the replacement object is a constant, try to inline the call in the expression. * tree.h (finalize_size_functions): Declare. (find_placeholder_in_expr): Likewise. (FIND_PLACEHOLDER_IN_EXPR): New macro. (substitute_placeholder_in_expr): Update comment. * tree-inline.c (remap_decl): Do not unshare trees if do_not_unshare is true. (copy_tree_body_r): Likewise. (copy_tree_body): New static function. (maybe_inline_call_in_expr): New global function. * tree-inline.h (struct copy_body_data): Add do_not_unshare field. (maybe_inline_call_in_expr): Declare. * Makefile.in (tree.o): Depend on TREE_INLINE_H. (stor-layout.o): Depend on CGRAPH_H, TREE_INLINE_H, TREE_DUMP_H and GIMPLE_H. ada/ * gcc-interface/decl.c: Include tree-inline.h. (annotate_value) : Try to inline the call in the expression. * gcc-interface/utils.c (max_size) : Likewise. * gcc-interface/utils2.c: Include tree-inline. (known_alignment) : Likewise. From-SVN: r149112 --- gcc/ada/ChangeLog | 8 ++++++++ gcc/ada/gcc-interface/decl.c | 10 ++++++++++ gcc/ada/gcc-interface/utils.c | 11 ++++++++--- gcc/ada/gcc-interface/utils2.c | 10 ++++++++++ 4 files changed, 36 insertions(+), 3 deletions(-) (limited to 'gcc/ada') diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 94ff870..65d3720 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,5 +1,13 @@ 2009-06-30 Eric Botcazou + * gcc-interface/decl.c: Include tree-inline.h. + (annotate_value) : Try to inline the call in the expression. + * gcc-interface/utils.c (max_size) : Likewise. + * gcc-interface/utils2.c: Include tree-inline. + (known_alignment) : Likewise. + +2009-06-30 Eric Botcazou + * raise-gcc.c: Include dwarf2.h conditionally. 2009-06-29 Tom Tromey diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c index 48acbfb..f380213 100644 --- a/gcc/ada/gcc-interface/decl.c +++ b/gcc/ada/gcc-interface/decl.c @@ -33,6 +33,7 @@ #include "ggc.h" #include "target.h" #include "expr.h" +#include "tree-inline.h" #include "ada.h" #include "types.h" @@ -7190,6 +7191,15 @@ annotate_value (tree gnu_size) case EQ_EXPR: tcode = Eq_Expr; break; case NE_EXPR: tcode = Ne_Expr; break; + case CALL_EXPR: + { + tree t = maybe_inline_call_in_expr (gnu_size); + if (t) + return annotate_value (t); + } + + /* Fall through... */ + default: return No_Uint; } diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c index a4d77a3..aa12eb7 100644 --- a/gcc/ada/gcc-interface/utils.c +++ b/gcc/ada/gcc-interface/utils.c @@ -2333,10 +2333,15 @@ max_size (tree exp, bool max_p) case tcc_vl_exp: if (code == CALL_EXPR) { - tree *argarray; - int i, n = call_expr_nargs (exp); - gcc_assert (n > 0); + tree t, *argarray; + int n, i; + + t = maybe_inline_call_in_expr (exp); + if (t) + return max_size (t, max_p); + n = call_expr_nargs (exp); + gcc_assert (n > 0); argarray = (tree *) alloca (n * sizeof (tree)); for (i = 0; i < n; i++) argarray[i] = max_size (CALL_EXPR_ARG (exp, i), max_p); diff --git a/gcc/ada/gcc-interface/utils2.c b/gcc/ada/gcc-interface/utils2.c index aab01f9b..8ee9d4d 100644 --- a/gcc/ada/gcc-interface/utils2.c +++ b/gcc/ada/gcc-interface/utils2.c @@ -31,6 +31,7 @@ #include "ggc.h" #include "flags.h" #include "output.h" +#include "tree-inline.h" #include "ada.h" #include "types.h" @@ -215,6 +216,15 @@ known_alignment (tree exp) this_alignment = expr_align (TREE_OPERAND (exp, 0)); break; + case CALL_EXPR: + { + tree t = maybe_inline_call_in_expr (exp); + if (t) + return known_alignment (t); + } + + /* Fall through... */ + default: /* For other pointer expressions, we assume that the pointed-to object is at least as aligned as the pointed-to type. Beware that we can -- cgit v1.1