Bug 36350 - [4.3 Regression] GCC ICE with -frename-registers
Summary: [4.3 Regression] GCC ICE with -frename-registers
Status: RESOLVED DUPLICATE of bug 35964
Alias: None
Product: gcc
Classification: Unclassified
Component: rtl-optimization (show other bugs)
Version: 4.3.1
: P2 normal
Target Milestone: 4.3.4
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on: 35964
Blocks:
  Show dependency treegraph
 
Reported: 2008-05-28 06:41 UTC by Khem Raj
Modified: 2009-03-30 21:25 UTC (History)
12 users (show)

See Also:
Host: i686-linux
Target: arm-none-linux-gnueabi
Build: i686-linux
Known to work: 4.2.2 4.4.0
Known to fail: 4.3.0 4.3.1
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Khem Raj 2008-05-28 06:41:13 UTC
Attached sample (reduced from glibc cvs) caused gcc built from latest gcc-4_3-branch to ICE on arm. It worked ok with gcc 4.2.2. If I removed -frename-registers then the ICE would not happen.

Steps to reproduce

Compile as follows

arm-none-linux-gnueabi-gcc -c -O2 sample.c -frename-registers

sample.c: In function ‘foo’:
sample.c:10: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.


/* sample.c */

int foo () {
  const unsigned char *inptr = 0;
  unsigned char *outptr = 0;
  unsigned int inval = (__extension__ ({ register unsigned int __bsx = (*(const unsigned int *) inptr); ((((__bsx) & 0xff000000u) >> 24) | (((__bsx) & 0x00ff0000u) >> 8) | (((__bsx) & 0x0000ff00u) << 8) | (((__bsx) & 0x000000ffu) << 24)); }));
  if (__builtin_expect (inval > 0x7fffffff, 0))
  {
    *((unsigned int *) outptr) = inval;
  }
return 0;
}
Comment 1 Matthijs van de Water 2008-05-28 10:14:55 UTC
My arm-none-linux-gnueabi-gcc with the patch from 
bug 35964 does not suffer this ICE. 

This is also why Debian/Ubuntu/Fedora do not see this, because they have the referenced patch applied on top of gcc-4_3-branch.
Comment 2 Richard Biener 2008-06-06 14:59:27 UTC
4.3.1 is being released, adjusting target milestone.
Comment 3 Joseph S. Myers 2008-08-27 22:04:09 UTC
4.3.2 is released, changing milestones to 4.3.3.
Comment 4 Richard Biener 2008-09-20 15:12:10 UTC
CCing ARM maintainers so they can confirm the bug and look at its relation
to PR35964.
Comment 5 Jakub Jelinek 2008-11-04 12:11:16 UTC
Indeed, a DUP of PR35964 (which isn't marked as 4.3 regression though).
http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=137235
backport fixes this on 4.3 branch, on the trunk I cannot reproduce on the given
testcase even with that change reverted.

Andrew, do you plan to backport this fix to 4.3 branch?
Comment 6 Richard Biener 2009-01-24 10:20:24 UTC
GCC 4.3.3 is being released, adjusting target milestone.
Comment 7 Ramana Radhakrishnan 2009-03-30 21:24:16 UTC
This is now fixed with the fix for PR35964 which was a backport of the patch mentioned in comment #5

*** This bug has been marked as a duplicate of 36964 ***
Comment 8 Ramana Radhakrishnan 2009-03-30 21:25:16 UTC
Reopened because of a typo in the closing comment.
Comment 9 Ramana Radhakrishnan 2009-03-30 21:25:56 UTC
It's a dup of 35964

*** This bug has been marked as a duplicate of 35964 ***