Bug 54217 - setup_save_areas() duplicates hard reg uses
Summary: setup_save_areas() duplicates hard reg uses
Status: UNCONFIRMED
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: unknown
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-10 00:21 UTC by DJ Delorie
Modified: 2012-10-16 09:28 UTC (History)
3 users (show)

See Also:
Host:
Target: sh*-*-*
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
patch to check for duplicate hard reg uses (800 bytes, application/octet-stream)
2012-08-10 00:21 UTC, DJ Delorie
Details
test case for rl78-elf, from newlib (1.58 KB, text/x-csrc)
2012-08-10 00:22 UTC, DJ Delorie
Details

Note You need to log in before you can comment on or make changes to this bug.
Description DJ Delorie 2012-08-10 00:21:08 UTC
Created attachment 27977 [details]
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
Comment 1 DJ Delorie 2012-08-10 00:22:22 UTC
Created attachment 27978 [details]
test case for rl78-elf, from newlib