Re: c/7873: arm-linux-gcc fails when assigning address to a bit field
> >How-To-Repeat:
>
> /** Run "arm-linux-gcc -c" on this preprocessed segment : **/
>
>
> unsigned int x0 = 0;
>
> typedef struct {
> unsigned int field1 : 20;
> unsigned int field2 : 12;
> } XX;
>
> static XX yy;
>
> static void foo (void)
> {
> yy.field1 = (unsigned int ) (&x0);
> }
Please try the following patch:
2002-09-10 Richard Earnshaw <rearnsha@arm.com>
* arm.md (insv): Use reg_or_int_operand for operand[3].
Index: arm.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/arm/arm.md,v
retrieving revision 1.104
diff -p -r1.104 arm.md
*** arm.md 29 Jul 2002 12:41:46 -0000 1.104
--- arm.md 10 Sep 2002 09:44:07 -0000
***************
*** 1866,1872 ****
[(set (zero_extract:SI (match_operand:SI 0 "s_register_operand" "")
(match_operand:SI 1 "general_operand" "")
(match_operand:SI 2 "general_operand" ""))
! (match_operand:SI 3 "nonmemory_operand" ""))]
"TARGET_ARM"
"
{
--- 1866,1872 ----
[(set (zero_extract:SI (match_operand:SI 0 "s_register_operand" "")
(match_operand:SI 1 "general_operand" "")
(match_operand:SI 2 "general_operand" ""))
! (match_operand:SI 3 "reg_or_int_operand" ""))]
"TARGET_ARM"
"
{
Reply to: