From: partain@dcs.gla.ac.UK (partain)
Subject: possible gcc bug (2.2.2, Sun4)
Organization: GNUs Not Usenet
Distribution: gnu
Date: Sat, 22 Aug 1992 16:10:40 GMT

GCC, v 2.2.2 w/ a few probably-innocent fixes, behaves as shown on the
attached (machine-generated) input.  I ran it on a Sun 4/60, running
SunOS 4.1.

Will

PS: Perhaps a documentation buglet: it *seems* that a -O can override
a previous -O2 option.  Aside from whether this is good or bad, it is
not what I would expect after reading node "Invoking GCC".

==================================================================
% gcc -v -O -S gcc-bug2.c
Reading specs from /usr/local/gnu/lib/gcc-lib/sun4/2.2.2/specs
gcc version 2.2.2
 /usr/local/gnu/lib/gcc-lib/sun4/2.2.2/cpp -lang-c -v -undef -D__GNUC__=2 -Dsparc -Dsun -Dunix -D__sparc__ -D__sun__ -D__unix__ -D__sparc -D__sun -D__unix -D__OPTIMIZE__ gcc-bug2.c /usr/tmp/cca27722.i
GNU CPP version 2.2.2 (sparc)
 /usr/local/gnu/lib/gcc-lib/sun4/2.2.2/cc1 /usr/tmp/cca27722.i -quiet -dumpbase gcc-bug2.c -O -version -o gcc-bug2.s
GNU C version 2.2.2 (sparc) compiled by GNU C version 2.2.2.
gcc-bug2.c: In function `startStgWorld':
gcc-bug2.c:285: warning: assignment discards `const' from pointer target type
gcc-bug2.c: In function `callWrapper':
gcc-bug2.c:339: fixed or forbidden register was spilled.
This may be due to a compiler bug or to impossible asm statements.
%
==================================================================
#!/bin/sh
# This is a shell archive (produced by shar 3.49)
# To extract the files from this archive, save it to a file, remove
# everything above the "!/bin/sh" line above, and type "sh file_name".
#
# made 08/22/1992 16:04 UTC by partain@tegua
# Source directory /tmp_mnt/users/fp/partain
#
# existing files will NOT be overwritten unless -c is specified
#
# This shar contains:
# length  mode       name
# ------ ---------- ------------------------------------------
#  14184 -rw-rw-r-- gcc-bug2.c
#
# ============= gcc-bug2.c ==============
if test -f 'gcc-bug2.c' -a X"$1" != X"-c"; then
	echo 'x - skipping gcc-bug2.c (File already exists)'
else
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$/U6$GU:$SU>$7V*`?P:##_>&#_>(#_>*#_>,#_<6]O@E]BW-
M;<+T;,34_<$,G\6K?,+6G<4KK-#:G=0OO,.E[OHT#-$][/$*;=ZR[\,:7?L@
MK=`CG_MBEL2UW\0*;=_;O=)3_,8*_?)>+.!AK//'C_.4[,4\S<4(3M`+#LB!
MU<80KOQ0UOURC/U$?UMU//X13M`8#C1*S^IG[?=:W\Q2+_CO/^W![O56O_7!
MKNU?O^K6[NJQ/NNM#@<BP/=\#_?QKA(`#_?<+/=M3_?<W+"EONYXS\T$K^Z>
MCS14#>7;(^786>E-9.[HONGS?LSM95:MU>5,'^9I3>;9W-;EGN9R3==NCM>Z
M'>=JI,N,?'2974/?NT:XZN(>`N.1;1>37=D@<-DSI-DQD1D2;-JB@2UBL-DW
MO@:$H1MT$`(AT..PW>1![OE(0]50OCU2CIV5WD2[36%=SO1AGM9DGLUM7>YI
M+M=T[>9XK=MQOI95GCTTEYF$2D-X\T2#-;Y.6[[5P\B:67&&C)+C0M@K"S3M
MRT:>S,A'E]DU!`(LX,G5`](@P`*>W`+5!0(LX,DM4%U(PP+W^P5%\);J(9<0
M!:N7@K#W"U'_4IJ\P=2P>BGB2^1F.KY.6[[\0W.9B9+C0M@K"S2>>3_ER\B:
C67&&#`+MRT:>S#\TEYDH.2Z$O;)$!33V.Y^+*[3:"0,"K``K
`
end
SHAR_EOF
echo 'uncompressing file gcc-bug2.c' &&
compress -d < _shar_cmp_.tmp > 'gcc-bug2.c' && rm -f _shar_cmp_.tmp &&
chmod 0664 gcc-bug2.c ||
echo 'restore of gcc-bug2.c failed'
Wc_c="`wc -c < 'gcc-bug2.c'`"
test 14184 -eq "$Wc_c" ||
	echo 'gcc-bug2.c: original size 14184, current size' "$Wc_c"
fi
exit 0

Newsgroups: gnu.gcc.bug