gcc-patches@gcc.gnu.org
[Top] [All Lists]

fix pr23546, exposed by using VIEW_CONVERT_EXPR for vectors

Subject: fix pr23546, exposed by using VIEW_CONVERT_EXPR for vectors
From: Paolo Bonzini
Date: Wed, 24 Aug 2005 16:26:43 +0200
This is a latent bug exposed by my change to fix pr23517 and use VIEW_CONVERT_EXPR to convert from/to vectors. It may as well affect Ada testcases, so I'm CCing Laurent.

Loop invariant motion was not handling VIEW_CONVERT_EXPRs of integer and real constants. I don't know if they make sense, but expr.c handles them normally and they seem similar enough to VECTOR_CSTs (which are handled in the function, instead).

Bootstrapped C/C++, regtesting going well but I probably won't see the results before tomorrow morning European time. Ok for mainline and 4.0?

Paolo
2005-08-24  Paolo Bonzini  <bonzini@xxxxxxx>

        PR tree-optimization/23546
        * tree-ssa-loop-im.c (for_each_index): Handle INTEGER_CST
        and REAL_CST nodes.

2005-08-24  Paolo Bonzini  <bonzini@xxxxxxx>

        PR tree-optimization/23546
        * gcc.dg/tree-ssa/pr23546.c: New.

Index: tree-ssa-loop-im.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-loop-im.c,v
retrieving revision 2.50
diff -p -u -r2.50 tree-ssa-loop-im.c
--- tree-ssa-loop-im.c  17 Aug 2005 14:00:52 -0000      2.50
+++ tree-ssa-loop-im.c  24 Aug 2005 14:03:11 -0000
@@ -203,6 +203,8 @@ for_each_index (tree *addr_p, bool (*cbc
        case RESULT_DECL:
        case VECTOR_CST:
        case COMPLEX_CST:
+       case INTEGER_CST:
+       case REAL_CST:
          return true;
 
        case TARGET_MEM_REF:

/* { dg-do compile } */
/* { dg-options "-O2" } */
typedef int m64 __attribute__ ((__vector_size__ (8)));

void mmxCombineMaskU (m64 * mask, int width)
{
  while (--width >= 0)
    *mask++ = (m64) 0LL;
}
<Prev in Thread] Current Thread [Next in Thread>
  • fix pr23546, exposed by using VIEW_CONVERT_EXPR for vectors, Paolo Bonzini <=