From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17099 invoked by alias); 15 Mar 2010 20:44:45 -0000 Received: (qmail 17031 invoked by uid 48); 15 Mar 2010 20:44:33 -0000 Date: Mon, 15 Mar 2010 20:44:00 -0000 Subject: [Bug c/43384] New: [4.3/4.4/4.5 Regression] ICE: Segmentation fault with invalid K&R-like declaration related to labels X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "zsojka at seznam dot cz" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-03/txt/msg01425.txt.bz2 Command line: gcc testcase.c ----- testcase.c ----- void c_direct(p) void *p = &&lab; {} ---------------------- 3.3.6 gives: $ gcc-3.3.6 testcase.c testcase.c: In function `c_direct': testcase.c:2: error: parameter `p' is initialized testcase.c:2: error: label `lab' used but not defined 3.4.6 and newer give: $ /mnt/svn/gcc-trunk/binary-157460-lto/bin/gcc testcase.c testcase.c: In function 'c_direct': testcase.c:2:1: error: parameter 'p' is initialized testcase.c:2:1: internal compiler error: Segmentation fault (or bail out, without checking) Valgrind on trunk outputs: $ valgrind --trace-children=yes /mnt/svn/gcc-trunk/binary-157460-lto/bin/gcc testcase.c ==5200== Invalid read of size 4 ==5200== at 0x49B7EF: bind (c-decl.c:604) ==5200== by 0x49B9C8: bind_label (c-decl.c:670) ==5200== by 0x4A1A68: lookup_label (c-decl.c:3027) ==5200== by 0x4F6035: finish_label_address_expr (c-common.c:5659) ==5200== by 0x50C90C: c_parser_unary_expression (c-parser.c:5141) ==5200== by 0x50D262: c_parser_cast_expression (c-parser.c:5043) ==5200== by 0x50D404: c_parser_binary_expression (c-parser.c:4859) ==5200== by 0x50DA5C: c_parser_conditional_expression (c-parser.c:4645) ==5200== by 0x50DF6E: c_parser_expr_no_commas (c-parser.c:4565) ==5200== by 0x511ADF: c_parser_declaration_or_fndef (c-parser.c:3073) ==5200== by 0x511D75: c_parser_declaration_or_fndef (c-parser.c:1335) ==5200== by 0x5163B7: c_parse_file (c-parser.c:1005) ==5200== Address 0x28 is not stack'd, malloc'd or (recently) free'd -- Summary: [4.3/4.4/4.5 Regression] ICE: Segmentation fault with invalid K&R-like declaration related to labels Product: gcc Version: 4.5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: zsojka at seznam dot cz GCC host triplet: x86_64-pc-linux-gnu GCC target triplet: x86_64-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43384