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: LRA reloads of subregs


From: David Miller <davem@davemloft.net>
Date: Fri, 04 Sep 2015 11:30:26 -0700 (PDT)

> From: Segher Boessenkool <segher@kernel.crashing.org>
> Date: Fri, 4 Sep 2015 06:46:04 -0500
> 
>> On Thu, Sep 03, 2015 at 11:19:43PM -0700, David Miller wrote:
>>> The paradoxical subreg restriction in general_operand() is only
>>> enforced when reload_completed is true, which will not be the
>>> case while LRA is working.
>> 
>> This one?
>> 
>> #ifdef INSN_SCHEDULING
>>       /* On machines that have insn scheduling, we want all memory
>> 	 reference to be explicit, so outlaw paradoxical SUBREGs.
>> 	 However, we must allow them after reload so that they can
>> 	 get cleaned up by cleanup_subreg_operands.  */
>>       if (!reload_completed && MEM_P (sub)
>> 	  && GET_MODE_SIZE (mode) > GET_MODE_SIZE (GET_MODE (sub)))
>> 	return 0;
>> #endif
>> 
>> I think you misread that.  Also doc/rtl.texi makes pretty clear that
>> you really shouldn't see subregs of mem.  So where does it come from?
> 
> I see what you are saying, I'll take a look into this.

It looks like it is created in LRA itself, initially LRA is looking
at:

(insn 1100 1099 1101 14 (set (reg:SI 3376)
        (ior:SI (subreg:SI (reg:QI 287) 0)
            (subreg:SI (reg:QI 289) 0))) x.c:104 234 {iorsi3}
     (expr_list:REG_DEAD (reg:QI 289)
        (expr_list:REG_DEAD (reg:QI 287)
            (nil))))

in curr_insn_transform(), and emits the move:

	(set (reg:SI 13423) (subreg:SI (reg:QI 287) 0))

Later the reg inside of this subreg appears to get transformed into
an on-stack MEM.

(insn 18631 1099 1100 14 (set (reg:SI 13423)
        (subreg:SI (mem/c:QI (plus:SI (reg/f:SI 101 %sfp)
                    (const_int -14269 [0xffffffffffffc843])) [0 %sfp+-14269 S1 A8]) 0)) x.c:104 63 {*movsi_insn}
     (expr_list:REG_DEAD (reg:QI 287)
        (nil)))

I suppose perhaps I need to make the input_operand predicate more
strict on sparc.  So I'll look into that now.


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