public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "belagod at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/114108] [14 regression] ICE when building opencv-4.8.1 (error: type mismatch in binary expression) since r14-1833
Date: Tue, 05 Mar 2024 08:58:12 +0000	[thread overview]
Message-ID: <bug-114108-4-a2FiExEmIJ@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-114108-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #8 from Tejas Belagod <belagod at gcc dot gnu.org> ---
I find this transformation a bit odd:

...
pr114108.c:11:21: note:  add new stmt: vect_patt_32.15_181 = .ABD
(vect__3.11_177, vect__7.14_180);
pr114108.c:11:21: note:  ------>vectorizing statement: patt_31 = (unsigned
char) patt_32;
pr114108.c:11:21: note:  transform statement.
pr114108.c:11:21: note:  vect_is_simple_use: operand .ABD (_3, _7), type of
def: internal
pr114108.c:11:21: note:  vect_is_simple_use: vectype vector([16,16]) unsigned
char
pr114108.c:11:21: note:  transform assignment.
pr114108.c:11:21: note:  vect_get_vec_defs_for_operand: patt_32
pr114108.c:11:21: note:  vect_is_simple_use: operand .ABD (_3, _7), type of
def: internal
pr114108.c:11:21: note:    def_stmt =  patt_32 = .ABD (_3, _7);
pr114108.c:11:21: note:  add new stmt: vect_patt_31.16_182 =
VIEW_CONVERT_EXPR<vector([16,16]) signed char>(vect_patt_32.15_181);
...

This seems to have a cascading effect on the MIN_EXPR vectorization:

pr114108.c:11:21: note:  ------>vectorizing statement: patt_30 = (int) patt_31;
pr114108.c:11:21: note:  ------>vectorizing statement: _11 = dst_18(D) + _1;
pr114108.c:11:21: note:  ------>vectorizing statement: patt_29 = MIN_EXPR
<patt_31, 127>;
pr114108.c:11:21: note:  transform statement.
pr114108.c:11:21: note:  vect_is_simple_use: operand (unsigned char) patt_32,
type of def: internal
pr114108.c:11:21: note:  vect_is_simple_use: vectype vector([16,16]) signed
char 
pr114108.c:11:21: note:  vect_is_simple_use: operand 127, type of def: constant
pr114108.c:11:21: note:  transform binary/unary operation.
pr114108.c:11:21: note:  vect_get_vec_defs_for_operand: patt_31
pr114108.c:11:21: note:  vect_is_simple_use: operand (unsigned char) patt_32,
type of def: internal
pr114108.c:11:21: note:    def_stmt =  patt_31 = (unsigned char) patt_32;
pr114108.c:11:21: note:  vect_get_vec_defs_for_operand: 127
pr114108.c:11:21: note:  vect_is_simple_use: operand 127, type of def: constant
pr114108.c:11:21: note:  created new init_stmt: vect_cst__183 = { 127, ... };
pr114108.c:11:21: note:  add new stmt: vect_patt_29.17_184 = MIN_EXPR
<vect_patt_31.16_182, vect_cst__183>;


I suspect that when narrowing analysis drops patt_30 = (int) patt_31; and
replaces patt_30 in MIN_EXPR directly with patt_31, the pre-computed vector
type_out for patt_30 = (int) patt_31; might be getting reused without getting
recomputed. Still digging to see if this theory holds water...

  parent reply	other threads:[~2024-03-05  8:58 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-26  0:54 [Bug middle-end/114108] New: [14 regression] ICE when building opencv-4.8.1 (error: type mismatch in binary expression) sjames at gcc dot gnu.org
2024-02-26  0:55 ` [Bug middle-end/114108] " sjames at gcc dot gnu.org
2024-02-26  0:59 ` [Bug tree-optimization/114108] " pinskia at gcc dot gnu.org
2024-02-26  1:01 ` pinskia at gcc dot gnu.org
2024-02-26  5:34 ` pinskia at gcc dot gnu.org
2024-02-26  5:41 ` pinskia at gcc dot gnu.org
2024-02-28 13:00 ` [Bug tree-optimization/114108] [14 regression] ICE when building opencv-4.8.1 (error: type mismatch in binary expression) since r14-1833 jakub at gcc dot gnu.org
2024-02-28 18:27 ` pinskia at gcc dot gnu.org
2024-02-28 18:28 ` jakub at gcc dot gnu.org
2024-03-04 13:18 ` rguenth at gcc dot gnu.org
2024-03-05  8:58 ` belagod at gcc dot gnu.org [this message]
2024-03-06  8:25 ` belagod at gcc dot gnu.org
2024-03-15  6:18 ` cvs-commit at gcc dot gnu.org
2024-03-15  6:31 ` belagod at gcc dot gnu.org
2024-03-15  6:31 ` sjames at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-114108-4-a2FiExEmIJ@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).