]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR tree-optimization/39394 (ICE in copy_tree_body_r)
authorJakub Jelinek <jakub@redhat.com>
Mon, 9 Mar 2009 14:01:29 +0000 (15:01 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 9 Mar 2009 14:01:29 +0000 (15:01 +0100)
PR tree-optimization/39394
* gimplify.c (gimplify_type_sizes): Gimplify DECL_SIZE and
DECL_SIZE_UNIT of variable length FIELD_DECLs.

* gcc.c-torture/compile/pr39394.c: New test.

From-SVN: r144727

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

index 300507d9c05f7b1d1242b403a56bab9cd895b361..341bcc6155b7f1b81988d4ca57966d26319aa7bb 100644 (file)
@@ -1,3 +1,9 @@
+2009-03-09  Jakub Jelinek  <jakub@redhat.com>
+
+       PR tree-optimization/39394
+       * gimplify.c (gimplify_type_sizes): Gimplify DECL_SIZE and
+       DECL_SIZE_UNIT of variable length FIELD_DECLs.
+
 2009-03-09  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>
 
        * recog.c (verfiy_changes): Disallow renaming of hard regs in
index 02d4923aa1e318a13a3724c7f2b3035189641237..b0c65920d814d190f75ea908daec82d0b6627bbf 100644 (file)
@@ -7141,6 +7141,8 @@ gimplify_type_sizes (tree type, gimple_seq *list_p)
        if (TREE_CODE (field) == FIELD_DECL)
          {
            gimplify_one_sizepos (&DECL_FIELD_OFFSET (field), list_p);
+           gimplify_one_sizepos (&DECL_SIZE (field), list_p);
+           gimplify_one_sizepos (&DECL_SIZE_UNIT (field), list_p);
            gimplify_type_sizes (TREE_TYPE (field), list_p);
          }
       break;
index 0651163fb8cf51a6db4c79d64d8b7a5a494112a9..5329e909d54aa4bfb0651d75c9731ffcce24c3a8 100644 (file)
@@ -1,3 +1,8 @@
+2009-03-09  Jakub Jelinek  <jakub@redhat.com>
+
+       PR tree-optimization/39394
+       * gcc.c-torture/compile/pr39394.c: New test.
+
 2009-03-09  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>
 
        * gcc.target/s390/20090223-1.c: New testcase.
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr39394.c b/gcc/testsuite/gcc.c-torture/compile/pr39394.c
new file mode 100644 (file)
index 0000000..325a08f
--- /dev/null
@@ -0,0 +1,28 @@
+/* PR tree-optimization/39394 */
+
+char *p;
+int x;
+
+static inline void
+f1 (int n)
+{
+  asm volatile ("" : "=m" (*(struct { char x[n]; } *) p));
+}
+
+static inline void
+f2 (void)
+{
+  x ? f1 (1) : f1 (2);
+}
+
+static inline void
+f3 (void)
+{
+  f2 ();
+}
+
+void
+f4 (void)
+{
+  f3 ();
+}