aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/ghost.ads
diff options
context:
space:
mode:
authorJohn David Anglin <danglin@gcc.gnu.org>2024-08-29 11:53:45 -0400
committerJohn David Anglin <danglin@gcc.gnu.org>2024-08-29 11:53:45 -0400
commit81c47986e1d8efa70a4bd28e8dfc62bfca8e8362 (patch)
tree08f39bccb6ebfc87c8d293cf7f246878f24b139a /gcc/ada/ghost.ads
parent215c7e3084ea9ec75dcc803f73c94b36e2751e54 (diff)
downloadgcc-81c47986e1d8efa70a4bd28e8dfc62bfca8e8362.zip
gcc-81c47986e1d8efa70a4bd28e8dfc62bfca8e8362.tar.gz
gcc-81c47986e1d8efa70a4bd28e8dfc62bfca8e8362.tar.bz2
hppa: Fix handling of unscaled index addresses on HP-UX
The PA-RISC architecture uses the top two bits of memory pointers to select space registers. The space register ID is ored with the pointer offset to compute the global virtual address for an access. The new late combine passes broke gcc on HP-UX. One of these passes runs after reload. The existing code assumed no unscaled index instructions would be created after reload as the REG_POINTER flag is not reliable after reload. The new pass sometimes interchanged the base and index registers, causing these instructions to fault when the wrong space register was selected. I investigated various alternatives to try to retain generation of unscaled index instructions on HP-UX. It's not possible to simply treat unscaled index addresses as not legitimate after reload as sometimes instructions need to be rerecognized after reload. So, we needed to allow unscaled index addresses after reload and to disable the late combine passes. I had noticed that reversing the current order of base and index register canonicalization resulted in more accesses using unscaled index addresses. However, this exposed issues with the REG_POINTER flag. The flag is not propagated when a constant is added to a pointer. Tree opimization sometimes adds two pointers. I found that I had to treat the result as a pointer but the addition generally corrupts the space register bits. These get fixed when a negative pointer is added. Finally, the REG_POINTER flag isn't set when a pointer is passed in a function call. I couldn't get this approach to work. Thus, I came to the conclusion that the best approach was to disable use of unscaled index addresses on HP-UX. I don't think this impacts performance significantly. Code size might get slightly larger but we get some or more back from having the late combine passes. 2024-08-29 John David Anglin <danglin@gcc.gnu.org> gcc/ChangeLog: * config/pa/pa.cc (load_reg): Don't generate load with unscaled index address when !TARGET_NO_SPACE_REGS. (pa_legitimate_address_p): Only allow unscaled index addresses when TARGET_NO_SPACE_REGS.
Diffstat (limited to 'gcc/ada/ghost.ads')
0 files changed, 0 insertions, 0 deletions