[Bug tree-optimization/52666] [4.8 Regression] FAIL: scal-to-vec1.c

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Mar 22 13:50:00 GMT 2012


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52666

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2012-03-22 00:00:00         |
         AssignedTo|unassigned at gcc dot       |rguenth at gcc dot gnu.org
                   |gnu.org                     |

--- Comment #4 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-03-22 13:48:26 UTC ---
It seems we choose to lower the vector to word-mode operations but the number
of words is bigger than the number of vector elements.  Thus we trigger
the new constant-folding code for BIT_FIELD_REFs that uses
native_encode/interpret_expr.

Now the issue is that this does not work correctly because
of a typo ...

Index: gcc/fold-const.c
===================================================================
--- gcc/fold-const.c    (revision 185691)
+++ gcc/fold-const.c    (working copy)
@@ -14012,7 +14012,7 @@ fold_ternary_loc (location_t loc, enum t
       /* Need bit-shifting of the buffer to relax the following.  */
       && tree_low_cst (op2, 1) % BITS_PER_UNIT == 0)
     {
-      unsigned HOST_WIDE_INT bitpos = tree_low_cst (op1, 2);
+      unsigned HOST_WIDE_INT bitpos = tree_low_cst (op2, 1);
       unsigned HOST_WIDE_INT bitsize = tree_low_cst (op1, 1);
       unsigned HOST_WIDE_INT clen;
       clen = tree_low_cst (TYPE_SIZE_UNIT (TREE_TYPE (arg0)), 1);



More information about the Gcc-bugs mailing list