Should not sink instructions which may cause trap
authorJiong Wang <jiong.wang@arm.com>
Tue, 30 Sep 2014 08:44:14 +0000 (08:44 +0000)
committerJiong Wang <jiwang@gcc.gnu.org>
Tue, 30 Sep 2014 08:44:14 +0000 (08:44 +0000)
2014-09-30  Jiong Wang  <jiong.wang@arm.com>

  gcc/
    * shrink-wrap.c (move_insn_for_shrink_wrap): Check "can_throw_internal"
    before sinking insn.

From-SVN: r215709

gcc/ChangeLog
gcc/shrink-wrap.c

index d224b0fd3bf902b9181dc71923c2af2b8a11a9c8..9e78a93f569135160b3b24838cf4e169f63fa6a3 100644 (file)
@@ -1,3 +1,8 @@
+2014-09-30  Jiong Wang  <jiong.wang@arm.com>
+
+       * shrink-wrap.c (move_insn_for_shrink_wrap): Check "can_throw_internal"
+       before sinking insn.
+
 2014-09-30  David Sherwood  <david.sherwood@arm.com>
 
        * ira-int.h (ira_allocno): Add "wmode" field.
index bd4813c82ae42400b678b08da76f3fad994dddcf..b1ff8a255f82022901aede0565addb5c06c287ea 100644 (file)
@@ -189,6 +189,9 @@ move_insn_for_shrink_wrap (basic_block bb, rtx_insn *insn,
       unsigned int nonconstobj_num = 0;
       rtx src_inner = NULL_RTX;
 
+      if (can_throw_internal (insn))
+       return false;
+
       subrtx_var_iterator::array_type array;
       FOR_EACH_SUBRTX_VAR (iter, array, src, ALL)
        {