CVSROOT:        /cvs
Module name:    src
Changes by:     m...@cvs.openbsd.org    2025/08/27 23:11:41

Modified files:
        gnu/gcc/gcc/config/m88k: m88k.md 

Log message:
The delay slot description allowed for a jump instruction in the being present
in the delay slot of a branch instruction, as output_call had a way to merge
them.

But the jump instruction itself may have another instruction in its own delay
slot. This would cause generated code to be:
bsr.n   function
br.n    label
another instruction
which confuses the processor and has absolutely no chance to work as intended.

Apparently we had been lucky enough to not stumble upon this in the gcc 2 and
gcc 3 times, but gcc 4 is more daring at optimizing things and ends up
producing this invalid code, especially in exception-related code paths.

The only safe thing to do is to declare jump instructions as not allowed in
the delay slot of branch instructions. This loses the output_call optimization
but code correctness is preferred.

Reply via email to