Skip to content

Commit

Permalink
microblaze: Fix -Os right shift optimization is allowed into delay slot
Browse files Browse the repository at this point in the history
During picolibc testing, it's found that `-Os` produces assembly code that
compiler squeezes into a single delay slot. Thus, only the first
instruction (the one in delay slot) emitted by this optimization is
executed and the rest is skipped.

Signed-off-by: Alp Sayin <[email protected]>
  • Loading branch information
alpsayin committed Oct 19, 2024
1 parent 428d8d7 commit 815ae62
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gcc/config/microblaze/microblaze.md
Original file line number Diff line number Diff line change
Expand Up @@ -2286,7 +2286,7 @@ else
output_asm_insn ("bneid\t%3,.-4", operands);
return "sra\t%0,%0";
}
[(set_attr "type" "arith")
[(set_attr "type" "multi")
(set_attr "mode" "SI")
(set_attr "length" "20")]
)
Expand Down

0 comments on commit 815ae62

Please sign in to comment.