This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Rogue SUBREG


> I think this is happening in reload since 213r.ira I find:
> 
> (insn 225 223 226 46 (set (reg:SI 137)
>         (mem/u:SI (plus:SI (mult:SI (reg/v:SI 77 [ count ])
>                     (const_int 4 [0x4]))
>                 (symbol_ref:SI ("DECPOWERS") [flags 0x40]  <var_decl
> 0x7f7ff63b3 5f0 DECPOWERS>)) [3 DECPOWERS S4 A32]))
> ../../gcc-4.8.2/libdecnumber/decNumber.c
> :7183 12 {movsi_2}
> 
>      (expr_list:REG_EQUIV (mem/u:SI (plus:SI (mult:SI (reg/v:SI 77 [ count
> ]) (const_int 4 [0x4]))
>                 (symbol_ref:SI ("DECPOWERS") [flags 0x40]  <var_decl
> 0x7f7ff63b3 5f0 DECPOWERS>)) [3 DECPOWERS S4 A32])
>         (nil)))
> (insn 226 225 227 46 (set (mem:HI (reg/v/f:SI 78 [ sup ]) [2 *sup_105+0 S2
> A16]) (plus:HI (subreg:HI (reg:SI 137) 0)
>             (const_int -1 [0xffffffffffffffff])))
> ../../gcc-4.8.2/libdecnumber/d ecNumber.c:7183 48 {addhi3}
>      (expr_list:REG_DEAD (reg:SI 137)
>         (nil)))
> 
> That's fine if pseudo 137 gets instantiated to a register.
> 
> In 214r.reload that becomes:
> 
> (insn 226 225 227 46 (set (mem:HI (reg/v/f:SI 1 %r1 [orig:78 sup ] [78]) [2
> *sup _105+0 S2 A16])
>         (plus:HI (subreg:HI (mem/u/c:SI (plus:SI (mult:SI (reg/v:SI 0 %r0
> [orig: 77 count ] [77])
>                             (const_int 4 [0x4]))
>                         (symbol_ref:SI ("DECPOWERS") [flags 0x40]  <var_decl
> 0x7 f7ff63b35f0 DECPOWERS>)) [3 DECPOWERS S4 A32]) 0)
>             (const_int -1 [0xffffffffffffffff])))
> ../../gcc-4.8.2/libdecnumber/d ecNumber.c:7183 48 {addhi3}
>      (nil))
> 
> which is now invalid due to use of a mode dependent address.  So who's
> doing this?  I'm guessing it's combine but that code is opaque to me.

If it appears in .reload, then it's reload and not combine.  Most likely the 
MEM is the equivalent memory location of (reg:SI 137) thanks to the REG_EQUIV 
note and gets substituted for it at the end of reload; that's done in place so 
gen_rtx_SUBREG is not called.  Try and see whether find_reloads_subreg_address 
is invoked on it and, if so, what happens then.

-- 
Eric Botcazou


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]