re PR debug/51762 (ICE in maybe_record_trace_start, at dwarf2cfi.c:2231)

PR debug/51762
	* calls.c (emit_call_1): For noreturn calls force a REG_ARGS_SIZE
	note when !ACCUMULATE_OUTGOING_ARGS.

	* gcc.dg/pr51762.c: New test.

From-SVN: r182924
This commit is contained in:
Jakub Jelinek 2012-01-05 21:47:16 +01:00 committed by Jakub Jelinek
parent 629c2cca17
commit f8f75b16c2
4 changed files with 34 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2012-01-05 Jakub Jelinek <jakub@redhat.com>
PR debug/51762
* calls.c (emit_call_1): For noreturn calls force a REG_ARGS_SIZE
note when !ACCUMULATE_OUTGOING_ARGS.
2012-01-05 Eric Botcazou <ebotcazou@adacore.com>
* tree-vrp.c (extract_range_from_binary_expr_1): Remove duplicated

View File

@ -1,7 +1,7 @@
/* Convert function calls to rtl insns, for GNU C compiler.
Copyright (C) 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
2011 Free Software Foundation, Inc.
2011, 2012 Free Software Foundation, Inc.
This file is part of GCC.
@ -445,6 +445,11 @@ emit_call_1 (rtx funexp, tree fntree ATTRIBUTE_UNUSED, tree fndecl ATTRIBUTE_UNU
if (SUPPORTS_STACK_ALIGNMENT)
crtl->need_drap = true;
}
/* For noreturn calls when not accumulating outgoing args force
REG_ARGS_SIZE note to prevent crossjumping of calls with different
args sizes. */
else if (!ACCUMULATE_OUTGOING_ARGS && (ecf_flags & ECF_NORETURN) != 0)
add_reg_note (call_insn, REG_ARGS_SIZE, GEN_INT (stack_pointer_delta));
if (!ACCUMULATE_OUTGOING_ARGS)
{

View File

@ -1,5 +1,8 @@
2012-01-05 Jakub Jelinek <jakub@redhat.com>
PR debug/51762
* gcc.dg/pr51762.c: New test.
PR rtl-optimization/51767
* gcc.c-torture/compile/pr51767.c: New test.

View File

@ -0,0 +1,19 @@
/* PR debug/51762 */
/* { dg-do compile } */
/* { dg-options "-g -Os -fomit-frame-pointer -fno-asynchronous-unwind-tables" } */
void noret (void) __attribute__ ((noreturn));
int bar (void);
void baz (const char *);
static int v = -1;
void
foo (void)
{
if (bar () && v == -1)
{
baz ("baz");
noret ();
}
noret ();
}