]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Alpha: Add memory clobbers to `builtin_longjmp' expansion
authorMaciej W. Rozycki <macro@orcam.me.uk>
Sun, 12 Jan 2025 16:48:53 +0000 (16:48 +0000)
committerMaciej W. Rozycki <macro@orcam.me.uk>
Sun, 12 Jan 2025 16:48:53 +0000 (16:48 +0000)
Add the same memory clobbers to `builtin_longjmp' for Alpha as with
commit 41439bf6a647 ("builtins.c (expand_builtin_longjmp): Added two
memory clobbers."), to prevent instructions that access memory via the
frame or stack pointer from being moved across the write to the frame
pointer.

gcc/
* config/alpha/alpha.md (builtin_longjmp): Add memory clobbers.

gcc/config/alpha/alpha.md

index 376c4cba90c5e2e159c9a83c12b32a64f3cdd5b4..35c8030422f5df39c85164925886eff02b4bb947 100644 (file)
   rtx pv = gen_rtx_REG (Pmode, 27);
 
   /* This bit is the same as expand_builtin_longjmp.  */
+  emit_clobber (gen_rtx_MEM (BLKmode, gen_rtx_SCRATCH (VOIDmode)));
+  emit_clobber (gen_rtx_MEM (BLKmode, hard_frame_pointer_rtx));
   emit_move_insn (hard_frame_pointer_rtx, fp);
   emit_move_insn (pv, lab);
   emit_stack_restore (SAVE_NONLOCAL, stack);