public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/68062] New: ICE when comparing vectors
@ 2015-10-23  5:16 hubicka at gcc dot gnu.org
  2015-10-23  8:15 ` [Bug c/68062] [4.9/5/6 Regression] " rguenth at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: hubicka at gcc dot gnu.org @ 2015-10-23  5:16 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 68062
           Summary: ICE when comparing vectors
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hubicka at gcc dot gnu.org
  Target Milestone: ---

Hi,
the following testcase:

typedef char __attribute__ ((vector_size (4))) v4qi;
typedef unsigned char __attribute__ ((vector_size (4))) uv4qi;

v4qi v;
void ret(char a)
{
  v4qi c={a,a,a,a};
  uv4qi d={a,a,a,a};
  v = (c!=d);
}

Gives:
b.c:8:6: error: mismatching comparison operand types
 void ret(char a)
      ^
v4qi
uv4qi
D.2265 = c != d;
b.c:8:6: internal compiler error: verify_gimple failed
0xcef09d verify_gimple_in_seq(gimple*)
        ../../gcc/tree-cfg.c:4767
0xaae4e8 gimplify_body(tree_node*, bool)
        ../../gcc/gimplify.c:9319
0xaaecb5 gimplify_function_tree(tree_node*)
        ../../gcc/gimplify.c:9408
0x923fa7 cgraph_node::analyze()
        ../../gcc/cgraphunit.c:636
0x9274e3 analyze_functions
        ../../gcc/cgraphunit.c:1091
0x927d90 symbol_table::finalize_compilation_unit()
        ../../gcc/cgraphunit.c:2540
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c/68062] [4.9/5/6 Regression] ICE when comparing vectors
  2015-10-23  5:16 [Bug c/68062] New: ICE when comparing vectors hubicka at gcc dot gnu.org
@ 2015-10-23  8:15 ` rguenth at gcc dot gnu.org
  2015-10-23  8:15 ` [Bug c/68062] " rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-10-23  8:15 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.9.4
            Summary|ICE when comparing vectors  |[4.9/5/6 Regression] ICE
                   |                            |when comparing vectors


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c/68062] ICE when comparing vectors
  2015-10-23  5:16 [Bug c/68062] New: ICE when comparing vectors hubicka at gcc dot gnu.org
  2015-10-23  8:15 ` [Bug c/68062] [4.9/5/6 Regression] " rguenth at gcc dot gnu.org
@ 2015-10-23  8:15 ` rguenth at gcc dot gnu.org
  2015-10-23 11:12 ` [Bug c/68062] [4.9/5/6 Regression] " ienkovich at gcc dot gnu.org
  2015-10-23 13:30 ` ienkovich at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-10-23  8:15 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-10-23
                 CC|                            |ienkovich at gcc dot gnu.org
            Version|unknown                     |5.2.0
     Ever confirmed|0                           |1
      Known to fail|                            |4.9.2, 5.2.0, 6.0

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Looks like a C FE issue.  The C++ FE also spits out bogus(?)

t.c: In function 'void ret(char)':
t.c:8:19: warning: narrowing conversion of 'a' from 'char' to 'unsigned char'
inside { } [-Wnarrowing]
   uv4qi d={a,a,a,a};
                   ^
t.c:8:19: warning: narrowing conversion of 'a' from 'char' to 'unsigned char'
inside { } [-Wnarrowing]
t.c:8:19: warning: narrowing conversion of 'a' from 'char' to 'unsigned char'
inside { } [-Wnarrowing]
t.c:8:19: warning: narrowing conversion of 'a' from 'char' to 'unsigned char'
inside { } [-Wnarrowing]
t.c:5:6: error: mismatching comparison operand types
 void ret(char a)
      ^
v4qi
uv4qi
D.2265 = c != d;
t.c:5:6: internal compiler error: verify_gimple failed


Note that GCC 4.8 rejects the comparison with

t.c: In function ‘ret’:
t.c:9:9: error: comparing vectors with different element types
   v = (c!=d);
         ^


With -funsigned-char the ICE is different:

> /abuild/rguenther/trunk-g/gcc/cc1plus -quiet t.c -funsigned-char
t.c: In function 'void ret(char)':
t.c:5:6: internal compiler error: in optab_handler, at optabs-query.h:32
 void ret(char a)
      ^
0xae59c7 optab_handler(optab_tag, machine_mode)
        /space/rguenther/src/svn/trunk/gcc/optabs-query.h:32
0x12a4f3e expand_vector_operations_1


I suppose that is Iljas fault (only happens on trunk).
>From gcc-bugs-return-500362-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Oct 23 08:17:37 2015
Return-Path: <gcc-bugs-return-500362-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 48356 invoked by alias); 23 Oct 2015 08:17:36 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 48313 invoked by uid 48); 23 Oct 2015 08:17:32 -0000
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/68062] [4.9/5/6 Regression] ICE when comparing vectors
Date: Fri, 23 Oct 2015 08:17:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c
X-Bugzilla-Version: 5.2.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: rguenth at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.9.4
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-68062-4-b7cvvj8rVQ@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-68062-4@http.gcc.gnu.org/bugzilla/>
References: <bug-68062-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-10/txt/msg01917.txt.bz2
Content-length: 326

https://gcc.gnu.org/bugzilla/show_bug.cgi?idh062

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
The FEs are missing a VIEW_CONVERT_EXPR around one of the operands.  But I
suppose 4.8 is correct in rejecting this compare with mismatched sign
(though the rejection isn't dependent on the sign of char).


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c/68062] [4.9/5/6 Regression] ICE when comparing vectors
  2015-10-23  5:16 [Bug c/68062] New: ICE when comparing vectors hubicka at gcc dot gnu.org
  2015-10-23  8:15 ` [Bug c/68062] [4.9/5/6 Regression] " rguenth at gcc dot gnu.org
  2015-10-23  8:15 ` [Bug c/68062] " rguenth at gcc dot gnu.org
@ 2015-10-23 11:12 ` ienkovich at gcc dot gnu.org
  2015-10-23 13:30 ` ienkovich at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: ienkovich at gcc dot gnu.org @ 2015-10-23 11:12 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Ilya Enkovich <ienkovich at gcc dot gnu.org> ---
(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.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c/68062] [4.9/5/6 Regression] ICE when comparing vectors
  2015-10-23  5:16 [Bug c/68062] New: ICE when comparing vectors hubicka at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2015-10-23 11:12 ` [Bug c/68062] [4.9/5/6 Regression] " ienkovich at gcc dot gnu.org
@ 2015-10-23 13:30 ` ienkovich at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: ienkovich at gcc dot gnu.org @ 2015-10-23 13:30 UTC (permalink / raw)
  To: gcc-bugs

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);


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-10-23 13:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-23  5:16 [Bug c/68062] New: ICE when comparing vectors hubicka at gcc dot gnu.org
2015-10-23  8:15 ` [Bug c/68062] [4.9/5/6 Regression] " rguenth at gcc dot gnu.org
2015-10-23  8:15 ` [Bug c/68062] " rguenth at gcc dot gnu.org
2015-10-23 11:12 ` [Bug c/68062] [4.9/5/6 Regression] " ienkovich at gcc dot gnu.org
2015-10-23 13:30 ` ienkovich at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).