From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17162 invoked by alias); 19 Nov 2001 21:26:02 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 17117 invoked by uid 71); 19 Nov 2001 21:26:01 -0000 Resent-Date: 19 Nov 2001 21:26:01 -0000 Resent-Message-ID: <20011119212601.17116.qmail@sourceware.cygnus.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-To: nobody@gcc.gnu.org Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, Gert-jan Los Received:(qmail 16588 invoked from network); 19 Nov 2001 21:25:30 -0000 Received: from unknown (HELO snoopy.rz.uni-mannheim.de) (134.155.50.213) by sourceware.cygnus.com with SMTP; 19 Nov 2001 21:25:30 -0000 Received: from los by snoopy.rz.uni-mannheim.de with local (Exim 3.32 #1 (Debian)) id 165vtr-0002Gj-00 for ; Mon, 19 Nov 2001 22:24:19 +0100 Message-Id: Date: Wed, 14 Nov 2001 10:27:00 -0000 From: Gert-jan Los To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version:3.113 Subject: middle-end/4907: ICE on premature use of reference X-SW-Source: 2001-11/txt/msg00313.txt.bz2 List-Id: >Number: 4907 >Category: middle-end >Synopsis: ICE if a reference is used during its own definition >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: ice-on-illegal-code >Submitter-Id: net >Arrival-Date: Mon Nov 19 13:26:01 PST 2001 >Closed-Date: >Last-Modified: >Originator: Gert-jan Los >Release: 3.1 20011113 (experimental) >Organization: Universitaet Mannheim >Environment: System: Linux snoopy 2.2.19 #1 Thu May 31 15:16:55 CEST 2001 sparc unknown Architecture: sparc host: sparc-unknown-linux-gnu build: sparc-unknown-linux-gnu target: sparc-unknown-linux-gnu configured with: /users/los/admin/software/gcc/snapshot/configure --prefix=/opt/devel --with-as=/opt/devel/bin/as --with-ld=/opt/devel/bin/ld --disable-threads --disable-nls --enable-languages=c,c++ --enable-long-long >Description: Compiling the presumably invalid code below gives an ICE on mainline and 2.95.x. gcc version 3.1 20011113 (experimental) : In function `int main()': :4: Internal compiler error in make_decl_rtl, at varasm.c:834 gcc version 2.95.4 20011006 (Debian prerelease) : In function `int main()': :4: Internal compiler error: :4: Internal compiler error in `expand_expr', at expr.c:5852 gcc version 3.0.2 (Debian) Compiles OK. The value of c is 0 (zero). Changing the code to return 'x' instead '&x' results in a segmentation fault at runtime. >How-To-Repeat: int foo(int const& x) { return int(&x); } int main() { int const& c = foo(c); return 0; } >Fix: >Release-Note: >Audit-Trail: >Unformatted: