PR c/31520
* c-del.c (finish_decl): Grab the type of the decl after the call
to store_init_value.
2007-04-14 Andrew Pinski <andrew_pinski@playstation.sony.com>
PR C/31520
* testsuite/gcc.dg/gnu89-init-4.c: New testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@123835
138bc75d-0d04-0410-961f-
82ee72b054a4
+2007-04-14 Andrew Pinski <andrew_pinski@playstation.sony.com>
+
+ PR c/31520
+ * c-del.c (finish_decl): Grab the type of the decl after the call
+ to store_init_value.
+
2007-04-14 Steven Bosscher <steven@gcc.gnu.org>
* common.opt (fforward-propagate): Fix "Optimization" annotation.
void
finish_decl (tree decl, tree init, tree asmspec_tree)
{
- tree type = TREE_TYPE (decl);
+ tree type;
int was_incomplete = (DECL_SIZE (decl) == 0);
const char *asmspec = 0;
|| TREE_CODE (decl) == FIELD_DECL))
objc_check_decl (decl);
+ type = TREE_TYPE (decl);
+
/* Deduce size of array from initialization, if not already known. */
if (TREE_CODE (type) == ARRAY_TYPE
&& TYPE_DOMAIN (type) == 0
+2007-04-14 Andrew Pinski <andrew_pinski@playstation.sony.com>
+
+ PR C/31520
+ * testsuite/gcc.dg/gnu89-init-4.c: New testcase.
+
2007-04-14 Jakub Jelinek <jakub@redhat.com>
PR c++/25874
--- /dev/null
+/* Test for GNU extensions to compound literals are giving the correct array bounds */
+/* { dg-do run } */
+/* { dg-options "-std=gnu89 -W -Wall -O2" } */
+
+int a[] = (int[4]){1, 1, 2};
+int f(void)
+{
+ int sum = 0; int i;
+ for(i = 0;i<4;i++)
+ sum = a[i];
+ return sum;
+}