🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #52691

a question about -O

#52691
From: Cosmos Nicolaou
Date: Fri, 12 Jun 1992 15:05
73 lines
2235 bytes

is
gcc -c -O -fno-thread-jumps -fno-delayed-branch foo.c
supposed to have the same effect as
gcc -c foo.c
??
i.e. does -O perform optimisations other than -fthread-jumps and -fdelayed-branch??

The reason that I'm asking is that I have a module which crashes when compiled with
-O, but not when compiled without it. This doesn't suprise me, since this module
invokes assembly routines to save and restore processor start which implement a
co-routine package. Basically, I'm trying to track down what causes the crash -
i.e. some aspect of the optimisation is breaking the procedure call linkage with
these save/restore routines. I'm running on sparcstation elc, gcc is configured as
follows:

$ gcc -v
Reading specs from /usr/local/lib/gcc-lib/sparc-sun-sunos4.1/2.2.1/specs
gcc version 2.2.1

$ gcc -dumpspecs
*asm:
 %{pipe:-} %{fpic:-k} %{fPIC:-k}

*asm_final:


*cpp:
%{msparclite:-D__sparclite__} %{mv8:-D__sparcv8__}

*cc1:
%{sun4:} %{target:}

*cc1plus:


*endfile:


*link:
%{!nostdlib:%{!e*:-e start}} -dc -dp %{static:-Bstatic} %{assert*}

*lib:
%{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p} %{g:-lg}

*startfile:
%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}

*switches_need_spaces:


*signed_char:
%{funsigned-char:-D__CHAR_UNSIGNED__}

*predefines:
-Dsparc -Dsun -Dunix

*cross_compile:
0



    	Cheers, Cos.

Cosmos Nicolaou

email:  can@ansa.co.uk (...uknet!ansa!can)      ANSA,
tel:    +44 223 323 010                         Poseidon House,
fax:    +44 223 359 779                         Castle Park,
						Cambridge,
                                                United Kingdom CB3 0RD
---
Technical Details
Message-ID: <9206121505.AA28474@burgess.ansa.co.uk>
Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!ansa.co.UK!can

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,d436e65cfce4e182,start
X-Google-Attributes: gid11318c,public
X-Google-ArrivalTime: 1992-06-12 04:00:10 PST
Newsgroups: gnu.gcc.help
Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!ansa.co.UK!can
From: can@ansa.co.UK (Cosmos Nicolaou)
Subject: a question about -O
Message-ID: <9206121505.AA28474@burgess.ansa.co.uk>
Sender: daemon@cis.ohio-state.edu
Organization: GNUs Not Usenet
Distribution: gnu
Date: Fri, 12 Jun 1992 15:05:43 GMT
Lines: 74