Commit f1e0620c by Jakub Jelinek Committed by Jakub Jelinek

re PR target/69015 (ICE: RTL check: expected code 'code_label', have 'return' in…

re PR target/69015 (ICE: RTL check: expected code 'code_label', have 'return' in find_cond_trap, at ifcvt.c:3715 with -fno-if-conversion and __builtin_trap())

	PR target/69015
	* ifcvt.c (find_cond_trap): Give up if returnjump_p (jump).

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

From-SVN: r232020
parent 2f883d1c
2016-01-01 Jakub Jelinek <jakub@redhat.com>
PR target/69015
* ifcvt.c (find_cond_trap): Give up if returnjump_p (jump).
Copyright (C) 2016 Free Software Foundation, Inc.
......
......@@ -4526,8 +4526,11 @@ find_cond_trap (basic_block test_bb, edge then_edge, edge else_edge)
return FALSE;
/* If the conditional jump is more than just a conditional jump, then
we can not do if-conversion on this block. */
if (! onlyjump_p (jump))
we can not do if-conversion on this block. Give up for returnjump_p,
changing a conditional return followed by unconditional trap for
conditional trap followed by unconditional return is likely not
beneficial and harder to handle. */
if (! onlyjump_p (jump) || returnjump_p (jump))
return FALSE;
/* We must be comparing objects whose modes imply the size. */
......
2016-01-01 Jakub Jelinek <jakub@redhat.com>
PR target/69015
* gcc.dg/pr69015.c: New test.
Copyright (C) 2016 Free Software Foundation, Inc.
......
/* PR target/69015 */
/* { dg-do compile } */
/* { dg-options "-O2 -fno-if-conversion" } */
void
foo (int c)
{
if (c)
__builtin_trap ();
}
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