Bug 28490 - [4.0/4.1 regression] ICE in ia64_expand_move, at config/ia64/ia64.c:1088
Summary: [4.0/4.1 regression] ICE in ia64_expand_move, at config/ia64/ia64.c:1088
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.2.0
: P1 normal
Target Milestone: 4.0.4
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
: 28495 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-07-26 05:39 UTC by Martin Michlmayr
Modified: 2018-03-10 02:39 UTC (History)
7 users (show)

See Also:
Host:
Target: ia64-linux-gnu
Build:
Known to work: 3.3.6 3.4.6
Known to fail: 4.0.3 4.1.1
Last reconfirmed: 2006-07-26 08:06:35


Attachments
test case (440 bytes, text/plain)
2006-07-26 05:41 UTC, Martin Michlmayr
Details
test case (873 bytes, text/plain)
2006-07-26 13:26 UTC, Martin Michlmayr
Details
test case (527 bytes, text/plain)
2006-07-26 13:26 UTC, Martin Michlmayr
Details
test case (2.53 KB, text/plain)
2006-07-26 20:58 UTC, Martin Michlmayr
Details
test case for 4.0, 4.1 and 4.2 (658 bytes, text/plain)
2006-07-31 11:30 UTC, Martin Michlmayr
Details
Oops! Wrong bug. (841 bytes, patch)
2006-08-02 13:45 UTC, Maxim Kuvyrkov
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Michlmayr 2006-07-26 05:39:18 UTC
I get the following ICE with gcc 4.2 on ia64 at -O1.  It doesn't happen with 4.0 or 4.1.

tbm@coconut0:~$ /usr/lib/gcc-snapshot/bin/gcc -c -O1 mini.c
mini.c: In function 'readtoken1':
mini.c:60: internal compiler error: in ia64_expand_move, at config/ia64/ia64.c:1088
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
For Debian GNU/Linux specific bug reporting instructions,
see <URL:file:///usr/share/doc/gcc-4.1/README.Bugs>.
tbm@coconut0:~$ /usr/lib/gcc-snapshot/bin/gcc -c mini.c
tbm@coconut0:~$ gcc-4.1 -c -O2 mini.c
tbm@coconut0:~$ gcc-4.0 -c -O2 mini.c
tbm@coconut0:~$
Comment 1 Martin Michlmayr 2006-07-26 05:41:22 UTC
Created attachment 11944 [details]
test case
Comment 2 Martin Michlmayr 2006-07-26 05:42:05 UTC
This has started to occur sometime between 20051122 and 20060218.
Comment 3 Richard Biener 2006-07-26 08:06:35 UTC
Confirmed.
Comment 4 Martin Michlmayr 2006-07-26 13:26:21 UTC
Created attachment 11945 [details]
test case

Testcase from application dcraw
Comment 5 Martin Michlmayr 2006-07-26 13:26:51 UTC
Created attachment 11946 [details]
test case

Testcase from application dump
Comment 6 Martin Michlmayr 2006-07-26 20:58:39 UTC
Created attachment 11952 [details]
test case

Testcase from application "yorick".
Comment 7 Martin Michlmayr 2006-07-31 11:29:58 UTC
This bug is also present in gcc 4.0 and 4.1 even though my original testcase didn't expose it there.  My new one does:

tbm@coconut0:~$ gcc-4.0 -c -O ecl-asdf.c
ecl-asdf.c: In function 'LC67traverse':
ecl-asdf.c:81: internal compiler error: in ia64_expand_move, at config/ia64/ia64.c:1004
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
For Debian GNU/Linux specific bug reporting instructions,
see <URL:file:///usr/share/doc/gcc-4.0/README.Bugs>.
tbm@coconut0:~$ gcc-4.1 -c -O ecl-asdf.c
ecl-asdf.c: In function 'LC67traverse':
ecl-asdf.c:81: internal compiler error: in ia64_expand_move, at config/ia64/ia64.c:1052
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
For Debian GNU/Linux specific bug reporting instructions,
see <URL:file:///usr/share/doc/gcc-4.1/README.Bugs>.
Preprocessed source stored into /tmp/ccQbxgpQ.out file, please attach this to your bugreport.
tbm@coconut0:~$ /usr/lib/gcc-snapshot/bin/gcc -c -O ecl-asdf.c
ecl-asdf.c: In function 'LC67traverse':
ecl-asdf.c:81: internal compiler error: in ia64_expand_move, at config/ia64/ia64.c:1088
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

This is with:

4.0.4 20060630
4.1.2 20060715
4.2.0 20060721
Comment 8 Martin Michlmayr 2006-07-31 11:30:54 UTC
Created attachment 11980 [details]
test case for 4.0, 4.1 and 4.2

Testcase from application "ecl".
Comment 9 Richard Biener 2006-07-31 12:20:19 UTC
Reduced testcase from comment #8

typedef union cl_lispunion *cl_object;
union cl_lispunion { cl_object cons; };
typedef union { cl_object data; } cl_symbol_initializer;
extern cl_symbol_initializer cl_symbols[];
extern void cl_funcall (cl_object);
extern int _setjmp(vois);
void LC67traverse (cl_object *lex0)
{
  cl_object T0;
  cl_funcall ((cl_object) (cl_symbols + 1));
  if (_setjmp ())
        ;
  if (lex0[0] == (cl_object) cl_symbols)
        goto L791;
  T0 = ((cl_object) (cl_symbols + 1));
L791:;
  cl_funcall (T0);
}
Comment 10 Steven Bosscher 2006-08-01 05:51:08 UTC
Why is this a P1 regression?  ia-64 is not a primary platform.

Comment 11 Mark Mitchell 2006-08-02 03:29:45 UTC
Subject: Re:  [4.0/4.1/4.2 regression] ICE in ia64_expand_move,
 at config/ia64/ia64.c:1088

steven at gcc dot gnu dot org wrote:

> Why is this a P1 regression?  ia-64 is not a primary platform.

True -- but IA64 is a secondary platform, and this looks like relatively
straightforward code.  I think it's important.

If we get all the other P1s done, we can argue about whether or not to
ship the compiler. :-)

Comment 12 Maxim Kuvyrkov 2006-08-02 13:45:40 UTC
Created attachment 11996 [details]
Oops!  Wrong bug.
Comment 13 Jim Wilson 2006-08-04 01:49:07 UTC
*** Bug 28495 has been marked as a duplicate of this bug. ***
Comment 14 Jim Wilson 2006-08-04 01:55:05 UTC
Steve Ellcey posted a patch here:
    http://gcc.gnu.org/ml/gcc-patches/2006-08/msg00016.html
I posted a better patch here:
    http://gcc.gnu.org/ml/gcc-patches/2006-08/msg00054.html
This patch has not been tested yet.

There are also some follow up questions raised in this thread that need to be answered.
Comment 15 Martin Michlmayr 2006-08-27 18:30:28 UTC
(In reply to comment #14)
> Steve Ellcey posted a patch here:
>     http://gcc.gnu.org/ml/gcc-patches/2006-08/msg00016.html
> I posted a better patch here:
>     http://gcc.gnu.org/ml/gcc-patches/2006-08/msg00054.html
> This patch has not been tested yet.
> 
> There are also some follow up questions raised in this thread that need to be
> answered.

Steve, are you working on clarifying those new questions?
 

Comment 16 Steve Ellcey 2006-08-28 16:07:41 UTC
Yes, I did some performance measurements with SPEC2000. Allowing any (symbol + offset) resulted in slightly slower code overall, allowing no (symbol + offset) resulted in slightly faster code overall.  I will be submitting a patch to do this but probably not until next week.
Comment 17 Jim Wilson 2006-09-15 23:05:50 UTC
Subject: Bug 28490

Author: wilson
Date: Fri Sep 15 23:05:40 2006
New Revision: 116983

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=116983
Log:
Short term fix for PR 28490.
* config/ia64/ia64.c (ia64_legitimate_constant_p, cast CONST):
Handle symbol offsets same as they are handled in ia64_expand_move
and move_operand.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/ia64/ia64.c

Comment 18 Andrew Pinski 2006-09-16 02:46:26 UTC
worked around for 4.2.0 so no longer a regression.
Comment 19 Steve Ellcey 2006-09-19 16:09:57 UTC
Subject: Bug 28490

Author: sje
Date: Tue Sep 19 16:09:48 2006
New Revision: 117057

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=117057
Log:
	PR 28490
	* config/ia64/ia64.c (ia64_legitimate_constant_p): Allow function
	pointers as legitimate constants.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/ia64/ia64.c

Comment 20 Steve Ellcey 2006-10-09 18:24:45 UTC
Subject: Bug 28490

Author: sje
Date: Mon Oct  9 18:24:32 2006
New Revision: 117582

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=117582
Log:
	PR target/28490
	Backport from mainline
	2006-09-15  Jim Wilson  <wilson@specifix.com>
	2006-09-19  Steve Ellcey  <sje@cup.hp.com>
	* config/ia64/ia64.c (ia64_legitimate_constant_p): Allow function
	pointers as legitimate constants.  Handle symbol offsets same as
	they are handled in ia64_expand_move and move_operand.

Modified:
    branches/gcc-4_1-branch/gcc/ChangeLog
    branches/gcc-4_1-branch/gcc/config/ia64/ia64.c

Comment 21 Steve Ellcey 2006-10-09 18:26:43 UTC
Subject: Bug 28490

Author: sje
Date: Mon Oct  9 18:26:35 2006
New Revision: 117583

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=117583
Log:
	PR target/28490
	Backport from mainline
	2006-09-15  Jim Wilson  <wilson@specifix.com>
	2006-09-19  Steve Ellcey  <sje@cup.hp.com>
	* config/ia64/ia64.c (ia64_legitimate_constant_p): Allow function
	pointers as legitimate constants.  Handle symbol offsets same as
	they are handled in ia64_expand_move and move_operand.

Modified:
    branches/gcc-4_0-branch/gcc/ChangeLog
    branches/gcc-4_0-branch/gcc/config/ia64/ia64.c

Comment 22 Steve Ellcey 2006-10-09 18:27:27 UTC
Backported the change to 4.1 and 4.0 branches.  Closing as fixed.