Commit 362432c0 by Eric Botcazou

asan.c (asan_emit_stack_protection): Use full-sized mask to align the base…

asan.c (asan_emit_stack_protection): Use full-sized mask to align the base address on 64-bit strict-alignment platforms.

	* asan.c (asan_emit_stack_protection): Use full-sized mask to align
	the base address on 64-bit strict-alignment platforms.

From-SVN: r268949
parent dd66d9d7
2019-02-15 Eric Botcazou <ebotcazou@adacore.com>
* asan.c (asan_emit_stack_protection): Use full-sized mask to align
the base address on 64-bit strict-alignment platforms.
2019-02-15 H.J. Lu <hongjiu.lu@intel.com> 2019-02-15 H.J. Lu <hongjiu.lu@intel.com>
* config/i386/i386.h (VALID_MMX_REG_MODE): Correct the misplaced * config/i386/i386.h (VALID_MMX_REG_MODE): Correct the misplaced ')'.
')'.
2019-02-15 Uroš Bizjak <ubizjak@gmail.com> 2019-02-15 Uroš Bizjak <ubizjak@gmail.com>
......
...@@ -1440,13 +1440,15 @@ asan_emit_stack_protection (rtx base, rtx pbase, unsigned int alignb, ...@@ -1440,13 +1440,15 @@ asan_emit_stack_protection (rtx base, rtx pbase, unsigned int alignb,
base_align_bias = ((asan_frame_size + alignb - 1) base_align_bias = ((asan_frame_size + alignb - 1)
& ~(alignb - HOST_WIDE_INT_1)) - asan_frame_size; & ~(alignb - HOST_WIDE_INT_1)) - asan_frame_size;
} }
/* Align base if target is STRICT_ALIGNMENT. */ /* Align base if target is STRICT_ALIGNMENT. */
if (STRICT_ALIGNMENT) if (STRICT_ALIGNMENT)
base = expand_binop (Pmode, and_optab, base, {
gen_int_mode (-((GET_MODE_ALIGNMENT (SImode) const HOST_WIDE_INT align
<< ASAN_SHADOW_SHIFT) = (GET_MODE_ALIGNMENT (SImode) / BITS_PER_UNIT) << ASAN_SHADOW_SHIFT;
/ BITS_PER_UNIT), Pmode), NULL_RTX, base = expand_binop (Pmode, and_optab, base, gen_int_mode (-align, Pmode),
1, OPTAB_DIRECT); NULL_RTX, 1, OPTAB_DIRECT);
}
if (use_after_return_class == -1 && pbase) if (use_after_return_class == -1 && pbase)
emit_move_insn (pbase, base); emit_move_insn (pbase, base);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment