Ian Lance Taylor - Re: Fix reload ICE with define-split (original) (raw)

This is the mail archive of the gcc-patches@gcc.gnu.orgmailing 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]

Nathan Sidwell nathan@codesourcery.com writes:

Roman Zippel wrote:

An instruction can have multiple REG_INC notes and with your version it would add a complete set of REG_INC notes for every previous REG_INC note. IMO it's also a bit inconsequent to add REG_INC notes for a register, which didn't have one before, only if there was a REG_INC for a different register. I'm fine with just recreating existing REG_INC notes or creating REG_INC for all autoinc expressions (even new ones), I'm just not sure about something inbetween.

I'm happy for an RTL maintainer to tell me what the right thing is :)

After define_split it needs to be the case that every autoincrement has an associated REG_INC note. Your second patch isn't right because it adds all required REG_INC notes, but only if there was at least one existing REG_INC note.

The question is: should we make the define_split responsible for adding REG_INC notes when it introduces an autoincrement, or should we slow down every define_split by searching for an RTX_AUTOINC code? If we choose the first option, then Roman's patch is correct. If we choose the second option, then your first patch is correct.

Existing backends already add REG_INC notes where required in a number of different places. So I am inclined to say that if a define_split introduces an autoincrement, it should be responsible for adding a REG_INC note (as is already done by sh.md).

So I'm going to approve Roman's patch, except that for increased flexibility I think it should be modified to only create a REG_INC note if the note does not already exist, since the backend may have added the note itself.

Thanks.

Ian


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