http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54217
Bug #: 54217 Summary: setup_save_areas() duplicates hard reg uses Classification: Unclassified Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end AssignedTo: unassig...@gcc.gnu.org ReportedBy: d...@redhat.com Created attachment 27977 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27977 patch to check for duplicate hard reg uses setup_save_areas() in caller-save.c sometimes (with -fira-share-save-slots) maps one hard reg to two different saved regs. Since the save arrays are sized to [FIRST_PSEUDO_REGISTER] this means the arrays may overflow. The attached test case demonstrates the error, the attached patch checks for the error and forces an abort when it's detected. Note: at the time I discovered this, newlib (from whence the test case came) would show this error "somewhere" for these *-elf targets: bfin cris m32c rl78 rx sh sh64 v850