[tree-ssa] Mainline merge as of 2004-04-14
Diego Novillo
dnovillo@redhat.com
Thu Apr 15 20:17:00 GMT 2004
This merge should bring new fixes for problems inherited from mainline
in the last merge. It also incorporates Andrew Pinski's fix for
gcc.c-torture/execute/20040411-1.c which is a gimplification problem
that was failing to handle TYPE_DECLs in VLAs. This was causing the
gimplifier to emit uninitialized temporaries when gimplifying the same
SAVE_EXPR present in two different scopes.
Bootstrapped and tested x86, x86-64, alpha, ia64 and ppc. Except
Andrew's patch which I used to bootstrap the compiler and make sure it
fixes 20040411-1.c.
Diego.
* c-simplify.c (gimplify_decl_stmt): Handle TYPE_DECL.
Index: c-simplify.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/c-simplify.c,v
retrieving revision 1.1.4.95
diff -u -p -r1.1.4.95 c-simplify.c
--- c-simplify.c 24 Mar 2004 18:47:41 -0000 1.1.4.95
+++ c-simplify.c 15 Apr 2004 19:24:54 -0000
@@ -851,6 +851,18 @@ gimplify_decl_stmt (tree *stmt_p)
*stmt_p = NULL;
return GS_ERROR;
}
+
+ if (TREE_CODE (decl) == TYPE_DECL)
+ {
+ tree type = TREE_TYPE (decl);
+ if (TREE_CODE (type) == ARRAY_TYPE
+ && !TREE_CONSTANT (TYPE_SIZE_UNIT (type)))
+ {
+ /* This is a variable-sized array type. Simplify its size. */
+ tree temp = TYPE_SIZE_UNIT (type);
+ gimplify_expr (&temp, &pre, &post, is_gimple_val, fb_rvalue);
+ }
+ }
if (TREE_CODE (decl) == VAR_DECL && !DECL_EXTERNAL (decl))
{
More information about the Gcc
mailing list