From patchwork Fri Oct 19 06:46:38 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [ARM] Fix PR target/54892 - [4.7/4.8 Regression], ICE in extract_insn, at recog.c:2123 Date: Thu, 18 Oct 2012 20:46:38 -0000 From: Zhenqiang Chen X-Patchwork-Id: 192577 Message-Id: To: gcc-patches@gcc.gnu.org Hi, In function arm_expand_compare_and_swap, oldval is converted to SImode when its "mode" is QImode/HImode. After "FALLTHRU" to "case SImode", we should use "SImode", other than "mode" (which is QImode/HImode). And INSN atomic_compare_and_swap_1 expects the operand in SImode. No make check regression. Is it OK for 4.7 and trunk? Thanks! -Zhenqiang ChangeLog: 2012-10-19 Zhenqiang Chen 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. testsuite/ChangeLog: 2012-10-19 Zhenqiang Chen PR target/54892 * gcc.target/arm/pr54892.c: New. diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index fc3a508..265e1cb 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -25437,8 +25437,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: