[Bug tree-optimization/63379] Incorrect vectorization when enabling SSE and O3, initialises loop with wrong value

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Oct 9 08:52:00 GMT 2014


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63379

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code
             Target|                            |x86_64-*-*
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-10-09
     Ever confirmed|0                           |1
      Known to fail|                            |4.7.4, 4.8.3, 4.9.1, 5.0

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed.  We're choosing bogus "neutral" operands for MIN/MAX in the case of
SLP.  I am testing

Index: gcc/tree-vect-slp.c
===================================================================
--- gcc/tree-vect-slp.c (revision 215917)
+++ gcc/tree-vect-slp.c (working copy)
@@ -2395,13 +2395,8 @@ vect_get_constant_vectors (tree op, slp_
             neutral_op = build_int_cst (TREE_TYPE (op), -1);
             break;

-          case MAX_EXPR:
-          case MIN_EXPR:
-            def_stmt = SSA_NAME_DEF_STMT (op);
-            loop = (gimple_bb (stmt))->loop_father;
-            neutral_op = PHI_ARG_DEF_FROM_EDGE (def_stmt,
-                                                loop_preheader_edge (loop));
-            break;
+         /* For MIN/MAX we don't have an easy neutral operand but
+            the initial values can be used fine here.  */

           default:
             neutral_op = NULL;



More information about the Gcc-bugs mailing list