[Bug target/93808] [9 Regression] [SH] Ruby crashes with 'Illegal Instruction' with -fcrossjumping
olegendo at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Feb 20 15:52:00 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93808
--- Comment #16 from Oleg Endo <olegendo at gcc dot gnu.org> ---
This seems to be actually valid code?!
switch (e - p)
{
default: __builtin_unreachable();
case 3: if (e[-3]&0x80) return e-3;
case 2: if (e[-2]&0x80) return e-2;
case 1: if (e[-1]&0x80) return e-1;
case 0: return ((void *)0);
}
gets compiled to
.L101:
sub r3,r1 ! 465 [c=4 l=2] *subsi3_internal
mov r1,r3 ! 1083 [c=4 l=2] movsi_i/1
.L33:
mov #3,r7 ! 469 [c=4 l=2] movsi_i/2
cmp/hi r7,r3 ! 474 [c=4 l=2] cmpgtusi_t
! when here: T bit = r3 > #3
! this is the 'default' case
.L153:
! always branch into nowhere
bt .L11 ! 475 [c=17 l=2] *cbranch_t <<< bad jump
So somehow it hits the case that is supposed to be unreachable.
More information about the Gcc-bugs
mailing list