diff options
author | Jeff Law <law@redhat.com> | 2017-09-20 15:59:50 -0600 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 2017-09-20 15:59:50 -0600 |
commit | 94c23e3960c24a3bfcfe2daf7158fb51e0aa0e22 (patch) | |
tree | 0bffd958305c88a648ef654d191156ee0e8c2e37 /gcc/explow.c | |
parent | 6073d0028debf7cbd80dc0678402cbe2c6ea652d (diff) | |
download | gcc-94c23e3960c24a3bfcfe2daf7158fb51e0aa0e22.zip gcc-94c23e3960c24a3bfcfe2daf7158fb51e0aa0e22.tar.gz gcc-94c23e3960c24a3bfcfe2daf7158fb51e0aa0e22.tar.bz2 |
explow.c (compute_stack_clash_protection_loop_data): Use CONST_INT_P instead of explicit test.
* explow.c (compute_stack_clash_protection_loop_data): Use
CONST_INT_P instead of explicit test. Verify object is a
CONST_INT_P before looking at INTVAL.
(anti_adjust_stack_and_probe_stack_clash): Use CONST_INT_P
instead of explicit test.
* gcc.target/i386/stack-check-11.c: Update test and regexp
so that it works for both i?86 and x86_64.
From-SVN: r253034
Diffstat (limited to 'gcc/explow.c')
-rw-r--r-- | gcc/explow.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/gcc/explow.c b/gcc/explow.c index 0f30507..6131d18 100644 --- a/gcc/explow.c +++ b/gcc/explow.c @@ -1834,11 +1834,11 @@ compute_stack_clash_protection_loop_data (rtx *rounded_size, rtx *last_addr, if (*rounded_size == CONST0_RTX (Pmode)) fprintf (dump_file, "Stack clash skipped dynamic allocation and probing loop.\n"); - else if (GET_CODE (*rounded_size) == CONST_INT + else if (CONST_INT_P (*rounded_size) && INTVAL (*rounded_size) <= 4 * *probe_interval) fprintf (dump_file, "Stack clash dynamic allocation and probing inline.\n"); - else if (GET_CODE (*rounded_size) == CONST_INT) + else if (CONST_INT_P (*rounded_size)) fprintf (dump_file, "Stack clash dynamic allocation and probing in " "rotated loop.\n"); @@ -1936,7 +1936,8 @@ anti_adjust_stack_and_probe_stack_clash (rtx size) if (rounded_size != CONST0_RTX (Pmode)) { - if (INTVAL (rounded_size) <= 4 * probe_interval) + if (CONST_INT_P (rounded_size) + && INTVAL (rounded_size) <= 4 * probe_interval) { for (HOST_WIDE_INT i = 0; i < INTVAL (rounded_size); @@ -1956,7 +1957,7 @@ anti_adjust_stack_and_probe_stack_clash (rtx size) else { rtx loop_lab, end_loop; - bool rotate_loop = GET_CODE (rounded_size) == CONST_INT; + bool rotate_loop = CONST_INT_P (rounded_size); emit_stack_clash_protection_probe_loop_start (&loop_lab, &end_loop, last_addr, rotate_loop); @@ -1994,7 +1995,7 @@ anti_adjust_stack_and_probe_stack_clash (rtx size) might hold live data. So probe at *sp if we know that an allocation was made, otherwise probe into the red zone which is obviously undesirable. */ - if (GET_CODE (size) == CONST_INT) + if (CONST_INT_P (size)) { emit_stack_probe (stack_pointer_rtx); emit_insn (gen_blockage ()); |