public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug other/18559] New: apple's gcc-3.3 -fast causes bus error
@ 2004-11-19 5:33 fang at csl dot cornell dot edu
2004-11-19 14:29 ` [Bug other/18559] " pinskia at gcc dot gnu dot org
2004-11-19 16:53 ` fang at csl dot cornell dot edu
0 siblings, 2 replies; 3+ messages in thread
From: fang at csl dot cornell dot edu @ 2004-11-19 5:33 UTC (permalink / raw)
To: gcc-bugs
Cranking up optimization level from -O3 to -fast causes bus error.
Note: this is only applicable to Apple's gcc-3.3 on Darwin.
(Their developer site directed me to report bugs here.)
----------------------------------------------------------------
gcc version:
g++ -v --save-temps -g -fast -W -Wall -Werror -Wno-unused hello.cc
Reading specs from /usr/libexec/gcc/darwin/ppc/3.3-fast/specs
Thread model: posix
gcc version 3.3-fast 20030304 (Apple Computer, Inc. build 1614)
/usr/libexec/gcc/darwin/ppc/3.3-fast/cc1plus -E -D__GNUG__=3 -quiet -v
-D__GNUC__=3 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=0 -D__APPLE_CC__=1614
-D__DYNAMIC__ hello.cc -W -Wall -Werror -Wno-unused -fast
-D__private_extern__=extern -o hello.ii
ignoring nonexistent directory "/usr/ppc-darwin/include"
ignoring nonexistent directory "/Local/Library/Frameworks"
#include "..." search starts here:
#include <...> search starts here:
/usr/include/gcc/darwin/3.3-fast/c++
/usr/include/gcc/darwin/3.3-fast/c++/ppc-darwin
/usr/include/gcc/darwin/3.3-fast/c++/backward
/usr/local/include
/usr/include/gcc/darwin/3.3-fast
/usr/include
End of search list.
Framework search starts here:
/System/Library/Frameworks
/Library/Frameworks
End of framework search list.
/usr/libexec/gcc/darwin/ppc/3.3-fast/cc1plus -fpreprocessed hello.ii -O3
-quiet -dumpbase hello.cc -auxbase hello -g -W -Wall -Werror -Wno-unused
-version -fast -D__private_extern__=extern -o hello.s
GNU C++ version 3.3-fast 20030304 (Apple Computer, Inc. build 1614)
(ppc-darwin)
compiled by GNU C version 3.3-fast 20030304 (Apple Computer, Inc.
build 1614).
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=131072
/usr/libexec/gcc/darwin/ppc/as -arch ppc970 -o hello.o hello.s
ld -arch ppc -dynamic -o a.out -lcrt1.o -lcrt2.o
-L/usr/lib/gcc/darwin/3.3-fast -L/usr/lib/gcc/darwin
-L/usr/libexec/gcc/darwin/ppc/3.3-fast/../../.. hello.o -lstdc++ -lgcc
-lSystem |
c++filt3
-------------------------------------------
I have also reproduced the crash with:
gcc version 3.3-fast 20030304 (Apple Computer, Inc. build 1620)
/usr/libexec/gcc/darwin/ppc/3.3-fast/cc1plus -E -D__GNUG__=3 -quiet -v
-D__GNUC__=3 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=0 -D__APPLE_CC__=1620
-D__DYNAMIC__ hello.cc -mcpu=G4 -W -Wall -Werror -Wno-unused -fast
-D__private_extern__=extern -o hello.ii
ignoring nonexistent directory "/usr/ppc-darwin/include"
ignoring nonexistent directory "/Local/Library/Frameworks"
#include "..." search starts here:
#include <...> search starts here:
/usr/include/gcc/darwin/3.3-fast/c++
/usr/include/gcc/darwin/3.3-fast/c++/ppc-darwin
/usr/include/gcc/darwin/3.3-fast/c++/backward
/usr/local/include
/usr/include/gcc/darwin/3.3-fast
/usr/include
End of search list.
Framework search starts here:
/System/Library/Frameworks
/Library/Frameworks
End of framework search list.
/usr/libexec/gcc/darwin/ppc/3.3-fast/cc1plus -fpreprocessed hello.ii -O3
-quiet -dumpbase hello.cc -mcpu=G4 -auxbase hello -g -W -Wall -Werror
-Wno-unused -version -fast -D__private_extern__=extern -o hello.s
GNU C++ version 3.3-fast 20030304 (Apple Computer, Inc. build 1620)
(ppc-darwin)
compiled by GNU C version 3.3-fast 20030304 (Apple Computer, Inc.
build 1620).
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=131072
/usr/libexec/gcc/darwin/ppc/as -arch ppc -o hello.o hello.s
ld -arch ppc -dynamic -o a.out -lcrt1.o -lcrt2.o
-L/usr/lib/gcc/darwin/3.3-fast -L/usr/lib/gcc/darwin
-L/usr/libexec/gcc/darwin/ppc/3.3-fast/../../.. foo.o -lstdc++ -lgcc
-lSystem |
c++filt
----------------------------------------------------------------------
and also on a machine with gcc-3.3 build 1495
(for which I currently don't have access)
adding -mcpu=G4 to the CFLAGS (for G4 instead of G5 platform)
for all versions mentioned also produces same bus error.
(configuration not replicated for brevity)
In all cases, when -fast is replaced with less aggressive -O3,
program runs cleanly.
----------------------------------------------------------------------
------------- hello.ii -----------------------------------------------
---------- (is 704 k large! can't paste whole file here...)----------
----------------------------------------------------------------------
however, the source file (I know I'm not supposed to post source...)
is two lines in main():
hello.cc (the entire source file):
#include <fstream>
using namespace std;
int
main(int argc, char* argv[]) {
ofstream bogus("bogus");
return 0;
}
-------------------------------------------------------
remarks: compiles with no warnings or errors
-------------------------------------------------------
run command:
a.out
-------------------------------------------------------
program output:
Bus error
-------------------------------------------------------
gdb stack:
Program received signal EXC_BAD_ACCESS, Could not access memory.
#0 0x0000af1c in std::locale::operator=(std::locale const&) ()
#1 0x0000c0a4 in std::ios_base::_M_init() ()
#2 0x0000cb10 in std::basic_ios<char, std::char_traits<char>
>::init(std::basic_streambuf<char, std::char_traits<char> >*) ()
#3 0x00002d34 in main (argc=-1073744276, argv=0xbffff340) at
/usr/include/gcc/darwin/3.3-fast/c++/ostream:86
--------------------------------------------------------------
hope this is enough to work with...
--
Summary: apple's gcc-3.3 -fast causes bus error
Product: gcc
Version: 3.3
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: other
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: fang at csl dot cornell dot edu
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: darwin
GCC host triplet: powerpc
GCC target triplet: apple
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18559
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug other/18559] apple's gcc-3.3 -fast causes bus error
2004-11-19 5:33 [Bug other/18559] New: apple's gcc-3.3 -fast causes bus error fang at csl dot cornell dot edu
@ 2004-11-19 14:29 ` pinskia at gcc dot gnu dot org
2004-11-19 16:53 ` fang at csl dot cornell dot edu
1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-11-19 14:29 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-11-19 14:29 -------
Not our bug, report it to Apple.
Oh, by the way -fast enables -malign-nature which causes some structs to have different sizes and
since libstdc++ is compiled normally that can cause problems. Try -fastcp (or -fastf) for C++ code
instead.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18559
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug other/18559] apple's gcc-3.3 -fast causes bus error
2004-11-19 5:33 [Bug other/18559] New: apple's gcc-3.3 -fast causes bus error fang at csl dot cornell dot edu
2004-11-19 14:29 ` [Bug other/18559] " pinskia at gcc dot gnu dot org
@ 2004-11-19 16:53 ` fang at csl dot cornell dot edu
1 sibling, 0 replies; 3+ messages in thread
From: fang at csl dot cornell dot edu @ 2004-11-19 16:53 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From fang at csl dot cornell dot edu 2004-11-19 16:52 -------
Subject: Re: apple's gcc-3.3 -fast causes bus error
Thanks, found their bug-site, I'll pass it on to them.
> ------- Additional Comments From pinskia at gcc dot gnu dot org 2004-11-19 14:29 -------
> Not our bug, report it to Apple.
> Oh, by the way -fast enables -malign-nature which causes some structs to have different sizes and
> since libstdc++ is compiled normally that can cause problems. Try -fastcp (or -fastf) for C++ code
> instead.
David Fang
Computer Systems Laboratory
Electrical & Computer Engineering
Cornell University
http://www.csl.cornell.edu/~fang/ -- *gag* work in progress
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18559
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-11-19 16:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-19 5:33 [Bug other/18559] New: apple's gcc-3.3 -fast causes bus error fang at csl dot cornell dot edu
2004-11-19 14:29 ` [Bug other/18559] " pinskia at gcc dot gnu dot org
2004-11-19 16:53 ` fang at csl dot cornell dot edu
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).