Bug 38603 - [4.8/4.9/4.10 Regression] reload inheritance mucks up LOAD_EXTEND_OP transformations done by combine
Summary: [4.8/4.9/4.10 Regression] reload inheritance mucks up LOAD_EXTEND_OP transfo...
Status: RESOLVED WORKSFORME
Alias: None
Product: gcc
Classification: Unclassified
Component: rtl-optimization (show other bugs)
Version: 4.4.0
: P4 normal
Target Milestone: 5.0
Assignee: Not yet assigned to anyone
URL:
Keywords: ra, wrong-code
Depends on:
Blocks:
 
Reported: 2008-12-21 22:39 UTC by Hans-Peter Nilsson
Modified: 2014-07-14 22:23 UTC (History)
4 users (show)

See Also:
Host: x86_64-unknown-linux-gnu
Target: mmix-knuth-mmixware
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
MMIX IRA_COVER_CLASSES patch (307 bytes, patch)
2008-12-21 22:41 UTC, Hans-Peter Nilsson
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Hans-Peter Nilsson 2008-12-21 22:39:37 UTC
Trunk revision 141361 with the attached patch shows this regression compared to unpatched:
Running /home/hp/combx/combined/gcc/testsuite/gcc.c-torture/execute/execute.exp ...
FAIL: gcc.c-torture/execute/20040709-1.c execution,  -O2

However, the regression is hidden at revisions 142609 and 142857.

At the time, a quick glance at the RTL dumps pointed at LOAD_EXTEND_OP optimizations performed by combine not being properly handled in IRA,
specifically a sign-extension optimized away by combine as matching the implicit sign extension of a memory read through LOAD_EXTEND_OP.
IIRC the memory read was not being transformed (back) into an explicit sign-extension.
(I intend to fill in details here, but this will have to do for today.)
Comment 1 Hans-Peter Nilsson 2008-12-21 22:41:41 UTC
Created attachment 16955 [details]
MMIX IRA_COVER_CLASSES patch
Comment 2 Hans-Peter Nilsson 2008-12-23 11:03:38 UTC
The bug is still visible at r142016.
Comment 3 Hans-Peter Nilsson 2008-12-23 18:40:54 UTC
And still visible at r142018...
Comment 4 Hans-Peter Nilsson 2008-12-31 10:17:37 UTC
Ditto 142116 and 142117.
Comment 5 Uroš Bizjak 2009-04-06 18:18:41 UTC
It looks to me that this is a reload bug, independent of IRA. See thread [1] for analysis of what seems to be the same problem.

[1] http://gcc.gnu.org/ml/gcc/2009-04/msg00033.html
Comment 6 Uroš Bizjak 2009-04-06 18:20:50 UTC
(In reply to comment #5)
> It looks to me that this is a reload bug, independent of IRA. See thread [1]
> for analysis of what seems to be the same problem.
> 
> [1] http://gcc.gnu.org/ml/gcc/2009-04/msg00033.html

Thread continues at http://gcc.gnu.org/ml/gcc/2009-04/msg00038.html.
Comment 7 Jakub Jelinek 2012-03-13 12:47:02 UTC
4.4 branch is being closed, moving to 4.5.4 target.
Comment 8 Jakub Jelinek 2013-04-12 15:16:42 UTC
GCC 4.6.4 has been released and the branch has been closed.
Comment 9 Richard Biener 2014-06-12 13:45:11 UTC
The 4.7 branch is being closed, moving target milestone to 4.8.4.
Comment 10 Hans-Peter Nilsson 2014-07-14 22:23:57 UTC
(Not even) with the current moral equivalent of the attached MMIX IRA_COVER_CLASSES patch, i.e. just excluding the fake MMIX_ARG_POINTER_REGNUM from SYSTEM_REGS (as all IRA_COVER_CLASSES macros are obsoleted and forbidden as defined by the first part), do I see any change in test-results at r212486. Specifically, gcc.c-torture/execute/20040709-1.c does not fail.  Hence, I'm closing this.  Though, the issue is likely just hidden.