]> gcc.gnu.org Git - gcc.git/commitdiff
re PR tree-optimization/57584 (ice: SSA corruption: Unable to coalesce ssa_names)
authorRichard Biener <rguenther@suse.de>
Thu, 20 Jun 2013 10:22:33 +0000 (10:22 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 20 Jun 2013 10:22:33 +0000 (10:22 +0000)
2013-06-20  Richard Biener  <rguenther@suse.de>

PR tree-optimization/57584
* tree-ssa-loop-niter.c (expand_simple_operations): Avoid including
SSA names into the expanded expression that take part in
abnormal coalescing.

* gcc.dg/torture/pr57584.c: New testcase.

From-SVN: r200237

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr57584.c [new file with mode: 0644]
gcc/tree-ssa-loop-niter.c

index 1a950c88ee4a8e35fb2e239d2e1c430b594386a8..249ee283504535b87bc4f7052f5bb139acbbeabd 100644 (file)
@@ -1,3 +1,10 @@
+2013-06-20  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/57584
+       * tree-ssa-loop-niter.c (expand_simple_operations): Avoid including
+       SSA names into the expanded expression that take part in
+       abnormal coalescing.
+
 2013-06-19    <singhai@google.com>
 
        * gcov.c (print_usage): Handle new option.
index 93308ea07f238bc4a5c1b8747989b86517795a75..d5da496e14bf2250ec8107da1178e3dbb66685eb 100644 (file)
@@ -1,3 +1,8 @@
+2013-06-20  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/57584
+       * gcc.dg/torture/pr57584.c: New testcase.
+
 2013-06-19    <singhai@google.com>
 
        * g++.dg/gcov/gcov-8.C: New testcase.
diff --git a/gcc/testsuite/gcc.dg/torture/pr57584.c b/gcc/testsuite/gcc.dg/torture/pr57584.c
new file mode 100644 (file)
index 0000000..7cf630b
--- /dev/null
@@ -0,0 +1,73 @@
+/* { dg-do compile } */
+
+typedef int int32_t __attribute__ ((__mode__ (__SI__)));
+typedef unsigned char uint8_t;
+typedef unsigned long int uintptr_t;
+typedef uint8_t scm_t_uint8;
+typedef int32_t scm_t_int32;
+typedef uintptr_t scm_t_uintptr;
+typedef scm_t_uintptr scm_t_bits;
+typedef struct scm_unused_struct {
+} *SCM;
+enum scm_tc8_tags {
+    scm_tc8_flag = 4 + 0x00,   scm_tc8_char = 4 + 0x08,   scm_tc8_unused_0 = 4 + 0x10,   scm_tc8_unused_1 = 4 + 0x18 };
+struct __jmp_buf_tag   {
+};
+typedef struct __jmp_buf_tag jmp_buf[1];
+typedef struct scm_t_cell {
+} scm_t_cell;
+struct scm_prompt_registers {
+    jmp_buf regs;
+};
+enum {
+    SCM_VM_APPLY_HOOK,   SCM_VM_PUSH_CONTINUATION_HOOK,   SCM_VM_POP_CONTINUATION_HOOK,   SCM_VM_NEXT_HOOK,   SCM_VM_ABORT_CONTINUATION_HOOK,   SCM_VM_RESTORE_CONTINUATION_HOOK,   SCM_VM_NUM_HOOKS, };
+typedef SCM (*scm_t_vm_engine) (SCM vm, SCM program, SCM *argv, int nargs);
+struct scm_vm {
+    scm_t_uint8 *ip;
+    SCM *sp;
+    SCM *fp;
+    int engine;
+    int trace_level;
+};
+static SCM vm_regular_engine (SCM vm, SCM program, SCM *argv, int nargs) {
+}
+static SCM vm_debug_engine (SCM vm, SCM program, SCM *argv, int nargs) {
+    register scm_t_uint8 *ip ;
+    register SCM *sp ;
+    register SCM *fp ;
+    struct scm_vm *vp = ((struct scm_vm *) ((((scm_t_bits) (0? (*(SCM*)0=((((SCM *)((scm_t_cell *) (((scm_t_bits) (0? (*(SCM*)0=((((vm))))): (((vm)))))))) [((1))]))): (((SCM *)((scm_t_cell *) (((scm_t_bits) (0? (*(SCM*)0=((((vm))))): (((vm)))))))) [((1))]))))));
+    static const void **jump_table_pointer = ((void *)0);
+    register const void **jump_table asm ("r12");
+    if (__builtin_expect ((!jump_table_pointer), 0))     {
+       jump_table_pointer[0] = &&l_nop;
+    }
+l_nop:
+      {
+       SCM *old_sp;
+       scm_t_int32 n;
+       old_sp = sp;
+       sp = (fp - 1) + n;
+       if (old_sp < sp)     {
+           while (old_sp < sp)         *++old_sp = ((SCM) ((((((9)) << 8) + scm_tc8_flag))));
+       }
+         {
+             { if (__builtin_expect ((vp->trace_level > 0), 0)) { { vp->ip = ip; vp->sp = sp; vp->fp = fp; }; vm_dispatch_hook (vm, SCM_VM_NEXT_HOOK); } };
+         };
+      }
+      {
+       SCM k, prompt;
+       if ((_setjmp (((struct scm_prompt_registers*)((((scm_t_bits) (0? (*(SCM*)0=((((SCM *)((scm_t_cell *) (((scm_t_bits) (0? (*(SCM*)0=((((prompt))))): (((prompt)))))))) [((2))]))): (((SCM *)((scm_t_cell *) (((scm_t_bits) (0? (*(SCM*)0=((((prompt))))): (((prompt)))))))) [((2))]))))))->regs)))     {
+             { ip = vp->ip; sp = vp->sp; fp = vp->fp; };
+             { { if (__builtin_expect ((vp->trace_level > 0), 0)) { { vp->ip = ip; vp->sp = sp; vp->fp = fp; }; vm_dispatch_hook (vm, SCM_VM_NEXT_HOOK); } }; ; goto *jump_table[(*ip++) & ((1<<8)-1)]; };
+       }
+
+       if (__builtin_expect ((vp->trace_level > 0), 0)) { { vp->ip = ip; vp->sp = sp; vp->fp = fp; }; vm_dispatch_hook (vm, SCM_VM_NEXT_HOOK); } ;
+
+      }
+}
+static const scm_t_vm_engine vm_engines[] =   {
+    vm_regular_engine, vm_debug_engine };
+SCM scm_c_vm_run (SCM vm, SCM program, SCM *argv, int nargs) {
+    struct scm_vm *vp = ((struct scm_vm *) ((((scm_t_bits) (0? (*(SCM*)0=((((SCM *)((scm_t_cell *) (((scm_t_bits) (0? (*(SCM*)0=((((vm))))): (((vm)))))))) [((1))]))): (((SCM *)((scm_t_cell *) (((scm_t_bits) (0? (*(SCM*)0=((((vm))))): (((vm)))))))) [((1))]))))));
+    return vm_engines[vp->engine](vm, program, argv, nargs);
+}
index f5629306e4bb20ffc0d6e97632a2194dd0cabfef..9d6f9efb089ed2531dcf3fa87dfeed25f8b98cfe 100644 (file)
@@ -1514,6 +1514,13 @@ expand_simple_operations (tree expr)
   if (gimple_code (stmt) != GIMPLE_ASSIGN)
     return expr;
 
+  /* Avoid expanding to expressions that contain SSA names that need
+     to take part in abnormal coalescing.  */
+  ssa_op_iter iter;
+  FOR_EACH_SSA_TREE_OPERAND (e, stmt, iter, SSA_OP_USE)
+    if (SSA_NAME_OCCURS_IN_ABNORMAL_PHI (e))
+      return expr;
+
   e = gimple_assign_rhs1 (stmt);
   code = gimple_assign_rhs_code (stmt);
   if (get_gimple_rhs_class (code) == GIMPLE_SINGLE_RHS)
This page took 0.091877 seconds and 5 git commands to generate.