[Bug c/59847] New: cast to long makes compiler crash if using option pdp-11/10
mattis at mattisborgen dot se
gcc-bugzilla@gcc.gnu.org
Thu Jan 16 18:46:00 GMT 2014
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59847
Bug ID: 59847
Summary: cast to long makes compiler crash if using option
pdp-11/10
Product: gcc
Version: 4.8.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: mattis at mattisborgen dot se
mattis@mattis-VirtualBox:~$ pdp11-aout-gcc -m10 -S longtest.c
longtest.c: In function 'test':
longtest.c:5:1: error: unrecognizable insn:
}
^
(insn 7 6 10 2 (set (mem/c:SI (plus:HI (reg/f:HI 17 virtual-stack-vars)
(const_int -4 [0xfffffffc])) [0 a+0 S4 A16])
(sign_extend:SI (mem/c:HI (plus:HI (reg/f:HI 17 virtual-stack-vars)
(const_int -6 [0xfffffffa])) [0 b+0 S2 A16]))) longtest.c:4
-1
(nil))
longtest.c:5:1: internal compiler error: in extract_insn, at recog.c:2154
0x837d527 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
../src/gcc/rtl-error.c:109
0x837d571 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
../src/gcc/rtl-error.c:117
0x8355394 extract_insn(rtx_def*)
../src/gcc/recog.c:2154
0x825d34e instantiate_virtual_regs_in_insn
../src/gcc/function.c:1561
0x825d34e instantiate_virtual_regs
../src/gcc/function.c:1928
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
mattis@mattis-VirtualBox:~$ pdp11-aout-gcc -v
Using built-in specs.
COLLECT_GCC=pdp11-aout-gcc
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/pdp11-aout/4.8.2/lto-wrapper
Target: pdp11-aout
Configured with: src/configure --target=pdp11-aout --disable-nls
--without-headers --enable-languages=c
Thread model: single
gcc version 4.8.2 (GCC)
Linux mattis-VirtualBox 3.8.0-34-generic #49~precise1-Ubuntu SMP Wed Nov 13
18:08:04 UTC 2013 i686 i686 i386 GNU/Linux
Please note that if using -m40 or -m45 instead this problem goes away:
mattis@mattis-VirtualBox:~$ pdp11-aout-gcc -m40 -S longtest.c
mattis@mattis-VirtualBox:~$ cat longtest.s
.text
.even
.globl _test
_test:
mov r5, -(sp)
mov sp, r5
add $-06, sp
clr -04(r5)
mov $012,-02(r5)
mov $012, -06(r5)
mov -06(r5), -02(r5)
sxt -04(r5)
mov r5, sp
mov (sp)+, r5
rts pc
mattis@mattis-VirtualBox:~$
mattis@mattis-VirtualBox:~$ cat longtest.c
test () {
long a=10;
short b=10;
a = (long) b;
}
It appears that the cast is causing the problem since removing it makes it
compile.
More information about the Gcc-bugs
mailing list