This is the mail archive of the
mailing list for the GCC project.
Re: array bounds violation in caller-save.c : duplicate hard regs check added
- From: Jeff Law <law at redhat dot com>
- To: DJ Delorie <dj at redhat dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 29 May 2012 10:56:58 -0600
- Subject: Re: array bounds violation in caller-save.c : duplicate hard regs check added
- References: <201205252318.q4PNIsRM005024@greed.delorie.com>
On 05/25/2012 05:18 PM, DJ Delorie wrote:
It'd really help if you could probably a testcase so that we could run
things under a debugger and/or analyze dump files.
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?