Commit 5de8da9b by Alexandre Oliva Committed by Alexandre Oliva

re PR middle-end/42363 (ICE: verify_flow_info failed for gcc.c-torture/compile/pr37913.c -O1 -g)

gcc/ChangeLog:
PR middle-end/42363
* gimplify.c (gimplify_modify_expr): Drop lhs on noreturn calls.
* tree-cfg.c (is_ctrl_altering_stmt): Don't compute flags twice.
(verify_gimple_call): Reject LHS in noreturn calls.
gcc/testsuite/ChangeLog:
PR middle-end/42363
* gcc.dg/torture/pr42363.c: New.

From-SVN: r155762
parent 684f25f4
2010-01-09 Alexandre Oliva <aoliva@redhat.com>
PR middle-end/42363
* gimplify.c (gimplify_modify_expr): Drop lhs on noreturn calls.
* tree-cfg.c (is_ctrl_altering_stmt): Don't compute flags twice.
(verify_gimple_call): Reject LHS in noreturn calls.
2010-01-09 Alexandre Oliva <aoliva@redhat.com>
PR debug/42604
PR debug/42395
* tree-vect-loop-manip.c (adjust_info): New type.
......
......@@ -4407,7 +4407,8 @@ gimplify_modify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
/* Since the RHS is a CALL_EXPR, we need to create a GIMPLE_CALL
instead of a GIMPLE_ASSIGN. */
assign = gimple_build_call_from_tree (*from_p);
gimple_call_set_lhs (assign, *to_p);
if (!gimple_call_noreturn_p (assign))
gimple_call_set_lhs (assign, *to_p);
}
else
{
......
2010-01-09 Alexandre Oliva <aoliva@redhat.com>
PR middle-end/42363
* gcc.dg/torture/pr42363.c: New.
2010-01-09 Alexandre Oliva <aoliva@redhat.com>
PR debug/42604
PR debug/42395
* gcc.dg/vect/pr42604.c: New.
......
/* PR middle-end/pr42363, extended from the test for PR middle-end/37913. */
/* { dg-do compile } */
/* { dg-options "-g" } */
void foo (void) __attribute__ ((noreturn));
static int __attribute__ ((noreturn))
bar (void)
{
foo ();
}
int
baz (void)
{
int i = bar ();
return i + 1;
}
int fooz (void) __attribute__ ((noreturn));
static int __attribute__ ((noreturn))
bart (void)
{
return fooz (); /* { dg-warning "noreturn" } */
}
int bazr (void)
{
int i = bart ();
return i + 1;
}
static inline int
bard (void)
{
return fooz ();
}
int bizr (void)
{
int i, j;
i = j = bard ();
return i + 1;
}
/* This might be regarded as pure and folded, rather than inlined.
It's pure evil. */
static int __attribute__ ((pure, const, noreturn))
barf (void)
{
} /* { dg-warning "does return" } */
static int __attribute__ ((pure, const))
bark (void)
{
barf ();
}
int buzr (void)
{
int i, j;
i = j = bark () + bark ();
return i + 1;
}
int buzt (void)
{
int i, j;
i = j = barf () + barf ();
return i + 1;
}
void bust (void)
{
while (barf ())
;
}
......@@ -2230,7 +2230,7 @@ is_ctrl_altering_stmt (gimple t)
return true;
/* A call also alters control flow if it does not return. */
if (gimple_call_flags (t) & ECF_NORETURN)
if (flags & ECF_NORETURN)
return true;
}
break;
......@@ -2963,6 +2963,12 @@ verify_gimple_call (gimple stmt)
return true;
}
if (gimple_call_lhs (stmt) && gimple_call_noreturn_p (stmt))
{
error ("LHS in noreturn call");
return true;
}
fntype = TREE_TYPE (TREE_TYPE (fn));
if (gimple_call_lhs (stmt)
&& !useless_type_conversion_p (TREE_TYPE (gimple_call_lhs (stmt)),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment