This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/52760] Revision 185599 causes miscompare on sphinx3


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

--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-03-29 12:54:31 UTC ---
(In reply to comment #7)
> (In reply to comment #6)
> > Created attachment 27030 [details]
> > gcc48-pr52760.patch
> > 
> > So do you prefer this instead?
> 
> Yes.  In a non-constant case we'd miss a conversion, so I suppose we only
> expect constant shift counts here - which means you should assert
> constant_p instead of verifying it.

vectorizable_shift has

              /* Unlike the other binary operators, shifts/rotates have
                 the rhs being int, instead of the same type as the lhs,
                 so make sure the scalar is the right type if we are
                 dealing with vectors of long long/long/short/char.  */
              if (dt[1] == vect_constant_def)
                op1 = fold_convert (TREE_TYPE (vectype), op1);
              else if (!useless_type_conversion_p (TREE_TYPE (vectype),
                                                   TREE_TYPE (op1)))
                {
                  if (slp_node
                      && TYPE_MODE (TREE_TYPE (vectype))
                         != TYPE_MODE (TREE_TYPE (op1)))
                    {
                      if (vect_print_dump_info (REPORT_DETAILS))
                      fprintf (vect_dump, "unusable type for last operand in"
                                          " vector/vector shift/rotate.");
                        return false;
                    }
so, it can be non-constant just fine, but in that case would just have the same
mode.  So asserting constant_p there would be wrong.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]