aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2016-03-01 20:04:01 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2016-03-01 20:04:01 +0000
commit355a43a19fd0f20cfdfdd0e406c60d5c3f5178df (patch)
tree9d8eef7ecfbe716d17be98b438245521b56c2b1e
parent686e2237f31bd26851e3c8f9a528ab30aef16c54 (diff)
downloadgcc-355a43a19fd0f20cfdfdd0e406c60d5c3f5178df.zip
gcc-355a43a19fd0f20cfdfdd0e406c60d5c3f5178df.tar.gz
gcc-355a43a19fd0f20cfdfdd0e406c60d5c3f5178df.tar.bz2
re PR ada/70017 (c52103x and c52104x test failure on s390x)
PR ada/70017 * ira.c (do_reload): Issue warning for generic stack checking here... * reload1.c (reload): ...instead of here and streamline it. From-SVN: r233862
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/ira.c17
-rw-r--r--gcc/reload1.c22
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.dg/pr70017.c16
5 files changed, 41 insertions, 24 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 54889f9..ef319be 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2016-03-01 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR ada/70017
+ * ira.c (do_reload): Issue warning for generic stack checking here...
+ * reload1.c (reload): ...instead of here and streamline it.
+
2016-03-01 Nick Clifton <nickc@redhat.com>
* config.gcc (cr16-*-elf): Add newlib-stdint.h to tm_file.
diff --git a/gcc/ira.c b/gcc/ira.c
index 6b4a104..0973258 100644
--- a/gcc/ira.c
+++ b/gcc/ira.c
@@ -5404,9 +5404,8 @@ do_reload (void)
{
df_set_flags (DF_NO_INSN_RESCAN);
build_insn_chain ();
-
- need_dce = reload (get_insns (), ira_conflicts_p);
+ need_dce = reload (get_insns (), ira_conflicts_p);
}
timevar_pop (TV_RELOAD);
@@ -5484,6 +5483,20 @@ do_reload (void)
inform (DECL_SOURCE_LOCATION (decl), "for %qD", decl);
}
+ /* If we are doing generic stack checking, give a warning if this
+ function's frame size is larger than we expect. */
+ if (flag_stack_check == GENERIC_STACK_CHECK)
+ {
+ HOST_WIDE_INT size = get_frame_size () + STACK_CHECK_FIXED_FRAME_SIZE;
+
+ for (int i = 0; i < FIRST_PSEUDO_REGISTER; i++)
+ if (df_regs_ever_live_p (i) && !fixed_regs[i] && call_used_regs[i])
+ size += UNITS_PER_WORD;
+
+ if (size > STACK_CHECK_MAX_FRAME_SIZE)
+ warning (0, "frame size too large for reliable stack checking");
+ }
+
if (pic_offset_table_regno != INVALID_REGNUM)
pic_offset_table_rtx = gen_rtx_REG (Pmode, pic_offset_table_regno);
diff --git a/gcc/reload1.c b/gcc/reload1.c
index 2229fd3..252394e 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -1258,28 +1258,6 @@ reload (rtx_insn *first, int global)
}
}
- /* If we are doing generic stack checking, give a warning if this
- function's frame size is larger than we expect. */
- if (flag_stack_check == GENERIC_STACK_CHECK)
- {
- HOST_WIDE_INT size = get_frame_size () + STACK_CHECK_FIXED_FRAME_SIZE;
- static int verbose_warned = 0;
-
- for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
- if (df_regs_ever_live_p (i) && ! fixed_regs[i] && call_used_regs[i])
- size += UNITS_PER_WORD;
-
- if (size > STACK_CHECK_MAX_FRAME_SIZE)
- {
- warning (0, "frame size too large for reliable stack checking");
- if (! verbose_warned)
- {
- warning (0, "try reducing the number of local variables");
- verbose_warned = 1;
- }
- }
- }
-
free (temp_pseudo_reg_arr);
/* Indicate that we no longer have known memory locations or constants. */
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 084a7eb..75148f3 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2016-02-29 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc.dg/pr70017.c: New test.
+
2016-03-01 Jakub Jelinek <jakub@redhat.com>
PR c/69796
diff --git a/gcc/testsuite/gcc.dg/pr70017.c b/gcc/testsuite/gcc.dg/pr70017.c
new file mode 100644
index 0000000..44f0ab9
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr70017.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-fstack-check=generic" } */
+
+/* Check that the expected warning is issued for large frames. */
+
+#define ONE(s) char a##s[32];
+#define TEN(s) ONE(s##0) ONE(s##1) ONE(s##2) ONE(s##3) ONE(s##4) \
+ ONE(s##5) ONE(s##6) ONE(s##7) ONE(s##8) ONE(s##9)
+#define HUNDRED(s) TEN(s##0) TEN(s##1) TEN(s##2) TEN(s##3) TEN(s##4) \
+ TEN(s##5) TEN(s##6) TEN(s##7) TEN(s##8) TEN(s##9)
+
+void foo(void)
+{
+ HUNDRED(a)
+ HUNDRED(b)
+} /* { dg-warning "frame size too large for reliable stack checking" } */