public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c/9185: gcc produces errornous code on cygwin host when -fomit-frame-pointer is used together with -O2 or -O3
@ 2003-01-07  1:04 bangerth
  0 siblings, 0 replies; 4+ messages in thread
From: bangerth @ 2003-01-07  1:04 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, macklobell, nobody

Synopsis: gcc produces errornous code on cygwin host when -fomit-frame-pointer is used together with -O2 or -O3

State-Changed-From-To: open->analyzed
State-Changed-By: bangerth
State-Changed-When: Mon Jan  6 17:04:39 2003
State-Changed-Why:
    Already analysed.

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


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

* Re: c/9185: gcc produces errornous code on cygwin host when -fomit-frame-pointer is used together with -O2 or -O3
@ 2003-01-06 22:46 Mack Lobell
  0 siblings, 0 replies; 4+ messages in thread
From: Mack Lobell @ 2003-01-06 22:46 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

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

From: "Mack Lobell" <macklobell@hotmail.com>
To: dannysmith@users.sourceforge.net, gcc-gnats@gcc.gnu.org, gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org, nobody@gcc.gnu.org
Cc:  
Subject: Re: c/9185: gcc produces errornous code on cygwin host when
 -fomit-frame-pointer is used together with -O2 or -O3
Date: Mon, 06 Jan 2003 22:34:16 +0000

 The fix in PR8750 solves the problem.
 
 Verified with gcc3.3 and gcc3.4.
 
 //Regards
 
 
 
 
 
 
 >From: Danny Smith <dannysmith@clear.net.nz>
 >Reply-To: Danny Smith <dannysmith@users.sourceforge.net>
 >To: macklobell@hotmail.com, gcc-gnats@gcc.gnu.org, gcc-prs@gcc.gnu.org, 
 >gcc-bugs@gcc.gnu.org, nobody@gcc.gnu.org
 >Subject: Re: c/9185: gcc produces errornous code on cygwin host when 
 >-fomit-frame-pointer is used together with -O2 or -O3
 >Date: Mon, 06 Jan 2003 20:51:17 +0000
 >
 >
 >http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=g
 >cc&pr=9185
 >
 >I think this may be related  to PR8750 and (IMO, erroneously) closed
 >PR6810.
 >Could you try the patch to i386.c (ix86_expand_prologue ) that is in the
 >8750 audit trail.  It may not be correct patch but at least it seems to
 >fix 8750 and *this PR on mingw32
 >
 >Danny
 
 
 _________________________________________________________________
 STOP MORE SPAM with the new MSN 8 and get 2 months FREE* 
 http://join.msn.com/?page=features/junkmail
 


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

* Re: c/9185: gcc produces errornous code on cygwin host when -fomit-frame-pointer is used together with -O2 or -O3
@ 2003-01-06 21:06 Danny Smith
  0 siblings, 0 replies; 4+ messages in thread
From: Danny Smith @ 2003-01-06 21:06 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

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

From: Danny Smith <dannysmith@clear.net.nz>
To: macklobell@hotmail.com, gcc-gnats@gcc.gnu.org, gcc-prs@gcc.gnu.org,
 gcc-bugs@gcc.gnu.org, nobody@gcc.gnu.org
Cc:  
Subject: Re: c/9185: gcc produces errornous code on cygwin host when
 -fomit-frame-pointer is used together with -O2 or -O3
Date: Mon, 06 Jan 2003 20:51:17 +0000

 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=g
 cc&pr=9185
 
 I think this may be related  to PR8750 and (IMO, erroneously) closed
 PR6810.
 Could you try the patch to i386.c (ix86_expand_prologue ) that is in the
 8750 audit trail.  It may not be correct patch but at least it seems to
 fix 8750 and *this PR on mingw32
 
 Danny
 


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

* c/9185: gcc produces errornous code on cygwin host when -fomit-frame-pointer is used together with -O2 or -O3
@ 2003-01-06 13:36 macklobell
  0 siblings, 0 replies; 4+ messages in thread
From: macklobell @ 2003-01-06 13:36 UTC (permalink / raw)
  To: gcc-gnats


>Number:         9185
>Category:       c
>Synopsis:       gcc produces errornous code on cygwin host when -fomit-frame-pointer is used together with -O2 or -O3
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jan 06 05:36:20 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     macklobell@hotmail.com
>Release:        All
>Organization:
>Environment:
$ uname -a
CYGWIN_NT-5.1 VOLVO 1.3.18(0.69/3/2) 2002-12-25 15:37 i686 unknown unknown Cygwin

$ echo $CC33
/home/lobell/build/native_gcc3.3/gcc/xgcc.exe -B /home/lobell/build/native_gcc3.3/gcc

$ $CC33 --version
xgcc (GCC) 3.3 20030103 (prerelease)
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ as --version
GNU assembler 2.13.90 20021118
Copyright 2002 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License.  This program has absolutely no warranty.
This assembler was configured for a target of `i686-pc-cygwin'.

$ ld --version
GNU ld version 2.13.90 20021118
Copyright 2002 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License.  This program has absolutely no warranty.
>Description:
I came a cross this problem when building binutils. All logs/traces are from builds of the linker (ld.exe).

The problem, if i build the linker with "-fomit-frame-pointer" together with -O2 or -O3 the executable will crash (segmentation fault). ld.exe always crash in the function parse_args(lexsup.c), so all logs attached are from that file.

This might only be a cygwin problem. I did the same tests o n a FreeBSD machine and the executables work fine there.

*** Working testcase. -fomit-frame-pointer with -O1 ***

$ rm lexsup.[ios]; make CC="$CC33" CFLAGS="-g -O1 -fomit-frame-pointer -save-temps -dAP -Wa,-al
h=mixed.log" && ./ld-new.exe -V
make  all-recursive
make[1]: Entering directory `/home/lobell/build/native_binutils/ld'
Making all in po
make[2]: Entering directory `/home/lobell/build/native_binutils/ld/po'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/lobell/build/native_binutils/ld/po'
make[2]: Entering directory `/home/lobell/build/native_binutils/ld'
/home/lobell/build/native_gcc3.3/gcc/xgcc.exe -B /home/lobell/build/native_gcc3.3/gcc -DHAVE_CON
FIG_H -I. -I../../../src/binutils-2.13.1/ld -I. -D_GNU_SOURCE -I. -I../../../src/binutils-2.13.1
/ld -I../bfd -I../../../src/binutils-2.13.1/ld/../bfd -I../../../src/binutils-2.13.1/ld/../inclu
de -I../../../src/binutils-2.13.1/ld/../intl -I../intl  -g -O1 -fomit-frame-pointer -save-temps
-dAP -Wa,-alh=mixed.log -DLOCALEDIR="\"/usr/local/share/locale\""   -W -Wall -Wstrict-prototypes
 -Wmissing-prototypes -g -O1 -fomit-frame-pointer -save-temps -dAP -Wa,-alh=mixed.log -c ../../.
./src/binutils-2.13.1/ld/lexsup.c
/bin/sh ./libtool --mode=link /home/lobell/build/native_gcc3.3/gcc/xgcc.exe -B /home/lobell/buil
d/native_gcc3.3/gcc -W -Wall -Wstrict-prototypes -Wmissing-prototypes -g -O1 -fomit-frame-pointe
r -save-temps -dAP -Wa,-alh=mixed.log  -o ld-new.exe  ldgram.o ldlex.o lexsup.o ldlang.o mri.o l
dctor.o ldmain.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o ei386pe.o deffile
p.o pe-dll.o ../bfd/libbfd.la ../libiberty/libiberty.a
/home/lobell/build/native_gcc3.3/gcc/xgcc.exe -B /home/lobell/build/native_gcc3.3/gcc -W -Wall -
Wstrict-prototypes -Wmissing-prototypes -g -O1 -fomit-frame-pointer -save-temps -dAP -Wa,-alh=mi
xed.log -o ld-new.exe ldgram.o ldlex.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o ldwrite.o ldexp
.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o ei386pe.o deffilep.o pe-dll.o  ../bfd/.libs/libbf
d.a ../libiberty/libiberty.a
make[2]: Leaving directory `/home/lobell/build/native_binutils/ld'
make[1]: Leaving directory `/home/lobell/build/native_binutils/ld'
GNU ld version 2.13.1                   <- *** Working! ***
  Supported emulations:
   i386pe

*** Not working testcase. -fomit-frame-pointer with -O2 ***

$ rm lexsup.[ios]; make CC="$CC33" CFLAGS="-g -O2 -fomit-frame-pointer -save-temps -dAP -Wa,-al
h=mixed.log" && ./ld-new.exe -V
make  all-recursive
make[1]: Entering directory `/home/lobell/build/native_binutils/ld'
Making all in po
make[2]: Entering directory `/home/lobell/build/native_binutils/ld/po'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/lobell/build/native_binutils/ld/po'
make[2]: Entering directory `/home/lobell/build/native_binutils/ld'
/home/lobell/build/native_gcc3.3/gcc/xgcc.exe -B /home/lobell/build/native_gcc3.3/gcc -DHAVE_CON
FIG_H -I. -I../../../src/binutils-2.13.1/ld -I. -D_GNU_SOURCE -I. -I../../../src/binutils-2.13.1
/ld -I../bfd -I../../../src/binutils-2.13.1/ld/../bfd -I../../../src/binutils-2.13.1/ld/../inclu
de -I../../../src/binutils-2.13.1/ld/../intl -I../intl  -g -O2 -fomit-frame-pointer -save-temps
-dAP -Wa,-alh=mixed.log -DLOCALEDIR="\"/usr/local/share/locale\""   -W -Wall -Wstrict-prototypes
 -Wmissing-prototypes -g -O2 -fomit-frame-pointer -save-temps -dAP -Wa,-alh=mixed.log -c ../../.
./src/binutils-2.13.1/ld/lexsup.c
/bin/sh ./libtool --mode=link /home/lobell/build/native_gcc3.3/gcc/xgcc.exe -B /home/lobell/buil
d/native_gcc3.3/gcc -W -Wall -Wstrict-prototypes -Wmissing-prototypes -g -O2 -fomit-frame-pointe
r -save-temps -dAP -Wa,-alh=mixed.log  -o ld-new.exe  ldgram.o ldlex.o lexsup.o ldlang.o mri.o l
dctor.o ldmain.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o ei386pe.o deffile
p.o pe-dll.o ../bfd/libbfd.la ../libiberty/libiberty.a
/home/lobell/build/native_gcc3.3/gcc/xgcc.exe -B /home/lobell/build/native_gcc3.3/gcc -W -Wall -
Wstrict-prototypes -Wmissing-prototypes -g -O2 -fomit-frame-pointer -save-temps -dAP -Wa,-alh=mi
xed.log -o ld-new.exe ldgram.o ldlex.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o ldwrite.o ldexp
.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o ei386pe.o deffilep.o pe-dll.o  ../bfd/.libs/libbf
d.a ../libiberty/libiberty.a
make[2]: Leaving directory `/home/lobell/build/native_binutils/ld'
make[1]: Leaving directory `/home/lobell/build/native_binutils/ld'
Segmentation fault (core dumped)        <- *** NOTE! ***


*** Not working testcase. -fomit-frame-pointer and -O3 ***

$ rm lexsup.[ios]; make CC="$CC33" CFLAGS="-g -O3 -fomit-frame-pointer -save-temps -dAP -Wa,-al
h=mixed.log" && ./ld-new.exe -V
make  all-recursive
make[1]: Entering directory `/home/lobell/build/native_binutils/ld'
Making all in po
make[2]: Entering directory `/home/lobell/build/native_binutils/ld/po'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/lobell/build/native_binutils/ld/po'
make[2]: Entering directory `/home/lobell/build/native_binutils/ld'
/home/lobell/build/native_gcc3.3/gcc/xgcc.exe -B /home/lobell/build/native_gcc3.3/gcc -DHAVE_CON
FIG_H -I. -I../../../src/binutils-2.13.1/ld -I. -D_GNU_SOURCE -I. -I../../../src/binutils-2.13.1
/ld -I../bfd -I../../../src/binutils-2.13.1/ld/../bfd -I../../../src/binutils-2.13.1/ld/../inclu
de -I../../../src/binutils-2.13.1/ld/../intl -I../intl  -g -O3 -fomit-frame-pointer -save-temps
-dAP -Wa,-alh=mixed.log -DLOCALEDIR="\"/usr/local/share/locale\""   -W -Wall -Wstrict-prototypes
 -Wmissing-prototypes -g -O3 -fomit-frame-pointer -save-temps -dAP -Wa,-alh=mixed.log -c ../../.
./src/binutils-2.13.1/ld/lexsup.c
/bin/sh ./libtool --mode=link /home/lobell/build/native_gcc3.3/gcc/xgcc.exe -B /home/lobell/buil
d/native_gcc3.3/gcc -W -Wall -Wstrict-prototypes -Wmissing-prototypes -g -O3 -fomit-frame-pointe
r -save-temps -dAP -Wa,-alh=mixed.log  -o ld-new.exe  ldgram.o ldlex.o lexsup.o ldlang.o mri.o l
dctor.o ldmain.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o ei386pe.o deffile
p.o pe-dll.o ../bfd/libbfd.la ../libiberty/libiberty.a
/home/lobell/build/native_gcc3.3/gcc/xgcc.exe -B /home/lobell/build/native_gcc3.3/gcc -W -Wall -
Wstrict-prototypes -Wmissing-prototypes -g -O3 -fomit-frame-pointer -save-temps -dAP -Wa,-alh=mi
xed.log -o ld-new.exe ldgram.o ldlex.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o ldwrite.o ldexp
.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o ei386pe.o deffilep.o pe-dll.o  ../bfd/.libs/libbf
d.a ../libiberty/libiberty.a
make[2]: Leaving directory `/home/lobell/build/native_binutils/ld'
make[1]: Leaving directory `/home/lobell/build/native_binutils/ld'
Segmentation fault (core dumped)        <- *** NOTE! ***

*** gdb output ***

$ /usr/local/native/bin/gdb.exe ./ld-new.exe
GNU gdb 5.3
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-cygwin"...
(gdb) r
Starting program: /home/lobell/build/native_binutils/ld/ld-new.exe

Program received signal SIGSEGV, Segmentation fault.
parse_args (argc=Cannot access memory at address 0x1051
) at ../../../src/binutils-2.13.1/ld/lexsup.c:492
492                                 longopts[il] = ld_options[i].opt;
(gdb) where
#0  parse_args (argc=Cannot access memory at address 0x1051
) at ../../../src/binutils-2.13.1/ld/lexsup.c:492
#1  0x77fa2aef in _libkernel32_a_iname ()
Cannot access memory at address 0x1
(gdb)


I have done these tests with 3.3, 3.4 and 3.2, and the problem exists in all versions.

I have attached the following files from a build with CFLAGS="-fomit-frame-pointer -O2":
lexsup.s    (-save-temps -dAP)
mixed.log   (-Wa,-alh=mixed.log)
lexsup.c
>How-To-Repeat:
Build binutils 2.13.1 on a cygwin host with CFLAGS="-fomit-frame-pointer -O2".
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


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

end of thread, other threads:[~2003-01-07  1:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-07  1:04 c/9185: gcc produces errornous code on cygwin host when -fomit-frame-pointer is used together with -O2 or -O3 bangerth
  -- strict thread matches above, loose matches on Subject: below --
2003-01-06 22:46 Mack Lobell
2003-01-06 21:06 Danny Smith
2003-01-06 13:36 macklobell

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).