Bug 15783 - [3.4/4.0 regression] ICE with union assignment in 64-bit mode
Summary: [3.4/4.0 regression] ICE with union assignment in 64-bit mode
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 3.4.0
: P2 normal
Target Milestone: 3.4.1
Assignee: Eric Botcazou
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2004-06-02 20:38 UTC by Paul Pluzhnikov
Modified: 2004-10-30 21:11 UTC (History)
2 users (show)

See Also:
Host: sparc-sun-solaris2.7
Target: sparc-sun-solaris2.7
Build: sparc-sun-solaris2.7
Known to work: 3.3.2 3.3.4
Known to fail: 3.4.0 3.4.1 4.0.0
Last reconfirmed: 2004-06-02 21:26:39


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Pluzhnikov 2004-06-02 20:38:43 UTC
Attached test case causes:
c33c.i:12: internal compiler error: in emit_move_insn, at expr.c:2809

This happens with gcc-3.4.0 (but not gcc-3.3 or 3.1), and only in 64-bit mode.
Removing 'u2s_e' struct member makes the bug go away.

$ /usr/local/gcc-3.4.0/bin/gcc -c c33c.i -m64 -v
Reading specs from /usr/local/gcc-3.4.0/lib/gcc/sparc-sun-solaris2.7/3.4.0/specs
Configured with: /home/camel1/paul/Archive/gcc-3.4.0/configure
--prefix=/usr/local/gcc-3.4.0 --enable-languages=c,c++ : (reconfigured)
../../../camel1/paul/Archive/gcc-3.4.0/configure --prefix=/usr/local/gcc-3.4.0
--enable-languages=c,c++
Thread model: posix
gcc version 3.4.0
 /usr/local/gcc-3.4.0/libexec/gcc/sparc-sun-solaris2.7/3.4.0/cc1 -fpreprocessed
c33c.i -mptr64 -mstack-bias -mno-v8plus -quiet -dumpbase c33c.i -m64 -mcpu=v7
-auxbase c33c -version -o /home/solaris/development/devtest/tmp/ccQWlq8A.s
GNU C version 3.4.0 (sparc-sun-solaris2.7)
        compiled by GNU C version 2.95.3 20010315 (release).
GGC heuristics: --param ggc-min-expand=56 --param ggc-min-heapsize=49152
c33c.i: In function `unions':
c33c.i:12: internal compiler error: in emit_move_insn, at expr.c:2809
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

--- cut --- c33c.i ---
union u2 {
    struct
    {
        int u2s_a, u2s_b, u2s_c, u2s_d, u2s_e;
    } u2_s;
    double u2_d;
} u2a;

union u2 fu2();
void unions()
{
    u2a = fu2(11);
}
--- cut --- c33c.i ---
Comment 1 Eric Botcazou 2004-06-02 21:26:38 UTC
Probably a fallout of the ABI fixes.
Comment 2 Eric Botcazou 2004-06-03 11:26:36 UTC
Investigating.
Comment 3 GCC Commits 2004-06-07 20:58:43 UTC
Subject: Bug 15783

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	ebotcazou@gcc.gnu.org	2004-06-07 20:58:34

Modified files:
	gcc            : ChangeLog 
	gcc/config/sparc: sparc.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/gcc.dg: union-1.c 

Log message:
	PR target/15783
	* config/sparc/sparc.c (function_arg_union_value): Add 'mode'
	parameter.  Enumerate the registers inside the PARALLEL.
	(function_arg): Adjust call to function_arg_union_value.
	(function_value): Likewise.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.3869&r2=2.3870
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/sparc/sparc.c.diff?cvsroot=gcc&r1=1.301&r2=1.302
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3823&r2=1.3824
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/union-1.c.diff?cvsroot=gcc&r1=NONE&r2=1.1

Comment 4 GCC Commits 2004-06-07 21:03:13 UTC
Subject: Bug 15783

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-branch
Changes by:	ebotcazou@gcc.gnu.org	2004-06-07 21:03:08

Modified files:
	gcc            : ChangeLog 
	gcc/config/sparc: sparc.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/gcc.dg: union-1.c 

Log message:
	PR target/15783
	* config/sparc/sparc.c (function_arg_union_value): Add 'mode'
	parameter.  Enumerate the registers inside the PARALLEL.
	(function_arg): Adjust call to function_arg_union_value.
	(function_value): Likewise.

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.476&r2=2.2326.2.477
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/sparc/sparc.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.271.4.14&r2=1.271.4.15
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3389.2.199&r2=1.3389.2.200
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/union-1.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.2.1

Comment 5 Eric Botcazou 2004-06-07 21:07:52 UTC
See http://gcc.gnu.org/ml/gcc-patches/2004-06/msg00378.html