public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/109473] New: ICE during GIMPLE pass: vect: verify_gimple failed with -m32
@ 2023-04-11 14:48 arsen at gcc dot gnu.org
  2023-04-11 14:55 ` [Bug tree-optimization/109473] ICE during GIMPLE pass: vect: verify_gimple failed with -O1 -ftree-loop-vectorize arsen at gcc dot gnu.org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: arsen at gcc dot gnu.org @ 2023-04-11 14:48 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 109473
           Summary: ICE during GIMPLE pass: vect: verify_gimple failed
                    with -m32
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: arsen at gcc dot gnu.org
  Target Milestone: ---

Created attachment 54831
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54831&action=edit
reduced reproducer

detected initially while building PipeWire, the attached code compiled with
-m32 -march=x86-64 -O1 -ftree-loop-vectorize produces an ICE:

~/gcc/scratch_build/gcc 4 $ ./cc1 -quiet ccGrpuMH.out -m32 -march=x86-64 -O1
-ftree-loop-vectorize
ccGrpuMH.out: In function ‘do_port_use_buffers’:
ccGrpuMH.out:9:14: warning: comparison between pointer and integer
    9 |     for (; j < buffers; j++)
      |              ^
ccGrpuMH.out:10:14: warning: assignment to ‘void *’ from ‘unsigned int’ makes
pointer from integer without a cast [-Wint-conversion]
   10 |       endptr = (__UINTPTR_TYPE__)endptr + buffers[i]->metas[j];
      |              ^
ccGrpuMH.out:11:16: warning: comparison of distinct pointer types lacks a cast
   11 |     if (endptr > mem)
      |                ^
ccGrpuMH.out:4:6: error: invalid (pointer) operands ‘plus_expr’
    4 | void do_port_use_buffers(struct spa_buffer **buffers) {
      |      ^~~~~~~~~~~~~~~~~~~
_77 = stmp_endptr_23.18_76 + endptr_15;
during GIMPLE pass: vect
ccGrpuMH.out:4:6: internal compiler error: verify_gimple failed
0x142f352 verify_gimple_in_cfg(function*, bool, bool)
        ../../scratch/gcc/tree-cfg.cc:5648
0x12d1050 execute_function_todo
        ../../scratch/gcc/passes.cc:2098
0x12d15be execute_todo
        ../../scratch/gcc/passes.cc:2152
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

~/gcc/scratch_build/gcc 4 $ ./xgcc -v
Using built-in specs.
COLLECT_GCC=./xgcc
Target: x86_64-pc-linux-gnu
Configured with: ../scratch/configure --disable-bootstrap
--enable-checking=yes,rtl,tree --enable-languages=c,c++ --enable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 13.0.1 20230411 (experimental) (GCC)
~/gcc/scratch_build/gcc$ echo -n g:; git -C ../../scratch rev-parse HEAD^
g:b8e32978e3d9e3b88cd4f441edfdebfa395a5c26

(the commit applied on top of this is a maintainer-scripts/ edit)

I don't have a vanilla build of current releases/gcc-12, but it seems that it
is affected too:

~/gcc/scratch_build/gcc 1 $ gcc-12 --version
gcc-12 (Gentoo Hardened 12.2.1_p20230408 p14) 12.2.1 20230408
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

~/gcc/scratch_build/gcc$ gcc-12 -x c -S -o - ccGrpuMH.out -m32 -march=x86-64
-O1 -ftree-loop-vectorize
        .file   "ccGrpuMH.out"
ccGrpuMH.out: In function ‘do_port_use_buffers’:
ccGrpuMH.out:9:14: warning: comparison between pointer and integer
    9 |     for (; j < buffers; j++)
      |              ^
ccGrpuMH.out:10:14: warning: assignment to ‘void *’ from ‘unsigned int’ makes
pointer from integer without a cast [-Wint-conversion]
   10 |       endptr = (__UINTPTR_TYPE__)endptr + buffers[i]->metas[j];
      |              ^
ccGrpuMH.out:11:16: warning: comparison of distinct pointer types lacks a cast
   11 |     if (endptr > mem)
      |                ^
        .text
ccGrpuMH.out:4:6: error: invalid (pointer) operands ‘plus_expr’
    4 | void do_port_use_buffers(struct spa_buffer **buffers) {
      |      ^~~~~~~~~~~~~~~~~~~
_77 = stmp_endptr_23.18_76 + endptr_15;
during GIMPLE pass: vect
ccGrpuMH.out:4:6: internal compiler error: verify_gimple failed
0xe96d34 verify_gimple_in_cfg(function*, bool)
       
/usr/src/debug/sys-devel/gcc-12.2.1_p20230408/gcc-12-20230408/gcc/tree-cfg.cc:5561
0xd5c927 execute_function_todo
       
/usr/src/debug/sys-devel/gcc-12.2.1_p20230408/gcc-12-20230408/gcc/passes.cc:2085
0xd5ca51 execute_todo
       
/usr/src/debug/sys-devel/gcc-12.2.1_p20230408/gcc-12-20230408/gcc/passes.cc:2139
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.

but, earlier gcc-12 seems unaffected:
~/gcc/releases/gcc-12b/gcc$ ./cc1 -quiet ccGrpuMH.out -m32 -march=x86-64 -O1
-ftree-loop-vectorize
ccGrpuMH.out: In function ‘do_port_use_buffers’:
ccGrpuMH.out:9:14: warning: comparison between pointer and integer
    9 |     for (; j < buffers; j++)
      |              ^
ccGrpuMH.out:10:14: warning: assignment to ‘void *’ from ‘unsigned int’ makes
pointer from integer without a cast [-Wint-conversion]
   10 |       endptr = (__UINTPTR_TYPE__)endptr + buffers[i]->metas[j];
      |              ^
ccGrpuMH.out:11:16: warning: comparison of distinct pointer types lacks a cast
   11 |     if (endptr > mem)
      |                ^
~/gcc/releases/gcc-12b/gcc$ ./xgcc --version
xgcc (GCC) 12.2.1 20230313
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
~/gcc/releases/gcc-12b/gcc$ git -C ../../gcc-12 gcc-descr HEAD
r12-9248-g775be7d6cb5517


apologies for the lack of bisect - i'm in a time crunch

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

* [Bug tree-optimization/109473] ICE during GIMPLE pass: vect: verify_gimple failed with -O1 -ftree-loop-vectorize
  2023-04-11 14:48 [Bug tree-optimization/109473] New: ICE during GIMPLE pass: vect: verify_gimple failed with -m32 arsen at gcc dot gnu.org
@ 2023-04-11 14:55 ` arsen at gcc dot gnu.org
  2023-04-11 15:13 ` [Bug tree-optimization/109473] [10/11/12/13 Regression] " jakub at gcc dot gnu.org
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: arsen at gcc dot gnu.org @ 2023-04-11 14:55 UTC (permalink / raw)
  To: gcc-bugs

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

Arsen Arsenović <arsen at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|ICE during GIMPLE pass:     |ICE during GIMPLE pass:
                   |vect: verify_gimple failed  |vect: verify_gimple failed
                   |with -m32                   |with -O1
                   |                            |-ftree-loop-vectorize

--- Comment #1 from Arsen Arsenović <arsen at gcc dot gnu.org> ---
oh, actually, it seems that the reduced case no longer requires -m32:

~/gcc/scratch_build/gcc$ ./cc1 -quiet ccGrpuMH.out -O1 -ftree-loop-vectorize
ccGrpuMH.out: In function ‘do_port_use_buffers’:
ccGrpuMH.out:9:14: warning: comparison between pointer and integer
    9 |     for (; j < buffers; j++)
      |              ^
ccGrpuMH.out:10:14: warning: assignment to ‘void *’ from ‘long unsigned int’
makes pointer from integer without a cast [-Wint-conversion]
   10 |       endptr = (__UINTPTR_TYPE__)endptr + buffers[i]->metas[j];
      |              ^
ccGrpuMH.out:11:16: warning: comparison of distinct pointer types lacks a cast
   11 |     if (endptr > mem)
      |                ^
ccGrpuMH.out:4:6: error: invalid (pointer) operands ‘plus_expr’
    4 | void do_port_use_buffers(struct spa_buffer **buffers) {
      |      ^~~~~~~~~~~~~~~~~~~
_110 = stmp_endptr_25.16_109 + endptr_17;
during GIMPLE pass: vect
ccGrpuMH.out:4:6: internal compiler error: verify_gimple failed
0x142f352 verify_gimple_in_cfg(function*, bool, bool)
        ../../scratch/gcc/tree-cfg.cc:5648
0x12d1050 execute_function_todo
        ../../scratch/gcc/passes.cc:2098
0x12d15be execute_todo
        ../../scratch/gcc/passes.cc:2152
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
~/gcc/scratch_build/gcc 4 $ gcc-12 -x c ccGrpuMH.out -O1 -ftree-loop-vectorize
ccGrpuMH.out: In function ‘do_port_use_buffers’:
ccGrpuMH.out:9:14: warning: comparison between pointer and integer
    9 |     for (; j < buffers; j++)
      |              ^
ccGrpuMH.out:10:14: warning: assignment to ‘void *’ from ‘long unsigned int’
makes pointer from integer without a cast [-Wint-conversion]
   10 |       endptr = (__UINTPTR_TYPE__)endptr + buffers[i]->metas[j];
      |              ^
ccGrpuMH.out:11:16: warning: comparison of distinct pointer types lacks a cast
   11 |     if (endptr > mem)
      |                ^
ccGrpuMH.out:4:6: error: invalid (pointer) operands ‘plus_expr’
    4 | void do_port_use_buffers(struct spa_buffer **buffers) {
      |      ^~~~~~~~~~~~~~~~~~~
_108 = stmp_endptr_25.16_107 + endptr_17;
during GIMPLE pass: vect
ccGrpuMH.out:4:6: internal compiler error: verify_gimple failed
0xe96d34 verify_gimple_in_cfg(function*, bool)
       
/usr/src/debug/sys-devel/gcc-12.2.1_p20230408/gcc-12-20230408/gcc/tree-cfg.cc:5561
0xd5c927 execute_function_todo
       
/usr/src/debug/sys-devel/gcc-12.2.1_p20230408/gcc-12-20230408/gcc/passes.cc:2085
0xd5ca51 execute_todo
       
/usr/src/debug/sys-devel/gcc-12.2.1_p20230408/gcc-12-20230408/gcc/passes.cc:2139
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.

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

* [Bug tree-optimization/109473] [10/11/12/13 Regression] ICE during GIMPLE pass: vect: verify_gimple failed with -O1 -ftree-loop-vectorize
  2023-04-11 14:48 [Bug tree-optimization/109473] New: ICE during GIMPLE pass: vect: verify_gimple failed with -m32 arsen at gcc dot gnu.org
  2023-04-11 14:55 ` [Bug tree-optimization/109473] ICE during GIMPLE pass: vect: verify_gimple failed with -O1 -ftree-loop-vectorize arsen at gcc dot gnu.org
@ 2023-04-11 15:13 ` jakub at gcc dot gnu.org
  2023-04-12  8:00 ` [Bug tree-optimization/109473] [10/11/12/13 Regression] ICE during GIMPLE pass: vect: verify_gimple failed with -O1 -ftree-loop-vectorize since r10-4076-g82e8e335f917b9 rguenth at gcc dot gnu.org
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-04-11 15:13 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Target Milestone|---                         |10.5
           Priority|P3                          |P2
            Summary|ICE during GIMPLE pass:     |[10/11/12/13 Regression]
                   |vect: verify_gimple failed  |ICE during GIMPLE pass:
                   |with -O1                    |vect: verify_gimple failed
                   |-ftree-loop-vectorize       |with -O1
                   |                            |-ftree-loop-vectorize
             Status|UNCONFIRMED                 |NEW
                 CC|                            |jakub at gcc dot gnu.org
   Last reconfirmed|                            |2023-04-11

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Started with r10-4076-g82e8e335f917b9

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

* [Bug tree-optimization/109473] [10/11/12/13 Regression] ICE during GIMPLE pass: vect: verify_gimple failed with -O1 -ftree-loop-vectorize since r10-4076-g82e8e335f917b9
  2023-04-11 14:48 [Bug tree-optimization/109473] New: ICE during GIMPLE pass: vect: verify_gimple failed with -m32 arsen at gcc dot gnu.org
  2023-04-11 14:55 ` [Bug tree-optimization/109473] ICE during GIMPLE pass: vect: verify_gimple failed with -O1 -ftree-loop-vectorize arsen at gcc dot gnu.org
  2023-04-11 15:13 ` [Bug tree-optimization/109473] [10/11/12/13 Regression] " jakub at gcc dot gnu.org
@ 2023-04-12  8:00 ` rguenth at gcc dot gnu.org
  2023-04-12  8:06 ` jakub at gcc dot gnu.org
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-04-12  8:00 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot gnu.org

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
I will have a look.  The following gets rid of undefined behavior and makes it
ICE with -fno-checking as well (but in forwprop then).

struct spa_buffer {
  __UINT32_TYPE__ *metas;
};
void do_port_use_buffers(struct spa_buffer **buffers, void *mem)
{ 
  for (int i = 0; i < 128; i++) {
    void *endptr;
    for (int j = 0; j < 128; j++)
      endptr = (void *)((__UINTPTR_TYPE__)endptr + buffers[i]->metas[j]);
    if (endptr > mem)
      return;
  }
}

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

* [Bug tree-optimization/109473] [10/11/12/13 Regression] ICE during GIMPLE pass: vect: verify_gimple failed with -O1 -ftree-loop-vectorize since r10-4076-g82e8e335f917b9
  2023-04-11 14:48 [Bug tree-optimization/109473] New: ICE during GIMPLE pass: vect: verify_gimple failed with -m32 arsen at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2023-04-12  8:00 ` [Bug tree-optimization/109473] [10/11/12/13 Regression] ICE during GIMPLE pass: vect: verify_gimple failed with -O1 -ftree-loop-vectorize since r10-4076-g82e8e335f917b9 rguenth at gcc dot gnu.org
@ 2023-04-12  8:06 ` jakub at gcc dot gnu.org
  2023-04-12 10:23 ` cvs-commit at gcc dot gnu.org
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-04-12  8:06 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
It still uses uninitialized endptr.

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

* [Bug tree-optimization/109473] [10/11/12/13 Regression] ICE during GIMPLE pass: vect: verify_gimple failed with -O1 -ftree-loop-vectorize since r10-4076-g82e8e335f917b9
  2023-04-11 14:48 [Bug tree-optimization/109473] New: ICE during GIMPLE pass: vect: verify_gimple failed with -m32 arsen at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2023-04-12  8:06 ` jakub at gcc dot gnu.org
@ 2023-04-12 10:23 ` cvs-commit at gcc dot gnu.org
  2023-04-12 10:24 ` [Bug tree-optimization/109473] [10/11/12 " rguenth at gcc dot gnu.org
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-04-12 10:23 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>:

https://gcc.gnu.org/g:df7f55cb2ae550adeda339a57b657ebe1ad39367

commit r13-7147-gdf7f55cb2ae550adeda339a57b657ebe1ad39367
Author: Richard Biener <rguenther@suse.de>
Date:   Wed Apr 12 10:22:08 2023 +0200

    tree-optimization/109473 - ICE with reduction epilog adjustment op

    The following makes sure to carry out the reduction epilog adjustment
    in the original computation type which for pointers is an unsigned
    integer type.  There's a similar issue with signed vs. unsigned ops
    and overflow which is fixed by this as well.

            PR tree-optimization/109473
            * tree-vect-loop.cc (vect_create_epilog_for_reduction):
            Convert scalar result to the computation type before performing
            the reduction adjustment.

            * gcc.dg/vect/pr109473.c: New testcase.

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

* [Bug tree-optimization/109473] [10/11/12 Regression] ICE during GIMPLE pass: vect: verify_gimple failed with -O1 -ftree-loop-vectorize since r10-4076-g82e8e335f917b9
  2023-04-11 14:48 [Bug tree-optimization/109473] New: ICE during GIMPLE pass: vect: verify_gimple failed with -m32 arsen at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2023-04-12 10:23 ` cvs-commit at gcc dot gnu.org
@ 2023-04-12 10:24 ` rguenth at gcc dot gnu.org
  2023-04-12 10:53 ` arsen at gcc dot gnu.org
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-04-12 10:24 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |13.0
            Summary|[10/11/12/13 Regression]    |[10/11/12 Regression] ICE
                   |ICE during GIMPLE pass:     |during GIMPLE pass: vect:
                   |vect: verify_gimple failed  |verify_gimple failed with
                   |with -O1                    |-O1 -ftree-loop-vectorize
                   |-ftree-loop-vectorize since |since
                   |r10-4076-g82e8e335f917b9    |r10-4076-g82e8e335f917b9

--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed on trunk sofar.

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

* [Bug tree-optimization/109473] [10/11/12 Regression] ICE during GIMPLE pass: vect: verify_gimple failed with -O1 -ftree-loop-vectorize since r10-4076-g82e8e335f917b9
  2023-04-11 14:48 [Bug tree-optimization/109473] New: ICE during GIMPLE pass: vect: verify_gimple failed with -m32 arsen at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2023-04-12 10:24 ` [Bug tree-optimization/109473] [10/11/12 " rguenth at gcc dot gnu.org
@ 2023-04-12 10:53 ` arsen at gcc dot gnu.org
  2023-04-17  9:14 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: arsen at gcc dot gnu.org @ 2023-04-12 10:53 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Arsen Arsenović <arsen at gcc dot gnu.org> ---
LGTM - the original, unreduced, case builds on trunk.  thanks!

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

* [Bug tree-optimization/109473] [10/11/12 Regression] ICE during GIMPLE pass: vect: verify_gimple failed with -O1 -ftree-loop-vectorize since r10-4076-g82e8e335f917b9
  2023-04-11 14:48 [Bug tree-optimization/109473] New: ICE during GIMPLE pass: vect: verify_gimple failed with -m32 arsen at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2023-04-12 10:53 ` arsen at gcc dot gnu.org
@ 2023-04-17  9:14 ` cvs-commit at gcc dot gnu.org
  2023-05-02 12:03 ` [Bug tree-optimization/109473] [10/11 " cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-04-17  9:14 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-12 branch has been updated by Richard Biener
<rguenth@gcc.gnu.org>:

https://gcc.gnu.org/g:053668dbf11bb61c63fa7db5b3bccd0fdac9e726

commit r12-9412-g053668dbf11bb61c63fa7db5b3bccd0fdac9e726
Author: Richard Biener <rguenther@suse.de>
Date:   Wed Apr 12 10:22:08 2023 +0200

    tree-optimization/109473 - ICE with reduction epilog adjustment op

    The following makes sure to carry out the reduction epilog adjustment
    in the original computation type which for pointers is an unsigned
    integer type.  There's a similar issue with signed vs. unsigned ops
    and overflow which is fixed by this as well.

            PR tree-optimization/109473
            * tree-vect-loop.cc (vect_create_epilog_for_reduction):
            Convert scalar result to the computation type before performing
            the reduction adjustment.

            * gcc.dg/vect/pr109473.c: New testcase.

    (cherry picked from commit df7f55cb2ae550adeda339a57b657ebe1ad39367)

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

* [Bug tree-optimization/109473] [10/11 Regression] ICE during GIMPLE pass: vect: verify_gimple failed with -O1 -ftree-loop-vectorize since r10-4076-g82e8e335f917b9
  2023-04-11 14:48 [Bug tree-optimization/109473] New: ICE during GIMPLE pass: vect: verify_gimple failed with -m32 arsen at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2023-04-17  9:14 ` cvs-commit at gcc dot gnu.org
@ 2023-05-02 12:03 ` cvs-commit at gcc dot gnu.org
  2023-05-03  8:45 ` [Bug tree-optimization/109473] [10 " jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-05-02 12:03 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Richard Biener
<rguenth@gcc.gnu.org>:

https://gcc.gnu.org/g:54ddf6426e04e4b0d24bbc7e37d40acbf5fbfe3b

commit r11-10676-g54ddf6426e04e4b0d24bbc7e37d40acbf5fbfe3b
Author: Richard Biener <rguenther@suse.de>
Date:   Wed Apr 12 10:22:08 2023 +0200

    tree-optimization/109473 - ICE with reduction epilog adjustment op

    The following makes sure to carry out the reduction epilog adjustment
    in the original computation type which for pointers is an unsigned
    integer type.  There's a similar issue with signed vs. unsigned ops
    and overflow which is fixed by this as well.

            PR tree-optimization/109473
            * tree-vect-loop.c (vect_create_epilog_for_reduction):
            Convert scalar result to the computation type before performing
            the reduction adjustment.

            * gcc.dg/vect/pr109473.c: New testcase.

    (cherry picked from commit df7f55cb2ae550adeda339a57b657ebe1ad39367)

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

* [Bug tree-optimization/109473] [10 Regression] ICE during GIMPLE pass: vect: verify_gimple failed with -O1 -ftree-loop-vectorize since r10-4076-g82e8e335f917b9
  2023-04-11 14:48 [Bug tree-optimization/109473] New: ICE during GIMPLE pass: vect: verify_gimple failed with -m32 arsen at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2023-05-02 12:03 ` [Bug tree-optimization/109473] [10/11 " cvs-commit at gcc dot gnu.org
@ 2023-05-03  8:45 ` jakub at gcc dot gnu.org
  2023-05-03 10:14 ` cvs-commit at gcc dot gnu.org
  2023-07-07 10:07 ` rguenth at gcc dot gnu.org
  11 siblings, 0 replies; 13+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-05-03  8:45 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
The testcase fails for me in gcc 11 on both x86_64-linux and i686-linux
(--enable-checking=yes,rtl,extra):
+FAIL: gcc.dg/vect/pr109473.c (internal compiler error)
+FAIL: gcc.dg/vect/pr109473.c (test for excess errors)
+FAIL: gcc.dg/vect/pr109473.c -flto -ffat-lto-objects (internal compiler error)
+FAIL: gcc.dg/vect/pr109473.c -flto -ffat-lto-objects (test for excess errors)
/usr/src/gcc-11/gcc/testsuite/gcc.dg/vect/pr109473.c:7:6: internal compiler
error: in build_vector_from_val, at tree.c:1970
0x7cd0c6 build_vector_from_val(tree_node*, tree_node*)
        ../../gcc/tree.c:1970
0xd77c26 gimple_build_vector_from_val(gimple**, unsigned int, tree_node*,
tree_node*)
        ../../gcc/gimple-fold.c:8719
0x12fc798 gimple_build_vector_from_val(gimple**, tree_node*, tree_node*)
        ../../gcc/gimple-fold.h:142
0x12fc798 get_initial_def_for_reduction
        ../../gcc/tree-vect-loop.c:4765
0x12fc798 vect_transform_cycle_phi(_loop_vec_info*, _stmt_vec_info*, gimple**,
_slp_tree*, _slp_instance*)
        ../../gcc/tree-vect-loop.c:7681
0x12ece28 vect_transform_stmt(vec_info*, _stmt_vec_info*,
gimple_stmt_iterator*, _slp_tree*, _slp_instance*)
        ../../gcc/tree-vect-stmts.c:11012
0x13053f5 vect_transform_loop(_loop_vec_info*, gimple*)
        ../../gcc/tree-vect-loop.c:9633
0x1336a3c try_vectorize_loop_1
        ../../gcc/tree-vectorizer.c:1104
0x13376a1 vectorize_loops()
        ../../gcc/tree-vectorizer.c:1243

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

* [Bug tree-optimization/109473] [10 Regression] ICE during GIMPLE pass: vect: verify_gimple failed with -O1 -ftree-loop-vectorize since r10-4076-g82e8e335f917b9
  2023-04-11 14:48 [Bug tree-optimization/109473] New: ICE during GIMPLE pass: vect: verify_gimple failed with -m32 arsen at gcc dot gnu.org
                   ` (9 preceding siblings ...)
  2023-05-03  8:45 ` [Bug tree-optimization/109473] [10 " jakub at gcc dot gnu.org
@ 2023-05-03 10:14 ` cvs-commit at gcc dot gnu.org
  2023-07-07 10:07 ` rguenth at gcc dot gnu.org
  11 siblings, 0 replies; 13+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-05-03 10:14 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Richard Biener
<rguenth@gcc.gnu.org>:

https://gcc.gnu.org/g:ffb092784fc2513c2944253efc57c27de068c8b9

commit r11-10737-gffb092784fc2513c2944253efc57c27de068c8b9
Author: Richard Biener <rguenther@suse.de>
Date:   Wed May 3 11:06:28 2023 +0200

    tree-optimization/109473 - fix type mismatch in reduction vectorization

    When backporting the PR109473 fix I failed to realize its testcase
    will run into an unrelated similar bug.  With GCC 12 the code has
    seen substantial refactoring so the following applies a local fix
    to make sure we are using the correct types when building initial
    values for reductions.

            PR tree-optimization/109473
            * tree-vect-loop.c (get_initial_def_for_reduction):
            Convert the scalar values to the vector component type
            before using it to build the vector for the initial value.

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

* [Bug tree-optimization/109473] [10 Regression] ICE during GIMPLE pass: vect: verify_gimple failed with -O1 -ftree-loop-vectorize since r10-4076-g82e8e335f917b9
  2023-04-11 14:48 [Bug tree-optimization/109473] New: ICE during GIMPLE pass: vect: verify_gimple failed with -m32 arsen at gcc dot gnu.org
                   ` (10 preceding siblings ...)
  2023-05-03 10:14 ` cvs-commit at gcc dot gnu.org
@ 2023-07-07 10:07 ` rguenth at gcc dot gnu.org
  11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-07-07 10:07 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|10.5                        |11.4
      Known to fail|                            |10.5.0
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #12 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed in GCC 11.4

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

end of thread, other threads:[~2023-07-07 10:07 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-11 14:48 [Bug tree-optimization/109473] New: ICE during GIMPLE pass: vect: verify_gimple failed with -m32 arsen at gcc dot gnu.org
2023-04-11 14:55 ` [Bug tree-optimization/109473] ICE during GIMPLE pass: vect: verify_gimple failed with -O1 -ftree-loop-vectorize arsen at gcc dot gnu.org
2023-04-11 15:13 ` [Bug tree-optimization/109473] [10/11/12/13 Regression] " jakub at gcc dot gnu.org
2023-04-12  8:00 ` [Bug tree-optimization/109473] [10/11/12/13 Regression] ICE during GIMPLE pass: vect: verify_gimple failed with -O1 -ftree-loop-vectorize since r10-4076-g82e8e335f917b9 rguenth at gcc dot gnu.org
2023-04-12  8:06 ` jakub at gcc dot gnu.org
2023-04-12 10:23 ` cvs-commit at gcc dot gnu.org
2023-04-12 10:24 ` [Bug tree-optimization/109473] [10/11/12 " rguenth at gcc dot gnu.org
2023-04-12 10:53 ` arsen at gcc dot gnu.org
2023-04-17  9:14 ` cvs-commit at gcc dot gnu.org
2023-05-02 12:03 ` [Bug tree-optimization/109473] [10/11 " cvs-commit at gcc dot gnu.org
2023-05-03  8:45 ` [Bug tree-optimization/109473] [10 " jakub at gcc dot gnu.org
2023-05-03 10:14 ` cvs-commit at gcc dot gnu.org
2023-07-07 10:07 ` rguenth 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).