diff mbox

[alpha] : FIX PR61586, ICE in alpha_handle_trap_shadows

Message ID CAFULd4Zck48tqUfyRpW2FLJ+c5SvWX128jE=uptvbRaNDkpfWg@mail.gmail.com
State New
Headers show

Commit Message

Uros Bizjak June 26, 2014, 9:43 a.m. UTC
Hello!

Attached patch handles (barrier) RTXes that can be reached when
__builtin_trap builtin is used.

2014-06-26  Uros Bizjak  <ubizjak@gmail.com>

    PR target/61586
    * config/alpha/alpha.c (alpha_handle_trap_shadows): Handle BARRIER RTX.

testsuite/ChangeLog:

2014-06-26  Uros Bizjak  <ubizjak@gmail.com>

    PR target/61586
    * gcc.target/alpha/pr61586.c: New test.

Bootstrapped and regression tested on alphaev68-linux-gnu.

OK for mainline and 4.9 ?

Uros.

Comments

Richard Henderson June 26, 2014, 7:44 p.m. UTC | #1
On 06/26/2014 02:43 AM, Uros Bizjak wrote:
> 2014-06-26  Uros Bizjak  <ubizjak@gmail.com>
> 
>     PR target/61586
>     * config/alpha/alpha.c (alpha_handle_trap_shadows): Handle BARRIER RTX.
> 
> testsuite/ChangeLog:
> 
> 2014-06-26  Uros Bizjak  <ubizjak@gmail.com>
> 
>     PR target/61586
>     * gcc.target/alpha/pr61586.c: New test.

Ok.

Thanks!


r~
diff mbox

Patch

Index: config/alpha/alpha.c
===================================================================
--- config/alpha/alpha.c	(revision 211941)
+++ config/alpha/alpha.c	(working copy)
@@ -8717,6 +8717,11 @@  alpha_handle_trap_shadows (void)
 			}
 		      break;
 
+		    case BARRIER:
+		      /* __builtin_unreachable can expand to no code at all,
+			 leaving (barrier) RTXes in the instruction stream.  */
+		      goto close_shadow_notrapb;
+
 		    case JUMP_INSN:
 		    case CALL_INSN:
 		    case CODE_LABEL:
@@ -8732,6 +8737,7 @@  alpha_handle_trap_shadows (void)
 		  n = emit_insn_before (gen_trapb (), i);
 		  PUT_MODE (n, TImode);
 		  PUT_MODE (i, TImode);
+		close_shadow_notrapb:
 		  trap_pending = 0;
 		  shadow.used.i = 0;
 		  shadow.used.fp = 0;
Index: testsuite/gcc.target/alpha/pr61586.c
===================================================================
--- testsuite/gcc.target/alpha/pr61586.c	(revision 0)
+++ testsuite/gcc.target/alpha/pr61586.c	(working copy)
@@ -0,0 +1,10 @@ 
+/* { dg-do compile } */
+/* { dg-options "-O2 -mieee" } */
+
+void foo (int *dimensions, double **params, int hh)
+{
+  if (params[hh])
+    ;
+  else if (dimensions[hh] > 0)
+    params[hh][0] = 1.0f;
+}