From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15449 invoked by alias); 23 Mar 2003 19:56:00 -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 15427 invoked by uid 71); 23 Mar 2003 19:56:00 -0000 Resent-Date: 23 Mar 2003 19:56:00 -0000 Resent-Message-ID: <20030323195600.15426.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org, Lukas Geyer Resent-Reply-To: gcc-gnats@gcc.gnu.org, 185903@bugs.debian.org Received: (qmail 8538 invoked from network); 23 Mar 2003 19:48:49 -0000 Received: from unknown (HELO hirsch.in-berlin.de) (192.109.42.6) by sources.redhat.com with SMTP; 23 Mar 2003 19:48:49 -0000 Received: from tango.net.local (mail@dsl-213-023-134-195.arcor-ip.net [213.23.134.195]) (authenticated bits=0) by hirsch.in-berlin.de (8.12.8/8.12.8/Debian-2) with ESMTP id h2NJmlaq017947 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NOT); Sun, 23 Mar 2003 20:48:48 +0100 Received: from doko by tango.net.local with local (Exim 4.12 #1 (Debian) [+araqnid]) id 18xBSY-00053a-00; Sun, 23 Mar 2003 20:48:46 +0100 Message-Id: Date: Sun, 23 Mar 2003 20:26:00 -0000 From: Matthias Klose Reply-To: 185903@bugs.debian.org To: gcc-gnats@gcc.gnu.org, debian-gcc@lists.debian.org X-Send-Pr-Version: 3.113 X-GNATS-Notify: Lukas Geyer Subject: target/10194: [3.2 regression] [arm] gcc optimization error with -O2, affecting bison X-SW-Source: 2003-03/txt/msg01540.txt.bz2 List-Id: >Number: 10194 >Category: target >Synopsis: [3.2 regression] [arm] gcc optimization error with -O2, affecting bison >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: wrong-code >Submitter-Id: net >Arrival-Date: Sun Mar 23 19:56:00 UTC 2003 >Closed-Date: >Last-Modified: >Originator: Lukas Geyer >Release: 3.2.3 (Debian prerelease) >Organization: The Debian Project >Environment: System: Debian GNU/Linux (unstable) Architecture: arm host: arm-linux Thread model: posix gcc version 3.2.3 20030316 (Debian prerelease) >Description: [ Reported to the Debian BTS as report #185903. Please CC 185903@bugs.debian.org on replies. Log of report can be found at http://bugs.debian.org/185903 ] [gcc-2.95 and gcc-3.3 CVS 20030221 do not show this behaviour] Lukas Geyer writes: I have been unable to cook up a short testcase, mainly due to bad connectivity and lack of experience. However, bison-1.875a gets miscompiled on arm with -O2, it seems to compile correctly with -O1. My experiments where done in a sid chroot on debussy, so I used the available versions in sid. Here are the relevant code sections and what gdb shows. src/reader.c: void epilogue_augment (const char *epilogue, location loc) { char *extension = NULL; obstack_fgrow1 (&muscle_obstack, "]b4_syncline([[%d]], [[", loc.start.line); MUSCLE_OBSTACK_SGROW (&muscle_obstack, quotearg_style (c_quoting_style, loc.start.file)); obstack_sgrow (&muscle_obstack, "]])[\n"); obstack_sgrow (&muscle_obstack, epilogue); obstack_1grow (&muscle_obstack, 0); extension = obstack_finish (&muscle_obstack); muscle_grow ("epilogue", extension, ""); obstack_free (&muscle_obstack, extension); } lib/quotearg.c: char * quotearg_n_style (int n, enum quoting_style s, char const *arg) { struct quoting_options const o = quoting_options_from_style (s); return quotearg_n_options (n, arg, SIZE_MAX, &o); } char * quotearg_style (enum quoting_style s, char const *arg) { return quotearg_n_style (0, s, arg); } gdb backtrace: gdb backtrace: #0 0x00027964 in quotearg_buffer_restyled (buffer=0x3d8f4 "\"YPE_NAME_OR_ID", buffersize=256, arg=0x2c
, argsize=4294967295, quoting_style=c_quoting_style, o=0xbfffc510) at quotearg.c:481 #1 0x00027a64 in quotearg_buffer (buffer=0x3d8f4 "\"YPE_NAME_OR_ID", buffersize=0, arg=0x2c
, argsize=4294967295, o=0xbfffc510) at quotearg.c:503 #2 0x00027b38 in quotearg_n_options (n=0, arg=0x2c
, argsize=4294967295, options=0xbfffc510) at quotearg.c:560 #3 0x00027c84 in quotearg_n_style (n=0, s=256, arg=0x2c
) at quotearg.c:600 #4 0x00018a38 in epilogue_augment ( epilogue=0x950e0 "\n\n/*@@-redecl@@*/\nextern char *yytext;\n/*@@=redecl@@*/\n\n# include \"bison.reset\ \"\n\nvoid yyerror (/*@@unused@@*/ char *s) \n{\n static bool givehint = FALSE;\n\n if (context_inIterDef\ ())\n {\n llerr"..., loc= {start = {file = 0x400e8d80 "", line = 0, column = 4096}, end = {file = 0x4013eb24 "0\n\022", line = 249784, column = 280128}}) at reader.c:94 #5 0x00015c0c in gram_parse () at parse-gram.y:399 Looking at this backtrace, it seems that the pointer loc.start.file is passed incorrectly to quotearg_n_style, optimizing away quotearg_style, subsequently causing a segfault. I can supply the .y file which causes the segfault, if it would be helpful, or you can just get from the source of lclint, it is cgrammar.y, see also http://buildd.debian.org/fetch.php?&pkg=lclint&ver=1%3A2.4b-1.4&arch=arm&stamp=1048326775&file=log&as=raw Best regards, Lukas P.S.: I recommend compiling the bison package with -O1 on arm, until this issue is resolved. I will separately file a bug against bison proposing this. >How-To-Repeat: >Fix: >Release-Note: >Audit-Trail: >Unformatted: