On 02/03/2016 03:49 PM, Michael Meissner wrote:
On Wed, Feb 03, 2016 at 01:02:57PM -0500, Vladimir Makarov wrote:
The following patch fixes
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69461
The patch actually solves several issues. Before the patch LRA
has >800 more failures on GCC testsuite on power8. After the patch
the LRA has the same number of failures as reload.
Working on the patch, I think I found some typo in
rs6000.c::rs6000_legitimate_address_p. The code suspicious to me:
if (reg_offset_p && reg_addr[mode].fused_toc &&
toc_fusion_mem_wrapped (x, mode))
return 1;
The function works with address (x) but toc_fusion_mem_wrapped
requires memory instead of address. Therefore the function never
returns 1 for toc_fusion_wrapped address.
Mike and Peter, what do you think about this code?
Anyway, the patch was successfully bootstrapped and tested on power8.
Committed as rev..
It looks like it would solve the problem (not knowing the inner details of
lra).
You are correct about the call to toc_fusion_wrapped expecting a MEM, and
rs6000_legitimate_address_p was pass the address.
We are testing the following patch to fix this:
2016-02-03 Michael Meissner <meiss...@linux.vnet.ibm.com>
Vladimir Makarov <vmaka...@redhat.com>
* config/rs6000/rs6000.c (rs6000_legitimate_address_p): Fix thinko
in validating fused toc addresses.
Thanks, Mike. I found it when trying to fix numerous LRA failures on
power8. Reload pass when can not figure out what to do with
illegitimate address does nothing. LRA tried still to do something.
I've made LRA working as reload for this case. So LRA failures were
fixed even if fused to wrapper address was believed to be illegitimate.
Still it makes a sense to consider the address legitimate as a lot of
code in GCC needs this.