public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* target/10194: [3.2 regression] [arm] gcc optimization error with -O2, affecting bison
@ 2003-03-23 20:26 Matthias Klose
  0 siblings, 0 replies; 4+ messages in thread
From: Matthias Klose @ 2003-03-23 20:26 UTC (permalink / raw)
  To: gcc-gnats, debian-gcc


>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 <lukas@debian.org>
>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 <Address 0x2c out of bounds>, 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 <Address 0x2c out of bounds>, argsize=4294967295,
    o=0xbfffc510) at quotearg.c:503
#2  0x00027b38 in quotearg_n_options (n=0,
    arg=0x2c <Address 0x2c out of bounds>, argsize=4294967295,
    options=0xbfffc510) at quotearg.c:560
#3  0x00027c84 in quotearg_n_style (n=0, s=256,
    arg=0x2c <Address 0x2c out of bounds>) 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:


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: target/10194: [3.2 regression] [arm] gcc optimization error with -O2, affecting bison
@ 2003-05-03 13:12 ehrhardt
  0 siblings, 0 replies; 4+ messages in thread
From: ehrhardt @ 2003-05-03 13:12 UTC (permalink / raw)
  To: 185903, gcc-bugs, gcc-prs, lukas, nobody

Synopsis: [3.2 regression] [arm] gcc optimization error with -O2, affecting bison

State-Changed-From-To: feedback->closed
State-Changed-By: cae
State-Changed-When: Sat May  3 13:12:09 2003
State-Changed-Why:
    Apparently fixed in 3.3.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10194


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: target/10194: [3.2 regression] [arm] gcc optimization error with -O2, affecting bison
@ 2003-04-30 21:06 Lukas Geyer
  0 siblings, 0 replies; 4+ messages in thread
From: Lukas Geyer @ 2003-04-30 21:06 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR target/10194; it has been noted by GNATS.

From: Lukas Geyer <lukas@debian.org>
To: ehrhardt@mathematik.uni-ulm.de, 185903@bugs.debian.org,
	 gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org,
	 nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org
Cc:  
Subject: Re: target/10194: [3.2 regression] [arm] gcc optimization error with -O2, affecting bison
Date: 30 Apr 2003 16:57:23 -0400

 ehrhardt@mathematik.uni-ulm.de writes:
 
 > Synopsis: [3.2 regression] [arm] gcc optimization error with -O2, affecting bison
 > 
 > State-Changed-From-To: open->feedback
 > State-Changed-By: cae
 > State-Changed-When: Mon Apr 28 11:24:14 2003
 > State-Changed-Why:
 >     According to the Bug-Database, this report is most likely 3.2-only.
 >     As the 3.2-branch is closed, i.e. there will be no further release
 >     after 3.2.3 we should probably close this report. Could you possibly
 >     verify that this is indeed fixed in 3.3 (as stated in the report) and 3.4?
 
 I re-checked with gcc-3.3, more precisely
 
 gcc-3.3 (GCC) 3.3 20030415 (Debian prerelease)
 
 (output of --version) and it compiles correctly. However, there seems
 to be no Debian package of 3.4 installed on the machines I use for
 testing. So I cannot test with gcc 3.4, as I do not have any ARM
 machines myself.
 
 Best regards,
 Lukas


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: target/10194: [3.2 regression] [arm] gcc optimization error with -O2, affecting bison
@ 2003-04-28 11:24 ehrhardt
  0 siblings, 0 replies; 4+ messages in thread
From: ehrhardt @ 2003-04-28 11:24 UTC (permalink / raw)
  To: 185903, gcc-bugs, gcc-prs, lukas, nobody

Synopsis: [3.2 regression] [arm] gcc optimization error with -O2, affecting bison

State-Changed-From-To: open->feedback
State-Changed-By: cae
State-Changed-When: Mon Apr 28 11:24:14 2003
State-Changed-Why:
    According to the Bug-Database, this report is most likely 3.2-only.
    As the 3.2-branch is closed, i.e. there will be no further release
    after 3.2.3 we should probably close this report. Could you possibly
    verify that this is indeed fixed in 3.3 (as stated in the report) and 3.4?
    
      Thanks and kind regards    Christian
    

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10194


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-05-03 13:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-23 20:26 target/10194: [3.2 regression] [arm] gcc optimization error with -O2, affecting bison Matthias Klose
2003-04-28 11:24 ehrhardt
2003-04-30 21:06 Lukas Geyer
2003-05-03 13:12 ehrhardt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).