[Bug rtl-optimization/94119] MIPS: Invalid use of branch delay slots leading to corrupt jump

ebotcazou at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Mar 11 16:27:52 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94119

--- Comment #3 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
> The addiu s0,s0,0 instruction must only be issued once but instead is in
> several places. This leads to an invalid call at 9c.

Duplicating the instruction is not a problem per se if it is executed only once
on any execution path.  Are you sure that the problem is for the call at 9c?

>   8c:	3c100000 	lui	s0,0x0
> 			8c: R_MIPS_HI16	memcmp_
>   90:	24060006 	li	a2,6
>   94:	27a50014 	addiu	a1,sp,20
>   98:	26100000 	addiu	s0,s0,0
> 			98: R_MIPS_LO16	memcmp_
>   9c:	0200f809 	jalr	s0

AFAICS there is only one "addiu s0,s0,0" executed after the "lui s0,0x0" in
this basic block.  Doesn't the problem occur for the call in the following
basic block instead?


More information about the Gcc-bugs mailing list