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: array bounds violation in caller-save.c : duplicate hard regs check added


On 05/25/2012 05:18 PM, DJ Delorie wrote:
If I apply this patch, which checks for duplicate hard registers within
-fira-share-save-slots, the following *-elf targets fail due to the assert:

bfin cris m32c rl78 rx sh sh64 v850

The following succeed:

frv h8300 i386 ia64 m32r mep mipsisa32 mipsisa64 mn10300 powerpc tx39

Without this patch, the failing targets eventually overflow the
call_saved_regs[] array (size FIRST_PSEUDO_REGISTER) and corrupt other
memory and data structures.  I originally had an assert for that
bounds check too, but this one caught all the cases sooner.

Can someone who knows more about IRA and this optimization explain if
and/or why duplicate hard regs are allowed at that point, and what if
any changes should be made to avoid the array overflow?
It'd really help if you could probably a testcase so that we could run things under a debugger and/or analyze dump files.

jeff


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