]> gcc.gnu.org Git - gcc.git/commitdiff
re PR c++/43093 (internal compiler error: Segmentation fault when compiling Firefox)
authorJason Merrill <jason@redhat.com>
Wed, 17 Feb 2010 22:51:34 +0000 (17:51 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Wed, 17 Feb 2010 22:51:34 +0000 (17:51 -0500)
PR c++/43093
* cp-gimplify.c (cp_gimplify_expr) [INIT_EXPR]: Return if we don't
have an INIT_EXPR anymore.

From-SVN: r156840

gcc/cp/ChangeLog
gcc/cp/cp-gimplify.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/ext/attrib37.C [new file with mode: 0644]

index 40d733460819f58af4236ab9b73a778c829af6e8..ab5fbe5c196e07dd8abbeacb5390e2e41cc11436 100644 (file)
@@ -1,5 +1,9 @@
 2010-02-17  Jason Merrill  <jason@redhat.com>
 
+       PR c++/43093
+       * cp-gimplify.c (cp_gimplify_expr) [INIT_EXPR]: Return if we don't
+       have an INIT_EXPR anymore.
+
        PR c++/43079
        * pt.c (convert_nontype_argument): Change assert to test.
 
index cf8135037e9b16a3bc1c95a286cf8604fb92ea6a..df09b60c6ddc69a82dddbc61e013be011bc1a1db 100644 (file)
@@ -552,7 +552,9 @@ cp_gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p)
         25979.  */
     case INIT_EXPR:
       cp_gimplify_init_expr (expr_p, pre_p, post_p);
-      /* Fall through.  */
+      if (TREE_CODE (*expr_p) != INIT_EXPR)
+       return GS_OK;
+      /* Otherwise fall through.  */
     case MODIFY_EXPR:
       {
        /* If the back end isn't clever enough to know that the lhs and rhs
index 87e442e95529089af10114a5fc49d14dc1a84f2b..34729bce210be2db0afee88e77a8947fdb7d18a9 100644 (file)
@@ -1,5 +1,8 @@
 2010-02-17  Jason Merrill  <jason@redhat.com>
 
+       PR c++/43093
+       * g++.dg/ext/attrib37.C: New.
+
        PR c++/43079
        * g++.dg/template/ptrmem20.C: New.
 
diff --git a/gcc/testsuite/g++.dg/ext/attrib37.C b/gcc/testsuite/g++.dg/ext/attrib37.C
new file mode 100644 (file)
index 0000000..ac35587
--- /dev/null
@@ -0,0 +1,14 @@
+// PR c++/43093
+// { dg-do compile { target i?86-*-* } }
+
+struct S {
+  int x;
+  S(const S &s) {}
+};
+
+S __attribute__((__stdcall__)) getS();
+
+void test()
+{
+  S s = getS();
+}
This page took 0.071421 seconds and 5 git commands to generate.