re PR target/78229 (ICE in redirect_eh_edge_1, at tree-eh.c:2305)
authorRichard Biener <rguenther@suse.de>
Mon, 7 Nov 2016 12:26:48 +0000 (12:26 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 7 Nov 2016 12:26:48 +0000 (12:26 +0000)
2016-11-07  Richard Biener  <rguenther@suse.de>

PR target/78229
* config/i386/i386.c (ix86_gimple_fold_builtin): Do not adjust
EH info.

* g++.dg/pr78229.C: New testcase.

From-SVN: r241901

gcc/ChangeLog
gcc/config/i386/i386.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/pr78229.C [new file with mode: 0644]

index 5ccd3b4ca62ca447a9b2d2e321deb72bef8f415f..9714a07dbe0521f44ddc51aa901b4a04119d3e83 100644 (file)
@@ -1,3 +1,9 @@
+2016-11-07  Richard Biener  <rguenther@suse.de>
+
+       PR target/78229
+       * config/i386/i386.c (ix86_gimple_fold_builtin): Do not adjust
+       EH info.
+
 2016-11-07  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/78218
index bffba803eeec1080a67598f089708b11b9600a16..a78cf78a201a386465f6f91fba5a991e516b06ec 100644 (file)
@@ -33518,7 +33518,7 @@ ix86_gimple_fold_builtin (gimple_stmt_iterator *gsi)
          gsi_insert_before (gsi, g, GSI_SAME_STMT);
          g = gimple_build_assign (gimple_call_lhs (stmt), NOP_EXPR, lhs);
          gimple_set_location (g, loc);
-         gsi_replace (gsi, g, true);
+         gsi_replace (gsi, g, false);
          return true;
        }
       break;
index 242b51b3764ba964b9d5749ce6edefd9f41d65a6..06798a9a1761465ff0d24f81ea0ce6f5571a2388 100644 (file)
@@ -1,3 +1,8 @@
+2016-11-07  Richard Biener  <rguenther@suse.de>
+
+       PR target/78229
+       * g++.dg/pr78229.C: New testcase.
+
 2016-11-07  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/78218
diff --git a/gcc/testsuite/g++.dg/pr78229.C b/gcc/testsuite/g++.dg/pr78229.C
new file mode 100644 (file)
index 0000000..a52141b
--- /dev/null
@@ -0,0 +1,24 @@
+/* { dg-do compile { target x86_64-*-* i?86-*-* } } */
+/* { dg-options "-O2 -mbmi -w" } */
+
+void a();
+inline int b(int c) {
+    int d = c;
+    return __builtin_ia32_tzcnt_u32(d);
+}
+struct e {};
+int f, g, h;
+void fn3() {
+    float j;
+    &j;
+      {
+       e k;
+       while (h) {
+           if (g == 0)
+             continue;
+           int i = b(g);
+           f = i;
+       }
+       a();
+      }
+}