+2006-08-25 Joseph S. Myers <joseph@codesourcery.com>
+
+ PR c/27893
+ * gimplify.c (gimplify_decl_expr, gimplify_init_ctor_preeval):
+ Treat sizes as variable whenever not INTEGER_CST.
+
2006-08-11 Eric Botcazou <ebotcazou@libertysurf.fr>
PR rtl-optimization/23454
{
tree init = DECL_INITIAL (decl);
- if (!TREE_CONSTANT (DECL_SIZE (decl)))
+ if (TREE_CODE (DECL_SIZE (decl)) != INTEGER_CST)
{
/* This is a variable-sized decl. Simplify its size and mark it
for deferred expansion. Note that mudflap depends on the format
/* If this is of variable size, we have no choice but to assume it doesn't
overlap since we can't make a temporary for it. */
- if (!TREE_CONSTANT (TYPE_SIZE (TREE_TYPE (*expr_p))))
+ if (TREE_CODE (TYPE_SIZE (TREE_TYPE (*expr_p))) != INTEGER_CST)
return;
/* Otherwise, we must search for overlap ... */
+2006-08-25 Joseph S. Myers <joseph@codesourcery.com>
+
+ PR c/27893
+ * gcc.c-torture/compile/vla-const-1.c,
+ gcc.c-torture/compile/vla-const-2.c: New tests.
+
2006-08-17 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/28606
--- /dev/null
+/* Test TREE_CONSTANT VLA size: bug 27893. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+int a;
+void g(void *);
+void f(void) { int b[(__SIZE_TYPE__)&a]; g(b); }
--- /dev/null
+/* Test TREE_CONSTANT VLA size: bug 27893. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+void g(void *);
+void f(void) { int b[1/0]; g(b); }