summaryrefslogtreecommitdiffstats
path: root/gcc/expr.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2012-01-11 22:59:12 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2012-01-11 22:59:12 +0000
commit45152a7bc5439728859243f827c16cd945a8f24e (patch)
treefbdc23d46078139f7cb8428d4b8b9ecfefb8f37b /gcc/expr.c
parent113ef6a57c667f753f49e495b19fc4c664b48479 (diff)
downloadppe42-gcc-45152a7bc5439728859243f827c16cd945a8f24e.tar.gz
ppe42-gcc-45152a7bc5439728859243f827c16cd945a8f24e.zip
PR bootstrap/51796
* combine.c (distribute_notes): If i3 is a noreturn call, allow old_size to be equal to args_size and make sure the noreturn call gets REG_ARGS_SIZE note. * expr.c (fixup_args_size_notes): Put REG_ARGS_SIZE notes on noreturn calls even when the delta is 0. * gcc.dg/pr51796.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@183111 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index 9825d126df4..c5162692241 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -1,7 +1,7 @@
/* Convert tree expression to rtl instructions, for GNU compiler.
Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
- Free Software Foundation, Inc.
+ 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
+ 2012 Free Software Foundation, Inc.
This file is part of GCC.
@@ -3642,9 +3642,11 @@ mem_autoinc_base (rtx mem)
(1) One or more auto-inc style memory references (aka pushes),
(2) One or more addition/subtraction with the SP as destination,
(3) A single move insn with the SP as destination,
- (4) A call_pop insn.
+ (4) A call_pop insn,
+ (5) Noreturn call insns if !ACCUMULATE_OUTGOING_ARGS.
- Insns in the sequence that do not modify the SP are ignored.
+ Insns in the sequence that do not modify the SP are ignored,
+ except for noreturn calls.
The return value is the amount of adjustment that can be trivially
verified, via immediate operand or auto-inc. If the adjustment
@@ -3789,7 +3791,12 @@ fixup_args_size_notes (rtx prev, rtx last, int end_args_size)
this_delta = find_args_size_adjust (insn);
if (this_delta == 0)
- continue;
+ {
+ if (!CALL_P (insn)
+ || ACCUMULATE_OUTGOING_ARGS
+ || find_reg_note (insn, REG_NORETURN, NULL_RTX) == NULL_RTX)
+ continue;
+ }
gcc_assert (!saw_unknown);
if (this_delta == HOST_WIDE_INT_MIN)
OpenPOWER on IntegriCloud