summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>2015-09-21 15:23:52 +0000
committeruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>2015-09-21 15:23:52 +0000
commit5eb0e5fe709ff7f8c066a9a1c329e51c32d5acf2 (patch)
tree640f089d9c508f8b73da159918c6ef9c4a9fb513
parent2b0e416b85d89c2ec49f661ca9356fdbdf3d73b6 (diff)
downloadgcc-5eb0e5fe709ff7f8c066a9a1c329e51c32d5acf2.tar.gz
PR middle-end/67619
* except.c (expand_builtin_eh_return): Use copy_addr_to_reg to copy the address to a register. testsuite/ChangeLog: PR middle-end/67619 * gcc.dg/torture/pr67619.c: New test. * lib/target-supports.exp (check_effective_target_builtin_eh_return): New procedure. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-5-branch@227976 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/except.c4
-rw-r--r--gcc/testsuite/ChangeLog7
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr67619.c13
-rw-r--r--gcc/testsuite/lib/target-supports.exp10
5 files changed, 38 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3c9f411c52f..5d61206a99b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2015-09-21 Uros Bizjak <ubizjak@gmail.com>
+
+ PR middle-end/67619
+ * except.c (expand_builtin_eh_return): Use copy_addr_to_reg to copy
+ the address to a register.
+
2015-09-21 Oleg Endo <olegendo@gcc.gnu.org>
Backport from mainline
diff --git a/gcc/except.c b/gcc/except.c
index 833ec21f329..a5246b5e124 100644
--- a/gcc/except.c
+++ b/gcc/except.c
@@ -2235,7 +2235,7 @@ expand_builtin_eh_return (tree stackadj_tree ATTRIBUTE_UNUSED,
VOIDmode, EXPAND_NORMAL);
tmp = convert_memory_address (Pmode, tmp);
if (!crtl->eh.ehr_stackadj)
- crtl->eh.ehr_stackadj = copy_to_reg (tmp);
+ crtl->eh.ehr_stackadj = copy_addr_to_reg (tmp);
else if (tmp != crtl->eh.ehr_stackadj)
emit_move_insn (crtl->eh.ehr_stackadj, tmp);
#endif
@@ -2244,7 +2244,7 @@ expand_builtin_eh_return (tree stackadj_tree ATTRIBUTE_UNUSED,
VOIDmode, EXPAND_NORMAL);
tmp = convert_memory_address (Pmode, tmp);
if (!crtl->eh.ehr_handler)
- crtl->eh.ehr_handler = copy_to_reg (tmp);
+ crtl->eh.ehr_handler = copy_addr_to_reg (tmp);
else if (tmp != crtl->eh.ehr_handler)
emit_move_insn (crtl->eh.ehr_handler, tmp);
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 6c03976bb54..7587b454d10 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2015-09-21 Uros Bizjak <ubizjak@gmail.com>
+
+ PR middle-end/67619
+ * gcc.dg/torture/pr67619.c: New test.
+ * lib/target-supports.exp (check_effective_target_builtin_eh_return):
+ New procedure.
+
2015-09-21 Richard Biener <rguenther@suse.de>
Backport from mainline
diff --git a/gcc/testsuite/gcc.dg/torture/pr67619.c b/gcc/testsuite/gcc.dg/torture/pr67619.c
new file mode 100644
index 00000000000..9c6bb6e3171
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr67619.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target builtin_eh_return } */
+
+void
+foo ()
+{
+ unsigned long l;
+ void *p = 0;
+
+ __builtin_unwind_init ();
+ l = 0;
+ __builtin_eh_return (l, p);
+}
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 8f360c3801d..7807f723f57 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -6277,3 +6277,13 @@ proc check_effective_target_comdat_group {} {
int (*fn) () = foo;
}]
}
+
+# Return 1 if target supports __builtin_eh_return
+proc check_effective_target_builtin_eh_return { } {
+ return [check_no_compiler_messages builtin_eh_return object {
+ void test (long l, void *p)
+ {
+ __builtin_eh_return (l, p);
+ }
+ } "" ]
+}