Bug 23199 - [4.0 regression] ICE in int_mode_for_mode, at stor-layout.c:251
Summary: [4.0 regression] ICE in int_mode_for_mode, at stor-layout.c:251
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.0.1
: P2 normal
Target Milestone: 4.0.3
Assignee: Eric Botcazou
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2005-08-02 15:08 UTC by Ralf Menzel
Modified: 2005-10-19 14:50 UTC (History)
2 users (show)

See Also:
Host:
Target: sparc-sun-solaris2.9
Build:
Known to work: 3.4.4 4.1.0
Known to fail: 4.0.0 4.0.2 4.0.3
Last reconfirmed: 2005-10-15 16:58:16


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ralf Menzel 2005-08-02 15:08:40 UTC
I tried to do a profiledbootstrap for sparc64-sun-solaris2.9 but ran into an
internal compiler error for reorg.c. I then profilebootstraped gcc 4.0.1 for
sparc-sun-solaris2.9 without error. But again I get an internal compiler error
for the file r.c below that I build by stripping down reorg.c:

For the command line

  gcc -v -c -O -m64 -fprofile-generate r.c -o r.o

the corresponding output is:
--- snip ---
Using built-in specs.
Target: sparc-sun-solaris2.9
Configured with: /home/menzel/src/4.0-32/gcc-4.0.1/configure
--prefix=/home/menzel/sw5.9-gcc4.0
Thread model: posix
gcc version 4.0.1
 /home/menzel/sw5.9-gcc4.0/libexec/gcc/sparc-sun-solaris2.9/4.0.1/cc1 -quiet -v
-D__arch64__ -D__sparcv9 r.c -mptr64 -mstack-bias -mno-v8plus -mcpu=v9 -quiet
-dumpbase r.c -m64 -auxbase-strip r.o -O -version -fprofile-generate -o
/tmp/ccPJ8PTb.s
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory
"/home/menzel/sw5.9-gcc4.0/lib/gcc/sparc-sun-solaris2.9/4.0.1/../../../../sparc-sun-solaris2.9/include"
#include "..." search starts here:
#include <...> search starts here:
 /home/menzel/sw5.9-gcc4.0/include
 /home/menzel/sw5.9-gcc4.0/lib/gcc/sparc-sun-solaris2.9/4.0.1/include
 /usr/include
End of search list.
GNU C version 4.0.1 (sparc-sun-solaris2.9)
        compiled by GNU C version 4.0.1.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
r.c: In function 'check_annul_list_true_false':
r.c:27: internal compiler error: in int_mode_for_mode, at stor-layout.c:251
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
--- snip ---

The file r.c:
--- snip ---
union rtunion_def
{
  struct rtx_def *rt_rtx;
};
typedef union rtunion_def rtunion;

struct rtx_def
{
  unsigned int in_struct : 1;
  union u {
    rtunion fld[1];
  } u;
};
typedef struct rtx_def *rtx;

static void
check_annul_list_true_false (int annul_true_p, rtx delay_list)
{
  rtx temp;
  while (1)
    {
      temp = delay_list;
      rtx trial = (((temp)->u.fld[0]).rt_rtx);
      if ((annul_true_p && (((trial))->in_struct)))
	return;
    }
}
--- snip ---

Bye,
Ralf
Comment 1 Andrew Pinski 2005-08-02 15:13:06 UTC
I think this only effects 4.0.x.
Comment 2 Ralf Menzel 2005-10-04 15:10:44 UTC
(In reply to comment #1)
> I think this only effects 4.0.x.

Yes, I tried version 3.4.4, 4.0.0 and 4.0.2 of the compiler.
No Problem with 3.4.4, while 4.0.0 and 4.0.2 fail.
Comment 3 Eric Botcazou 2005-10-15 16:57:44 UTC
Still present on 4.0.x branch.
Comment 4 Eric Botcazou 2005-10-15 16:58:16 UTC
Investigating.
Comment 5 Eric Botcazou 2005-10-17 10:22:09 UTC
Recategorizing.
Comment 6 GCC Commits 2005-10-19 14:42:23 UTC
Subject: Bug 23199

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	ebotcazou@gcc.gnu.org	2005-10-19 14:42:17

Modified files:
	gcc            : ChangeLog cfgrtl.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/gcc.dg: profile-generate-2.c 

Log message:
	PR middle-end/23199
	* cfgrtl.c (safe_insert_insn_on_edge): Use can_copy_p to detect
	whether registers live on the edge can be saved/restored.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.10187&r2=2.10188
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cfgrtl.c.diff?cvsroot=gcc&r1=1.182&r2=1.183
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.6212&r2=1.6213
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/profile-generate-2.c.diff?cvsroot=gcc&r1=NONE&r2=1.1

Comment 7 GCC Commits 2005-10-19 14:45:53 UTC
Subject: Bug 23199

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-4_0-branch
Changes by:	ebotcazou@gcc.gnu.org	2005-10-19 14:45:48

Modified files:
	gcc            : ChangeLog cfgrtl.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/gcc.dg: profile-generate-2.c 

Log message:
	PR middle-end/23199
	* cfgrtl.c (safe_insert_insn_on_edge): Use can_copy_p to detect
	whether registers live on the edge can be saved/restored.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=2.7592.2.471&r2=2.7592.2.472
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cfgrtl.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.158.4.1&r2=1.158.4.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.5084.2.471&r2=1.5084.2.472
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/profile-generate-2.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.2.1

Comment 8 Eric Botcazou 2005-10-19 14:50:37 UTC
See http://gcc.gnu.org/ml/gcc-patches/2005-10/msg01015.html.  Profiled bootstrap now works for me with 4.0.3pre on sparc-sun-solaris2.9 and sparc64-sun-solaris2.9.

Thanks for the bugreport.