[trunk][patch] fix another invalid sharing in see

Rafael Espindola espindola@google.com
Tue May 27 15:03:00 GMT 2008


> fails:
>
> (insn 30 10 28 2 /home/espindola/test.i:4 (parallel [
>            (set (subreg:SI (reg:DI 60) 0)
>                (ashiftrt:SI (reg:SI 62 [ a ])
>                    (const_int 13 [0xd])))
>            (clobber (reg:CC 17 flags))
>        ]) 522 {*ashrsi3_1} (expr_list:REG_UNUSED (reg:CC 17 flags)
>        (expr_list:REG_EQUAL (div:SI (subreg:SI (reg:DI 60) 0)
>                (const_int 8192 [0x2000]))
>            (nil))))
> /home/espindola/test.i:6: error: shared rtx
> (subreg:SI (reg:DI 60) 0)

copy_rtx_if_shared_1 has a code path similar to reset_used_flags:

switch (code)
    {
  ...
    case INSN:
    case JUMP_INSN:
    case CALL_INSN:
    case NOTE:
    case BARRIER:
      /* The chain of insns is not being copied.  */
      return;
    }

Looks like we have to use copy_rtx or change copy_rtx_if_shared to
look into INSN.

Cheers,
-- 
Rafael Avila de Espindola

Google Ireland Ltd.
Gordon House
Barrow Street
Dublin 4
Ireland

Registered in Dublin, Ireland
Registration Number: 368047



More information about the Gcc-patches mailing list