deref_puc_assign,21164a on RH51/alpha
Stefan Schroepfer
scr@iis.fhg.de
Wed Aug 5 03:25:00 GMT 1998
It seems to me like I discovered a bug common to egcs-1.0.2 (as
shipped with RH 5.1 PowerTools CD set) and egcs-1.0.3a. Trying to
build egcs-19980727 lead to an error on my Linux/Alpha system.
Hardware / Software:
PC164 / 21164a
RH 5.1 from PowerTools CD set
glibc*-2.0.7-19.alpha.rpm from RH updates directory
Compiler options affecting code generation used:
-O2 -mcpu=21164a -Wa,-m21164a
--------------------
sample code
--------------------
int main ()
{
unsigned char uc;
unsigned char *puc;
puc = &uc;
*puc = 0x00;
return ((int) uc);
}
--------------------
sample session (comments start with '#', newlines added)
--------------------
# gdb will show that SIGILL is thrown in return statement while
# in a real world example this happens in assignment
# "*([pointer_to_unsigned_char]) = 0x00"
scr@scr02 1010 c_c++ $ gcc -g -O2 -mcpu=21164a -Wa,-m21164a
egcs_sigill.cpp -o egcs_sigill
scr@scr02 1011 c_c++ $ ./egcs_sigill
Illegal Instruction (core dumped)
scr@scr02 1012 c_c++ $ gdb egcs_sigill core
GNU gdb 4.17
[...]
This GDB was configured as "alpha-redhat-linux"...
Core was generated by `./egcs_sigill'.
Program terminated with signal 4, Illegal Instruction.
find_solib: Can't read pathname for load map: Input/output error
#0 main () at egcs_sigill.cpp:13
13 return ((int) uc);
(gdb) quit
# Can't figure out what this "find_solib" message of gdb is all
# about ...
scr@scr02 1014 c_c++ $ gcc -v
Reading specs from
/usr/local/lib/gcc-lib/alphaev5-unknown-linux-gnu/egcs-2.90.2
9/specs
gcc version egcs-2.90.29 980515 (egcs-1.0.3 release)
# egcs-2.90.27 980315 (egcs-1.0.2 release) as shipped with RH 51
# PowerTools produces an identical executable, assembler output
# differs only by .ident version string.
scr@scr02 1017 c_c++ $ gcc -S -O2 -mcpu=21164a -Wa,-m21164a
egcs_sigill.cpp
scr@scr02 1019 c_c++ $ cat egcs_sigill.s
.file 1 "egcs_sigill.cpp"
.version "01.01"
.set noat
gcc2_compiled.:
__gnu_compiled_cplusplus:
.text
.align 3
.globl main
.ent main
main:
$main..ng:
lda $30,-16($30)
.frame $30,16,$26,0
.prologue 0
stb $31,0($30)
bis $31,$31,$0
addq $30,16,$30
ret $31,($26),1
.end main
.ident "GCC: (GNU) egcs-2.90.29 980515 (egcs-1.0.3 release)"
--------------------
end of provided samples
--------------------
Hope this helps in further development of egcs (and that I did
not make trivial mistakes).
Regards,
Stefan Schroepfer
scr@iis.fhg.de
More information about the Gcc-bugs
mailing list