gimple-fold.c (gimple_fold_call): Properly keep virtual SSA form up-to-date when...
authorRichard Biener <rguenther@suse.de>
Wed, 15 Oct 2014 15:05:20 +0000 (15:05 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Wed, 15 Oct 2014 15:05:20 +0000 (15:05 +0000)
2014-10-15  Richard Biener  <rguenther@suse.de>

* gimple-fold.c (gimple_fold_call): Properly keep virtual
SSA form up-to-date when devirtualizing a call to
__builtin_unreachable and avoid fixing up EH info here.

From-SVN: r216266

gcc/ChangeLog
gcc/gimple-fold.c

index efbbe411fd75742adb1ebe69344d216bb277b3f1..89a84a218125ff3b3c683c86ce31daa28ddfa67b 100644 (file)
@@ -1,3 +1,9 @@
+2014-10-15  Richard Biener  <rguenther@suse.de>
+
+       * gimple-fold.c (gimple_fold_call): Properly keep virtual
+       SSA form up-to-date when devirtualizing a call to
+       __builtin_unreachable and avoid fixing up EH info here.
+
 2014-10-15  Alexander Ivchenko  <alexander.ivchenko@intel.com>
            Maxim Kuznetsov  <maxim.kuznetsov@intel.com>
            Anna Tikhonova  <anna.tikhonova@intel.com>
index a0ce0db9766f2ce7e1eace92b01826b00f981bd6..cc27cb95c5fac35a610bdc1456f0c6d81a2cde15 100644 (file)
@@ -2629,7 +2629,11 @@ gimple_fold_call (gimple_stmt_iterator *gsi, bool inplace)
                      gsi_insert_before (gsi, new_stmt, GSI_NEW_STMT);
                    }
                  else
-                   gsi_replace (gsi, new_stmt, true);
+                   {
+                     gimple_set_vuse (new_stmt, gimple_vuse (stmt));
+                     gimple_set_vdef (new_stmt, gimple_vdef (stmt));
+                     gsi_replace (gsi, new_stmt, false);
+                   }
                  return true;
                }
            }