re PR target/54892 (, ICE in extract_insn, at recog.c:2123)
authorZhenqiang Chen <zhenqiang.chen@linaro.org>
Fri, 19 Oct 2012 09:24:39 +0000 (09:24 +0000)
committerXuepeng Guo <xguo@gcc.gnu.org>
Fri, 19 Oct 2012 09:24:39 +0000 (09:24 +0000)
gcc/ChangeLog
PR target/54892
* config/arm/arm.c (arm_expand_compare_and_swap): Use SImode to make
sure the mode is correct when falling through from above cases.

gcc/testsuite/ChangeLog
PR target/54892
* gcc.target/arm/pr54892.c: New.

From-SVN: r192609

gcc/ChangeLog
gcc/config/arm/arm.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/arm/pr54892.c [new file with mode: 0644]

index 9b09aaa638afdb807234b3613c4d4d1f7f40c240..cdba3366b0098dcd341e921c7836a3e057432c82 100644 (file)
@@ -1,3 +1,9 @@
+2012-10-19  Zhenqiang Chen <zhenqiang.chen@linaro.org>
+
+       PR target/54892
+       * config/arm/arm.c (arm_expand_compare_and_swap): Use SImode to make
+       sure the mode is correct when falling through from above cases.
+
 2012-10-19  Bin Cheng  <bin.cheng@arm.com>
 
        * common.opt (flag_ira_hoist_pressure): New.
index 327ef223e4e699b12709991f9c94c171f4e9220b..11f793d5d77730340ad2685bddaaf9562c2fba8b 100644 (file)
@@ -25447,8 +25447,8 @@ arm_expand_compare_and_swap (rtx operands[])
     case SImode:
       /* Force the value into a register if needed.  We waited until after
         the zero-extension above to do this properly.  */
-      if (!arm_add_operand (oldval, mode))
-       oldval = force_reg (mode, oldval);
+      if (!arm_add_operand (oldval, SImode))
+       oldval = force_reg (SImode, oldval);
       break;
 
     case DImode:
index 57d4383f1746f4da765de51566c1d55ba19b5210..4af8265d80d3574f122c0b55766b43b767a5944b 100644 (file)
@@ -1,3 +1,8 @@
+2012-10-19  Zhenqiang Chen <zhenqiang.chen@linaro.org>
+
+       PR target/54892
+       * gcc.target/arm/pr54892.c: New.
+
 2012-10-19  Bin Cheng  <bin.cheng@arm.com>
 
        * testsuite/gcc.dg/hoist-register-pressure.c: New test.
diff --git a/gcc/testsuite/gcc.target/arm/pr54892.c b/gcc/testsuite/gcc.target/arm/pr54892.c
new file mode 100644 (file)
index 0000000..a7fe1bc
--- /dev/null
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+
+int set_role(unsigned char role_id, short m_role)
+{
+  return __sync_bool_compare_and_swap(&m_role, -1, role_id);
+}
+