Bug 15342 - [arm-linux] internal compiler error: in verify_local_live_at_start
Summary: [arm-linux] internal compiler error: in verify_local_live_at_start
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: rtl-optimization (show other bugs)
Version: 3.4.0
: P2 normal
Target Milestone: 3.4.5
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
: 17810 18295 (view as bug list)
Depends on:
Blocks: 18295
  Show dependency treegraph
 
Reported: 2004-05-08 18:41 UTC by Philip Blundell
Modified: 2005-09-01 13:14 UTC (History)
3 users (show)

See Also:
Host:
Target: arm-linux
Build:
Known to work: 3.4.5 4.0.0 4.1.0
Known to fail: 3.4.4
Last reconfirmed: 2004-08-09 03:53:55


Attachments
test case (76.01 KB, application/x-bzip)
2004-05-08 18:42 UTC, Philip Blundell
Details
minimized testcase (1056 bytes) (428 bytes, text/plain)
2004-05-08 21:51 UTC, Serge Belyshev
Details
even smaller testcase (312 bytes) (167 bytes, text/plain)
2004-05-09 13:59 UTC, Serge Belyshev
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Philip Blundell 2004-05-08 18:41:43 UTC
$ ./cc1 -O2 -frename-registers gtktext.i
[...]
gtktext.c: In function `gtk_text_insert':
gtktext.c:1085: internal compiler error: in verify_local_live_at_start, at
flow.c:546
Please submit a full bug report,
Comment 1 Philip Blundell 2004-05-08 18:42:10 UTC
Created attachment 6241 [details]
test case
Comment 2 Serge Belyshev 2004-05-08 21:51:36 UTC
Created attachment 6242 [details]
minimized testcase (1056 bytes)

I can confirm this bug with 3.4.1 and 3.5.0;
I think it is similar to bug 14615.
Comment 3 Serge Belyshev 2004-05-09 13:59:10 UTC
Created attachment 6244 [details]
even smaller testcase (312 bytes)

use '-O1 -fexpensive-optimizations -fgcse -fschedule-insns -frename-registers'
for this.
Comment 4 Andrew Pinski 2004-05-09 15:25:27 UTC
Confirmed.
Comment 5 Richard Earnshaw 2004-10-29 16:43:56 UTC
I think the key to what has failed here is that the reg-rename pass has missed
the equivalence between start->index and a member of the copied structure.

In pseudo code, the output from the previous pass has the following instructions

	r2 := [ip+8]/4
	cc := cmp r2, #0
ne(cc):	r0, r1, r2 := [r0]/12
ne(cc):	[ip]/12 := r0, r1, r2   // Note [ip+8]/4 set to new r2 ...
	cc := cmp r2, #1        // ...so no need to reload it here
gt(cc): r3 := #0
gt(cc): [ip+8]/4 := r3
	return

Note that r2 is updated by the first conditional instruction (a conditional ldm
on ARM).  The conditional move code on ARM uses hard registers, but CSE has
clearly noticed this equivalence at some point and merged the two uses to avoid
a redundant re-load of start->index.  Unfortunately, rename_registers has missed
this and split the two uses up again.  This creates a use of r2 when it isn't
correctly initialized.

	r1 := [ip+8]/4
	cc := cmp r1, #0
ne(cc):	r0, r1, r2 := [r0]/12
ne(cc):	[ip]/12 := r0, r1, r2
	cc := cmp r2, #1        // r2 incorrect if previous insn not exec
gt(cc): r3 := #0
gt(cc): [ip+8]/4 := r3
	return
Comment 6 CVS Commits 2004-11-04 14:08:28 UTC
Subject: Bug 15342

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	rsandifo@gcc.gnu.org	2004-11-04 14:08:16

Modified files:
	gcc            : ChangeLog regrename.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/gcc.dg: 20041104-1.c 

Log message:
	PR target/15342
	* regrename.c (scan_rtx): Treat the destinations of SETs and CLOBBERs
	as OP_INOUT if the instruction is predicated.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.6166&r2=2.6167
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/regrename.c.diff?cvsroot=gcc&r1=1.89&r2=1.90
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.4542&r2=1.4543
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/20041104-1.c.diff?cvsroot=gcc&r1=NONE&r2=1.1

Comment 7 Andrew Pinski 2005-01-23 23:47:42 UTC
Fixed.
Comment 8 Andrew Pinski 2005-01-23 23:47:59 UTC
*** Bug 18295 has been marked as a duplicate of this bug. ***
Comment 9 CVS Commits 2005-09-01 13:09:25 UTC
Subject: Bug 15342

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-branch
Changes by:	rearnsha@gcc.gnu.org	2005-09-01 13:09:08

Modified files:
	gcc            : ChangeLog regrename.c 

Log message:
	PR rtl-optimization/17810
	Backport
	2004-11-04  Richard Sandiford  <rsandifo@redhat.com>
	PR target/15342
	* regrename.c (scan_rtx): Treat the destinations of SETs and CLOBBERs
	as OP_INOUT if the instruction is predicated.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=2.2326.2.910&r2=2.2326.2.911
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/regrename.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.73.2.1&r2=1.73.2.2

Comment 10 Richard Earnshaw 2005-09-01 13:14:01 UTC
*** Bug 17810 has been marked as a duplicate of this bug. ***