Patchwork [0/6] Thread pointer built-in functions / [SH] PR 54760

login
register
mail settings
Submitter Chung-Lin Tang
Date Oct. 13, 2012, 9:33 a.m.
Message ID <50793561.1000203@codesourcery.com>
Download mbox | patch
Permalink /patch/191289/
State New
Headers show

Comments

Chung-Lin Tang - Oct. 13, 2012, 9:33 a.m.
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().
Oleg Endo - Oct. 13, 2012, 11:56 a.m.
On Sat, 2012-10-13 at 17:33 +0800, Chung-Lin Tang wrote:
> 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.

Yep, confirmed.  Thanks!

Cheers,
Oleg

Patch

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;
     }