From mboxrd@z Thu Jan 1 00:00:00 1970 From: MAKINO Takaki To: gcc-gnats@gcc.gnu.org Cc: mak@is.s.u-tokyo.ac.jp Subject: c++/3620: GCC3.0 optimization on anonymous union causes ICE Date: Mon, 09 Jul 2001 06:26:00 -0000 Message-id: <20010709220907.75F7.MAK@is.s.u-tokyo.ac.jp> X-SW-Source: 2001-07/msg00219.html List-Id: >Number: 3620 >Category: c++ >Synopsis: GCC3.0 optimization on anonymous union causes ICE >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: ice-on-legal-code >Submitter-Id: net >Arrival-Date: Mon Jul 09 06:26:00 PDT 2001 >Closed-Date: >Last-Modified: >Originator: Makino Takaki >Release: 3.0 >Organization: Tokyo Univ. >Environment: System: Linux tetley.is.s.u-tokyo.ac.jp 2.2.16-22enterprise #1 SMP Tue Aug 22 16:29:32 EDT 2000 i686 unknown Architecture: i686 host: i686-pc-linux-gnu build: i686-pc-linux-gnu target: i686-pc-linux-gnu configured with: ../configure --prefix=/home/users/mak/local/Linux-i686 >Description: ICE occurs with the following code and -O option: --------------------------------------test.cpp void something(char *); int main() { union { char d[sizeof(int)]; int ll; }; something(d); return ll; } ----------------------------------------------- mak@tetley% gcc -v Reading specs from /home/users/mak/local/Linux-i686/lib/gcc-lib/i686-pc-linux-gnu/3.0/specs Configured with: ../configure --prefix=/home/users/mak/local/Linux-i686 Thread model: single gcc version 3.0 mak@tetley% g++ -O hoge.cpp hoge.cpp: In function `int main()': hoge.cpp:12: Internal compiler error in elimination_effects, at reload1.c:2687 Please submit a full bug report, with preprocessed source if appropriate. See for instructions. >How-To-Repeat: See description. >Fix: Work around is to give a name to the union. int main() { union { char d[sizeof(int)]; int ll; } some_name; something(some_name.d); return some_name.ll; } -- MAKINO Takaki >Release-Note: >Audit-Trail: >Unformatted: