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 c/68062] [4.9/5/6 Regression] ICE when comparing vectors


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

--- Comment #4 from Ilya Enkovich <ienkovich at gcc dot gnu.org> ---
(In reply to Ilya Enkovich from comment #3)
> (In reply to Richard Biener from comment #1)
> > I suppose that is Iljas fault (only happens on trunk).
> 
> Yes, -funsigned-char seems to be my fault.  I'll have look.

It appears to be introduced by r229173.  We now try to lower vector comparison
using optab which doesn't actually exist.  This patch fixes it:

diff --git a/gcc/tree-vect-generic.c b/gcc/tree-vect-generic.c
index 2005383..9c59402 100644
--- a/gcc/tree-vect-generic.c
+++ b/gcc/tree-vect-generic.c
@@ -1533,7 +1533,8 @@ expand_vector_operations_1 (gimple_stmt_iterator *gsi)
       && TYPE_MODE (TREE_TYPE (type)) == TYPE_MODE (TREE_TYPE (srhs1)))
     {
       op = optab_for_tree_code (code, TREE_TYPE (type), optab_scalar);
-      if (optab_handler (op, TYPE_MODE (TREE_TYPE (type))) !=
CODE_FOR_nothing)
+      if (op != unknown_optab
+         && optab_handler (op, TYPE_MODE (TREE_TYPE (type))) !=
CODE_FOR_nothing)
        {
          tree slhs = make_ssa_name (TREE_TYPE (srhs1));
          gimple *repl = gimple_build_assign (slhs, code, srhs1, srhs2);


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