+2016-01-01  Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/69015
+       * ifcvt.c (find_cond_trap): Give up if returnjump_p (jump).
 \f
 Copyright (C) 2016 Free Software Foundation, Inc.
 
 
     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.
 \f
 Copyright (C) 2016 Free Software Foundation, Inc.