aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2004-09-08 12:25:04 -0700
committerRichard Henderson <rth@gcc.gnu.org>2004-09-08 12:25:04 -0700
commit609c39373f26c6dfeea1906dbf48f617c77d4547 (patch)
tree47cc9395c91fc7803c2237e6398a38122f55b5e7 /gcc
parent4e5b002baa5ce9097e3a1a4798b31c83f0e2ef56 (diff)
downloadgcc-609c39373f26c6dfeea1906dbf48f617c77d4547.zip
gcc-609c39373f26c6dfeea1906dbf48f617c77d4547.tar.gz
gcc-609c39373f26c6dfeea1906dbf48f617c77d4547.tar.bz2
re PR rtl-optimization/17186 (ICE in move_for_stack_reg, at reg-stack.c:1065)
PR rtl-opt/17186 * function.c (expand_function_end): Have fall-off-the-end return path jump around return register setup. From-SVN: r87199
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/function.c11
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20040908-1.c12
3 files changed, 23 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 063bcff..da841e6 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2004-09-08 Richard Henderson <rth@redhat.com>
+
+ PR rtl-opt/17186
+ * function.c (expand_function_end): Have fall-off-the-end
+ return path jump around return register setup.
+
2004-09-08 Eric Botcazou <ebotcazou@libertysurf.fr>
* config/sparc/sparc.c (sparc_indent_opcode): New variable.
@@ -34,7 +40,6 @@
* doc/invoke.texi: Document -segaddr, -segs_read_only_addr and
-segs_read_write_addr.
-
2004-09-08 Richard Henderson <rth@redhat.com>
* function.c (reference_callee_copied): New.
diff --git a/gcc/function.c b/gcc/function.c
index 34c5d65..452de0c 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -4411,20 +4411,19 @@ expand_function_end (void)
/* Emit the actual code to clobber return register. */
{
- rtx seq, after;
+ rtx seq;
start_sequence ();
clobber_return_register ();
+ expand_naked_return ();
seq = get_insns ();
end_sequence ();
- after = emit_insn_after (seq, clobber_after);
+ emit_insn_after (seq, clobber_after);
}
- /* Output the label for the naked return from the function, if one is
- expected. This is currently used only by __builtin_return. */
- if (naked_return_label)
- emit_label (naked_return_label);
+ /* Output the label for the naked return from the function. */
+ emit_label (naked_return_label);
/* ??? This should no longer be necessary since stupid is no longer with
us, but there are some parts of the compiler (eg reload_combine, and
diff --git a/gcc/testsuite/gcc.c-torture/compile/20040908-1.c b/gcc/testsuite/gcc.c-torture/compile/20040908-1.c
new file mode 100644
index 0000000..f52bf5e
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20040908-1.c
@@ -0,0 +1,12 @@
+/* PR 17186 */
+
+double foo()
+{
+ int i;
+ double d;
+
+ if (i)
+ bar();
+ else
+ if (d) return 0;
+}