re PR middle-end/32304 (ICE in set_mem_attributes_minus_bitpos)
authorAndrew Pinski <andrew_pinski@playstation.sony.com>
Sat, 4 Aug 2007 00:05:56 +0000 (00:05 +0000)
committerAndrew Pinski <pinskia@gcc.gnu.org>
Sat, 4 Aug 2007 00:05:56 +0000 (17:05 -0700)
2007-08-03  Andrew Pinski  <andrew_pinski@playstation.sony.com>

        PR middle-end/32304
        * ipa-reference.c (has_proper_scope_for_analysis): Return false when
        the decl's type has TYPE_NEEDS_CONSTRUCTING set.

2007-08-03  Andrew Pinski  <andrew_pinski@playstation.sony.com>

        PR middle-end/32304
        * g++.dg/torture/pr32304.C: New testcase.

From-SVN: r127191

gcc/ChangeLog
gcc/ipa-reference.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/torture/pr32304.C [new file with mode: 0644]

index 21f9c3a..eeb4a51 100644 (file)
@@ -1,5 +1,11 @@
 2007-08-03  Andrew Pinski  <andrew_pinski@playstation.sony.com>
 
+       PR middle-end/32304
+       * ipa-reference.c (has_proper_scope_for_analysis): Return false when
+       the decl's type has TYPE_NEEDS_CONSTRUCTING set.
+
+2007-08-03  Andrew Pinski  <andrew_pinski@playstation.sony.com>
+
        PR middle-end/32935
        * fold-convert.c (fold_negate_expr <NOP_EXPR>): Convert back to the
         correct type the negate expression.
index 5e1a6eb..1a962c5 100644 (file)
@@ -267,6 +267,10 @@ has_proper_scope_for_analysis (tree t)
   if (DECL_EXTERNAL (t) || TREE_PUBLIC (t))
     return false;
 
+  /* We cannot touch decls where the type needs constructing.  */
+  if (TYPE_NEEDS_CONSTRUCTING (TREE_TYPE (t)))
+    return false;
+
   /* This is a variable we care about.  Check if we have seen it
      before, and if not add it the set of variables we care about.  */
   if (!bitmap_bit_p (all_module_statics, DECL_UID (t)))
index 7ba9afc..ce38fc7 100644 (file)
@@ -1,5 +1,10 @@
 2007-08-03  Andrew Pinski  <andrew_pinski@playstation.sony.com>
 
+       PR middle-end/32304
+       * g++.dg/torture/pr32304.C: New testcase.
+
+2007-08-03  Andrew Pinski  <andrew_pinski@playstation.sony.com>
+
        PR middle-end/32935
        * gfortran.fortran-torture/compile/complex_1.f90: New test.
 
diff --git a/gcc/testsuite/g++.dg/torture/pr32304.C b/gcc/testsuite/g++.dg/torture/pr32304.C
new file mode 100644 (file)
index 0000000..236d00b
--- /dev/null
@@ -0,0 +1,9 @@
+// { dg-do compile }
+
+struct S {
+        S() {}
+};
+S f() {
+        static S s;
+        return s;
+}