From patchwork Sat Oct 13 09:33:21 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [0/6] Thread pointer built-in functions / [SH] PR 54760 Date: Fri, 12 Oct 2012 23:33:21 -0000 From: Chung-Lin Tang X-Patchwork-Id: 191289 Message-Id: <50793561.1000203@codesourcery.com> To: Oleg Endo Cc: gcc-patches , Richard Henderson , Richard Sandiford , Ramana Radhakrishnan , Sterling Augustine , Andreas Krebbel On 2012/10/12 06:55 AM, Oleg Endo wrote: > This broke the recently added thread pointer built-ins on SH, but I was > prepared for that, so no problem here. The attached patch is a straight > forward fix. > > However, with the patch applied I get an ICE on one of the SH thread > pointer tests: gcc/testsuite/gcc.target/sh/pr54760-3.c, function > test04: > > internal compiler error: in expand_insn, at optabs.c:8208 > __builtin_set_thread_pointer (xx[i]); Looks like I was supposed to use create_input_operand() there instead. I've committed the attached patch as obvious. This should be fixed now. Thanks, Chung-Lin * builtins.c (expand_builtin_set_thread_pointer): Use create_input_operand() instead of create_fixed_operand(). Index: builtins.c =================================================================== --- builtins.c (revision 192421) +++ builtins.c (revision 192422) @@ -5776,7 +5776,7 @@ struct expand_operand op; rtx val = expand_expr (CALL_EXPR_ARG (exp, 0), NULL_RTX, Pmode, EXPAND_NORMAL); - create_fixed_operand (&op, val); + create_input_operand (&op, val, Pmode); expand_insn (icode, 1, &op); return; }