]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[multiple changes]
authorJoseph Myers <jsm28@gcc.gnu.org>
Sat, 26 Aug 2006 00:24:31 +0000 (01:24 +0100)
committerJoseph Myers <jsm28@gcc.gnu.org>
Sat, 26 Aug 2006 00:24:31 +0000 (01:24 +0100)
2006-08-25  Fariborz Jahanian  <fjahanian@apple.com>

PR c/28418
* c-gimplify.c (gimplify_compound_literal_expr): Don't add
variable again if DECL_SEEN_IN_BIND_EXPR_P.

testsuite:
2006-08-25  Joseph S. Myers  <joseph@codesourcery.com>

* gcc.c-torture/compile/compound-literal-1.c: New test.

From-SVN: r116461

gcc/ChangeLog
gcc/c-gimplify.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/compound-literal-1.c [new file with mode: 0644]

index 25220ef5e35541443f73ad2c86a47f96d05c6908..2ec0d396515a9b3001d6997baef46f7db2f08f00 100644 (file)
@@ -1,3 +1,9 @@
+2006-08-25  Fariborz Jahanian  <fjahanian@apple.com>
+
+       PR c/28418
+       * c-gimplify.c (gimplify_compound_literal_expr): Don't add
+       variable again if DECL_SEEN_IN_BIND_EXPR_P.
+
 2006-08-25  Joseph S. Myers  <joseph@codesourcery.com>
 
        PR c/28299
index fd4ac4ed560e27846fe61a0d40ca42059f94fb0a..897a3d9cd7beabebc0cde28007ed7a28c9ad216f 100644 (file)
@@ -482,7 +482,7 @@ gimplify_compound_literal_expr (tree *expr_p, tree *pre_p)
   /* This decl isn't mentioned in the enclosing block, so add it to the
      list of temps.  FIXME it seems a bit of a kludge to say that
      anonymous artificial vars aren't pushed, but everything else is.  */
-  if (DECL_NAME (decl) == NULL_TREE)
+  if (DECL_NAME (decl) == NULL_TREE && !DECL_SEEN_IN_BIND_EXPR_P (decl))
     gimple_add_tmp_var (decl);
 
   gimplify_and_add (decl_s, pre_p);
index 1fd1e82da6c6cdc1908f108e56bac6468ab073fb..10eff6cbe7a995168c1c7ff82b1c6344e96f1264 100644 (file)
@@ -1,3 +1,8 @@
+2006-08-25  Joseph S. Myers  <joseph@codesourcery.com>
+
+       PR c/28418
+       * gcc.c-torture/compile/compound-literal-1.c: New test.
+
 2006-08-25  Joseph S. Myers  <joseph@codesourcery.com>
 
        PR c/28299
diff --git a/gcc/testsuite/gcc.c-torture/compile/compound-literal-1.c b/gcc/testsuite/gcc.c-torture/compile/compound-literal-1.c
new file mode 100644 (file)
index 0000000..968bb45
--- /dev/null
@@ -0,0 +1,9 @@
+/* ICE incrementing compound literal: bug 28418 from Volker Reichelt
+   <reichelt@gcc.gnu.org>.  */
+
+struct A { int i; };
+
+void foo()
+{
+    ((struct A) { 0 }).i += 1;
+}