public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/114108] New: [14 regression] ICE when building opencv-4.8.1 (error: type mismatch in binary expression)
@ 2024-02-26  0:54 sjames at gcc dot gnu.org
  2024-02-26  0:55 ` [Bug middle-end/114108] " sjames at gcc dot gnu.org
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: sjames at gcc dot gnu.org @ 2024-02-26  0:54 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 114108
           Summary: [14 regression] ICE when building opencv-4.8.1 (error:
                    type mismatch in binary expression)
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sjames at gcc dot gnu.org
  Target Milestone: ---

Created attachment 57535
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57535&action=edit
arithm.dispatch.ii.xz

```/usr/bin/aarch64-unknown-linux-gnu-g++ -DCVAPI_EXPORTS
-DOPENCV_ALLOCATOR_STATS_COUNTER_TYPE=int -D_USE_MATH_DEFINES
-D__OPENCV_BUILD=1 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS
-D__STDC_LIMIT_MACROS
-I/var/tmp/portage/media-libs/opencv-4.8.1-r1/work/opencv-4.8.1/modules/core/include
-I/var/tmp/portage/media-libs/opencv-4.8.1-r1/work/opencv-4.8.1_build-.arm64-python3_10/modules/core
-isystem
/var/tmp/portage/media-libs/opencv-4.8.1-r1/work/opencv-4.8.1_build-.arm64-python3_10
-isystem /usr/include/eigen3  -O2 -pipe -mcpu=native -fdiagnostics-color=always
-ggdb3 -fno-vect-cost-model -U_FORTIFY_SOURCE -fno-hardened   -fsigned-char -W
-Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat
-Wformat-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith
-Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override
-Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3
-Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer
-ffunction-sections -fdata-sections  -fvisibility=hidden
-fvisibility-inlines-hidden -fopenmp -std=c++14 -fPIC
-fdiagnostics-color=always -MD -MT
modules/core/CMakeFiles/opencv_core.dir/src/arithm.dispatch.cpp.o -MF
modules/core/CMakeFiles/opencv_core.dir/src/arithm.dispatch.cpp.o.d -o
modules/core/CMakeFiles/opencv_core.dir/src/arithm.dispatch.cpp.o -c
/var/tmp/portage/media-libs/opencv-4.8.1-r1/work/opencv-4.8.1/modules/core/src/arithm.dispatch.cpp
In file included from
/var/tmp/portage/media-libs/opencv-4.8.1-r1/work/opencv-4.8.1/modules/core/src/arithm.dispatch.cpp:7:
/var/tmp/portage/media-libs/opencv-4.8.1-r1/work/opencv-4.8.1/modules/core/src/arithm.simd.hpp:
In function ‘void cv::hal::cpu_baseline::bin_loop(const T1*, size_t, const T1*,
size_t, T1*, size_t, int, int) [with OP = op_absdiff; T1 = signed char; Tvec =
cv::hal_baseline::v_int8x16]’:
/var/tmp/portage/media-libs/opencv-4.8.1-r1/work/opencv-4.8.1/modules/core/src/arithm.simd.hpp:396:13:
error: type mismatch in binary expression
  396 | static void bin_loop(const T1* src1, size_t step1, const T1* src2,
size_t step2, T1* dst, size_t step, int width, int height)
      |             ^~~~~~~~
vector(16) unsigned char

vector(16) signed char

vector(16) signed char

vect_patt_233.7322_610 = MIN_EXPR <vect_patt_231.7321_609, { 127, 127, 127,
127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127 }>;
/var/tmp/portage/media-libs/opencv-4.8.1-r1/work/opencv-4.8.1/modules/core/src/arithm.simd.hpp:396:13:
error: type mismatch in binary expression
vector(8) unsigned char

vector(8) signed char

vector(8) signed char

vect_patt_379.7338_714 = MIN_EXPR <vect_patt_377.7337_713, { 127, 127, 127,
127, 127, 127, 127, 127 }>;
during GIMPLE pass: vect
/var/tmp/portage/media-libs/opencv-4.8.1-r1/work/opencv-4.8.1/modules/core/src/arithm.simd.hpp:396:13:
internal compiler error: verify_gimple failed
0xaaaadc101497 verify_gimple_in_cfg(function*, bool, bool)
       
/usr/src/debug/sys-devel/gcc-14.0.9999/gcc-14.0.9999/gcc/tree-cfg.cc:5663
0xaaaadbf1fdcb execute_function_todo
        /usr/src/debug/sys-devel/gcc-14.0.9999/gcc-14.0.9999/gcc/passes.cc:2088
0xaaaadbf204df execute_todo
        /usr/src/debug/sys-devel/gcc-14.0.9999/gcc-14.0.9999/gcc/passes.cc:2142
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://bugs.gentoo.org/> for instructions.
```



```
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/aarch64-unknown-linux-gnu/14/lto-wrapper
Target: aarch64-unknown-linux-gnu
Configured with:
/var/tmp/portage/sys-devel/gcc-14.0.9999/work/gcc-14.0.9999/configure
--host=aarch64-unknown-linux-gnu --build=aarch64-unknown-linux-gnu
--prefix=/usr --bindir=/usr/aarch64-unknown-linux-gnu/gcc-bin/14
--includedir=/usr/lib/gcc/aarch64-unknown-linux-gnu/14/include
--datadir=/usr/share/gcc-data/aarch64-unknown-linux-gnu/14
--mandir=/usr/share/gcc-data/aarch64-unknown-linux-gnu/14/man
--infodir=/usr/share/gcc-data/aarch64-unknown-linux-gnu/14/info
--with-gxx-include-dir=/usr/lib/gcc/aarch64-unknown-linux-gnu/14/include/g++-v14
--disable-silent-rules --disable-dependency-tracking
--with-python-dir=/share/gcc-data/aarch64-unknown-linux-gnu/14/python
--enable-languages=c,c++,fortran --enable-obsolete --enable-secureplt
--disable-werror --with-system-zlib --enable-nls --without-included-gettext
--disable-libunwind-exceptions --enable-checking=yes,extra,rtl
--with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo Hardened
14.0.9999 p, commit e54a7fbca63053b5753fd9ba543c27ef392d3084'
--with-gcc-major-version-only --enable-libstdcxx-time --enable-lto
--disable-libstdcxx-pch --enable-shared --enable-threads=posix
--enable-__cxa_atexit --enable-clocale=gnu --disable-multilib
--disable-fixed-point --enable-libgomp --disable-libssp --disable-libada
--disable-cet --disable-systemtap --disable-valgrind-annotations
--disable-vtable-verify --disable-libvtv --with-zstd --without-isl
--enable-default-pie --enable-host-pie --enable-host-bind-now
--enable-default-ssp --disable-fixincludes
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240225 (experimental)
5c45dc1b97890afe7a977cea8069214ccdc42384 (Gentoo Hardened 14.0.9999 p, commit
e54a7fbca63053b5753fd9ba543c27ef392d3084)
```

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

* [Bug middle-end/114108] [14 regression] ICE when building opencv-4.8.1 (error: type mismatch in binary expression)
  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 ` sjames at gcc dot gnu.org
  2024-02-26  0:59 ` [Bug tree-optimization/114108] " pinskia at gcc dot gnu.org
                   ` (12 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: sjames at gcc dot gnu.org @ 2024-02-26  0:55 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Sam James <sjames at gcc dot gnu.org> ---
I can reproduce it with `g++ -c arithm.dispatch.cpp.ii -O3
-mcpu=neoverse-n1+crc+crypto+ssbs`. I can't try to narrow it down or reduce it
right now though.

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

* [Bug tree-optimization/114108] [14 regression] ICE when building opencv-4.8.1 (error: type mismatch in binary expression)
  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 ` pinskia at gcc dot gnu.org
  2024-02-26  1:01 ` pinskia at gcc dot gnu.org
                   ` (11 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-02-26  0:59 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pinskia at gcc dot gnu.org
             Target|                            |aarch64
          Component|middle-end                  |tree-optimization
           Keywords|                            |ice-on-valid-code
   Target Milestone|---                         |14.0

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

* [Bug tree-optimization/114108] [14 regression] ICE when building opencv-4.8.1 (error: type mismatch in binary expression)
  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
                   ` (10 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-02-26  1:01 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Just -O3 is enough.

Reducing

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

* [Bug tree-optimization/114108] [14 regression] ICE when building opencv-4.8.1 (error: type mismatch in binary expression)
  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
                   ` (2 preceding siblings ...)
  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
                   ` (9 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-02-26  5:34 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Created attachment 57536
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57536&action=edit
Reduced testcase

Just needs -O3 as mentioned.

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

* [Bug tree-optimization/114108] [14 regression] ICE when building opencv-4.8.1 (error: type mismatch in binary expression)
  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
                   ` (3 preceding siblings ...)
  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
                   ` (8 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-02-26  5:41 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2024-02-26
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I suspect r14-1832-g710b8dec61a73c as GCC 13 didn't use ABD but the trunk is
now using it and there seems to be missing a VCE from `vector(16) unsigned
char` to `vector(16) signed char` before the MIN_EXPR too.

Confirmed.

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

* [Bug tree-optimization/114108] [14 regression] ICE when building opencv-4.8.1 (error: type mismatch in binary expression) since r14-1833
  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
                   ` (4 preceding siblings ...)
  2024-02-26  5:41 ` pinskia at gcc dot gnu.org
@ 2024-02-28 13:00 ` jakub at gcc dot gnu.org
  2024-02-28 18:27 ` pinskia at gcc dot gnu.org
                   ` (7 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-02-28 13:00 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org
           Keywords|needs-bisection             |
            Summary|[14 regression] ICE when    |[14 regression] ICE when
                   |building opencv-4.8.1       |building opencv-4.8.1
                   |(error: type mismatch in    |(error: type mismatch in
                   |binary expression)          |binary expression) since
                   |                            |r14-1833

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Close.  Started with r14-1833-gea616f687dccbe42012f786c0ebade5b05850206

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

* [Bug tree-optimization/114108] [14 regression] ICE when building opencv-4.8.1 (error: type mismatch in binary expression) since r14-1833
  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
                   ` (5 preceding siblings ...)
  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
                   ` (6 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-02-28 18:27 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #5)
> Close.  Started with r14-1833-gea616f687dccbe42012f786c0ebade5b05850206

Though r14-1833 just enables what was added to the vectorizer in r14-1832 for
aarch64.

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

* [Bug tree-optimization/114108] [14 regression] ICE when building opencv-4.8.1 (error: type mismatch in binary expression) since r14-1833
  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
                   ` (6 preceding siblings ...)
  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
                   ` (5 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-02-28 18:28 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #6)
> Though r14-1833 just enables what was added to the vectorizer in r14-1832
> for aarch64.

Sure, the bug is in r14-1832, but bisection was to r14-1833.

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

* [Bug tree-optimization/114108] [14 regression] ICE when building opencv-4.8.1 (error: type mismatch in binary expression) since r14-1833
  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
                   ` (7 preceding siblings ...)
  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
                   ` (4 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-03-04 13:18 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1

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

* [Bug tree-optimization/114108] [14 regression] ICE when building opencv-4.8.1 (error: type mismatch in binary expression) since r14-1833
  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
                   ` (8 preceding siblings ...)
  2024-03-04 13:18 ` rguenth at gcc dot gnu.org
@ 2024-03-05  8:58 ` belagod at gcc dot gnu.org
  2024-03-06  8:25 ` belagod at gcc dot gnu.org
                   ` (3 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: belagod at gcc dot gnu.org @ 2024-03-05  8:58 UTC (permalink / raw)
  To: gcc-bugs

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...

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

* [Bug tree-optimization/114108] [14 regression] ICE when building opencv-4.8.1 (error: type mismatch in binary expression) since r14-1833
  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
                   ` (9 preceding siblings ...)
  2024-03-05  8:58 ` belagod at gcc dot gnu.org
@ 2024-03-06  8:25 ` belagod at gcc dot gnu.org
  2024-03-15  6:18 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: belagod at gcc dot gnu.org @ 2024-03-06  8:25 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Tejas Belagod <belagod at gcc dot gnu.org> ---
This seems to be the issue:

...  VECITYPE is the vector form of PATTERN_STMT's result type.  */

static gimple * 
vect_convert_output (vec_info *vinfo, stmt_vec_info stmt_info, tree type,
                     gimple *pattern_stmt, tree vecitype) 
...

vect_recog_abd_pattern () currently calls vect_convert_output () with vectype
of the new type when it should actually be calling it with pattern_stmt's LHS's
type's vector form.

...
  stmt = vect_convert_output (vinfo, stmt_vinfo, unsign, stmt,
unsigned_vectype);
..

Testing a fix as we speak...

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

* [Bug tree-optimization/114108] [14 regression] ICE when building opencv-4.8.1 (error: type mismatch in binary expression) since r14-1833
  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
                   ` (10 preceding siblings ...)
  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
  13 siblings, 0 replies; 15+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-03-15  6:18 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tejas Belagod <belagod@gcc.gnu.org>:

https://gcc.gnu.org/g:81f3d963e05de8b17d4ccc7667ead9ed156193a4

commit r14-9487-g81f3d963e05de8b17d4ccc7667ead9ed156193a4
Author: Tejas Belagod <tejas.belagod@arm.com>
Date:   Wed Mar 6 15:30:26 2024 +0530

    vect: Call vect_convert_output with the right vecitype [PR114108]

    This patch fixes a bug where vect_recog_abd_pattern called
vect_convert_output
    with the incorrect vecitype for the corresponding pattern_stmt.
    vect_convert_output expects vecitype to be the vector form of the scalar
type
    of the LHS of pattern_stmt, but we were passing in the vector form of the
LHS
    of the new impending conversion statement.  This caused a skew in ABD's
    pattern_stmt having the vectype of the following gimple pattern_stmt.

            2024-03-06  Tejas Belagod  <tejas.belagod@arm.com>

    gcc/ChangeLog:

            PR middle-end/114108
            * tree-vect-patterns.cc (vect_recog_abd_pattern): Call
            vect_convert_output with the correct vecitype.

    gcc/testsuite/ChangeLog:
            * gcc.dg/vect/pr114108.c: New test.

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

* [Bug tree-optimization/114108] [14 regression] ICE when building opencv-4.8.1 (error: type mismatch in binary expression) since r14-1833
  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
                   ` (11 preceding siblings ...)
  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
  13 siblings, 0 replies; 15+ messages in thread
From: belagod at gcc dot gnu.org @ 2024-03-15  6:31 UTC (permalink / raw)
  To: gcc-bugs

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

Tejas Belagod <belagod at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #11 from Tejas Belagod <belagod at gcc dot gnu.org> ---
Fixed on master.

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

* [Bug tree-optimization/114108] [14 regression] ICE when building opencv-4.8.1 (error: type mismatch in binary expression) since r14-1833
  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
                   ` (12 preceding siblings ...)
  2024-03-15  6:31 ` belagod at gcc dot gnu.org
@ 2024-03-15  6:31 ` sjames at gcc dot gnu.org
  13 siblings, 0 replies; 15+ messages in thread
From: sjames at gcc dot gnu.org @ 2024-03-15  6:31 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #12 from Sam James <sjames at gcc dot gnu.org> ---
Thank you!

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

end of thread, other threads:[~2024-03-15  6:31 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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