Bug 30311 - [4.3 regression] revision 120211 failed to compile perlbench
Summary: [4.3 regression] revision 120211 failed to compile perlbench
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.3.0
: P3 normal
Target Milestone: 4.3.0
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2006-12-28 00:09 UTC by H.J. Lu
Modified: 2007-01-06 16:16 UTC (History)
4 users (show)

See Also:
Host:
Target: i686-pc-linux-gnu
Build:
Known to work:
Known to fail:
Last reconfirmed: 2006-12-28 01:14:50


Attachments
A testcase (32.22 KB, application/octet-stream)
2006-12-28 00:11 UTC, H.J. Lu
Details

Note You need to log in before you can comment on or make changes to this bug.
Description H.J. Lu 2006-12-28 00:09:49 UTC
[hjl@gnu-31 build_base_o2.0000]$ /usr/gcc-4.3/bin/gcc foo.i -O2 -S
foo.c: In function ‘Perl_pp_int’:
foo.c:60: internal compiler error: in subreg_get_info, at rtlanal.c:3065
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
[hjl@gnu-31 build_base_o2.0000]$ /usr/gcc-4.3/bin/gcc -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: /net/gnu-13/export/gnu/src/gcc/gcc/configure --enable-clocale=gnu --with-system-zlib --with-demangler-in-ld --enable-shared --enable-threads=posix --enable-haifa --enable-checking=assert --prefix=/usr/gcc-4.3 --with-local-prefix=/usr/local
Thread model: posix
gcc version 4.3.0 20061226 (experimental) [trunk revision 120211]
Comment 1 H.J. Lu 2006-12-28 00:11:59 UTC
Created attachment 12844 [details]
A testcase

A testcase
Comment 2 Volker Reichelt 2006-12-28 01:14:49 UTC
Reduced testcase, fails with -O or higher:

=========================================
inline double bar(double x)
{
  long double d;
  __asm__ ("" : "=t" (d) : "0" (x));
  return d;
}

double foo(double x)
{
  if (x)
    return bar(x);
  else
    return bar(x);
}
=========================================
Comment 3 Andrew Pinski 2006-12-28 01:44:06 UTC
Hmm, I don't know this is really valid code.
Comment 4 Kaveh Ghazi 2006-12-29 04:36:53 UTC
A similar error that may be related was posted here:

http://gcc.gnu.org/ml/gcc-patches/2006-12/msg01713.html

The testcase in my post was from a gcc bootstrap.

Comment 5 Joseph S. Myers 2007-01-02 00:38:30 UTC
Subject: Bug 30311

Author: jsm28
Date: Tue Jan  2 00:38:21 2007
New Revision: 120329

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=120329
Log:
gcc:
	PR middle-end/30311
	* caller-save.c (add_stored_regs): Only handle SUBREGs if inner
	REG is a hard register.  Do not modify REG before calling
	subreg_nregs.
	* rtlanal.c (subreg_get_info): Don't assert size of XMODE is a
	multiple of the size of YMODE for certain lowpart cases.

gcc/testsuite:
	* gcc.c-torture/compile/pr30311.c: New test.

Added:
    trunk/gcc/testsuite/gcc.c-torture/compile/pr30311.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/caller-save.c
    trunk/gcc/rtlanal.c
    trunk/gcc/testsuite/ChangeLog

Comment 6 Kaveh Ghazi 2007-01-06 16:05:11 UTC
sparc-sun-solaris2.10 issue appears to be fixed.
http://gcc.gnu.org/ml/gcc-patches/2007-01/msg00470.html
Comment 7 H.J. Lu 2007-01-06 16:16:43 UTC
Gcc 4.2 revision 120343 compiles SPEC CPU 2006 correctly.