public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/110742] New: [14 Regression] cc1plus ICE "Floating point exception" during profiled bootstrap since commit 08b99fe8ad6
@ 2023-07-19 15:47 thiago.bauermann at linaro dot org
  2023-07-19 15:50 ` [Bug c++/110742] " thiago.bauermann at linaro dot org
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: thiago.bauermann at linaro dot org @ 2023-07-19 15:47 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 110742
           Summary: [14 Regression] cc1plus ICE "Floating point exception"
                    during profiled bootstrap since commit 08b99fe8ad6
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: thiago.bauermann at linaro dot org
                CC: saaadhu at gcc dot gnu.org
  Target Milestone: ---
              Host: armv8l-unknown-linux-gnueabihf
            Target: armv8l-unknown-linux-gnueabihf

Created attachment 55583
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55583&action=edit
Output of running with "-v -save-temps -freport-bug".

Our CI detected that commit 08b99fe8ad6c "ira: Skip empty regclass when setting
up reg class relations" introduced an ICE in a profiled bootstrap build on
armv8l-linux-gnueabihf:

/home/thiago.bauermann/.cache/builds/gcc-native-aarch32/./prev-gcc/xg++
-B/home/thiago.bauermann/.cache/builds/gcc-native-aarch32/./prev-gcc/
-B/usr/local/armv8l-unknown-linux-gnueabihf/bin/ -nostdinc++
-B/home/thiago.bauermann/.cache/builds/gcc-native-aarch32/prev-armv8l-unknown-linux-gnueabihf/libstdc++-v3/src/.libs
-B/home/thiago.bauermann/.cache/builds/gcc-native-aarch32/prev-armv8l-unknown-linux-gnueabihf/libstdc++-v3/libsupc++/.libs

-I/home/thiago.bauermann/.cache/builds/gcc-native-aarch32/prev-armv8l-unknown-linux-gnueabihf/libstdc++-v3/include/armv8l-unknown-linux-gnueabihf

-I/home/thiago.bauermann/.cache/builds/gcc-native-aarch32/prev-armv8l-unknown-linux-gnueabihf/libstdc++-v3/include
 -I/home/thiago.bauermann/src/gcc/libstdc++-v3/libsupc++
-L/home/thiago.bauermann/.cache/builds/gcc-native-aarch32/prev-armv8l-unknown-linux-gnueabihf/libstdc++-v3/src/.libs
-L/home/thiago.bauermann/.cache/builds/gcc-native-aarch32/prev-armv8l-unknown-linux-gnueabihf/libstdc++-v3/libsupc++/.libs
 -fno-PIE -c   -g -O2 -fno-checking -gtoggle -fprofile-generate -DIN_GCC   
-fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing
-Wwrite-strings -Wcast-qual -Wmissing-format-attribute
-Wconditionally-supported -Woverloaded-virtual -pedantic -Wno-long-long
-Wno-variadic-macros -Wno-overlength-strings -fno-common  -DHAVE_CONFIG_H
-fno-PIE -I. -I. -I/home/thiago.bauermann/src/gcc/gcc
-I/home/thiago.bauermann/src/gcc/gcc/.
-I/home/thiago.bauermann/src/gcc/gcc/../include 
-I/home/thiago.bauermann/src/gcc/gcc/../libcpp/include
-I/home/thiago.bauermann/src/gcc/gcc/../libcody 
-I/home/thiago.bauermann/src/gcc/gcc/../libdecnumber
-I/home/thiago.bauermann/src/gcc/gcc/../libdecnumber/dpd -I../libdecnumber
-I/home/thiago.bauermann/src/gcc/gcc/../libbacktrace   -o ira.o -MT ira.o -MMD
-MP -MF ./.deps/ira.TPo /home/thiago.bauermann/src/gcc/gcc/ira.cc
during GIMPLE pass: slp
/home/thiago.bauermann/src/gcc/gcc/ira.cc: In function ‘void
setup_reg_class_relations()’:
/home/thiago.bauermann/src/gcc/gcc/ira.cc:1198:1: internal compiler error:
Floating point exception
 1198 | setup_reg_class_relations (void)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~
0x12ff9a5 crash_signal
        /home/thiago.bauermann/src/gcc/gcc/toplev.cc:314
0xf7a0d6df ???
        ../sysdeps/unix/sysv/linux/arm/sigrestorer.S:64
0xf79fdb05 ???
        ../sysdeps/unix/sysv/linux/arm/libc-do-syscall.S:46
0xf7a3d2c9 __pthread_kill_implementation
        ./nptl/pthread_kill.c:43
0xf7a0c83f __GI_raise
        ../sysdeps/posix/raise.c:26
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.
make[3]: *** [Makefile:1181: ira.o] Error 1
make[3]: Leaving directory
'/home/thiago.bauermann/.cache/builds/gcc-native-aarch32/gcc'
make[2]: *** [Makefile:5150: all-stageprofile-gcc] Error 2
make[2]: Leaving directory
'/home/thiago.bauermann/.cache/builds/gcc-native-aarch32'
make[1]: *** [Makefile:26321: stageprofile-bubble] Error 2
make[1]: Leaving directory
'/home/thiago.bauermann/.cache/builds/gcc-native-aarch32'
make: *** [Makefile:1085: all] Error 2

I confirmed that the problem is still present in trunk as of commit
e029635cb72e "[modula2] Variable analysis understands DISPOSE and NIL" from
today.

I'm attaching the output of running with "-v -save-temps -freport-bug", as well
as the corresponding ira.ii.

Tested on Ubuntu 22.04 with:

$ src/gcc/configure \
    SHELL=/bin/bash \
    --with-gnu-as \
    --with-gnu-ld \
    --disable-libmudflap \
    --enable-lto \
    --enable-shared \
    --without-included-gettext \
    --enable-nls \
    --with-system-zlib \
    --disable-sjlj-exceptions \
    --enable-gnu-unique-object \
    --enable-linker-build-id \
    --disable-libstdcxx-pch \
    --enable-c99 \
    --enable-clocale=gnu \
    --enable-libstdcxx-debug \
    --enable-long-long \
    --with-cloog=no \
    --with-ppl=no \
    --with-isl=no \
    --disable-multilib \
    --with-float=hard \
    --with-fpu=neon-fp-armv8 \
    --with-mode=thumb \
    --with-arch=armv8-a \
    --enable-threads=posix \
    --enable-multiarch \
    --enable-libstdcxx-time=yes \
    --enable-gnu-indirect-function \
    --disable-werror \
    --enable-checking=yes \
    --enable-bootstrap \
    --enable-languages=c,c++,fortran,lto \
&& make profiledbootstrap \
        SHELL=/bin/bash \
        -w \
        -j 40 \
        CFLAGS_FOR_BUILD="-pipe -g -O2" \
        CXXFLAGS_FOR_BUILD="-pipe -g -O2" \
        LDFLAGS_FOR_BUILD="-static-libgcc" \
        MAKEINFOFLAGS=--force \
        BUILD_INFO="" \
        MAKEINFO=echo

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

* [Bug c++/110742] [14 Regression] cc1plus ICE "Floating point exception" during profiled bootstrap since commit 08b99fe8ad6
  2023-07-19 15:47 [Bug c++/110742] New: [14 Regression] cc1plus ICE "Floating point exception" during profiled bootstrap since commit 08b99fe8ad6 thiago.bauermann at linaro dot org
@ 2023-07-19 15:50 ` thiago.bauermann at linaro dot org
  2023-07-19 16:09 ` [Bug rtl-optimization/110742] [14 Regression] cc1plus ICE "Floating point exception" during profiled bootstrap since commit g:08b99fe8ad6 pinskia at gcc dot gnu.org
                   ` (14 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: thiago.bauermann at linaro dot org @ 2023-07-19 15:50 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Thiago Jung Bauermann <thiago.bauermann at linaro dot org> ---
Created attachment 55584
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55584&action=edit
Preprocessed ira.cc.

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

* [Bug rtl-optimization/110742] [14 Regression] cc1plus ICE "Floating point exception" during profiled bootstrap since commit g:08b99fe8ad6
  2023-07-19 15:47 [Bug c++/110742] New: [14 Regression] cc1plus ICE "Floating point exception" during profiled bootstrap since commit 08b99fe8ad6 thiago.bauermann at linaro dot org
  2023-07-19 15:50 ` [Bug c++/110742] " thiago.bauermann at linaro dot org
@ 2023-07-19 16:09 ` pinskia at gcc dot gnu.org
  2023-07-19 16:13 ` [Bug tree-optimization/110742] " pinskia at gcc dot gnu.org
                   ` (13 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-07-19 16:09 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c++                         |rtl-optimization
           Keywords|                            |ra, wrong-code
   Target Milestone|---                         |14.0

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

* [Bug tree-optimization/110742] [14 Regression] cc1plus ICE "Floating point exception" during profiled bootstrap since commit g:08b99fe8ad6
  2023-07-19 15:47 [Bug c++/110742] New: [14 Regression] cc1plus ICE "Floating point exception" during profiled bootstrap since commit 08b99fe8ad6 thiago.bauermann at linaro dot org
  2023-07-19 15:50 ` [Bug c++/110742] " thiago.bauermann at linaro dot org
  2023-07-19 16:09 ` [Bug rtl-optimization/110742] [14 Regression] cc1plus ICE "Floating point exception" during profiled bootstrap since commit g:08b99fe8ad6 pinskia at gcc dot gnu.org
@ 2023-07-19 16:13 ` pinskia at gcc dot gnu.org
  2023-07-19 17:07 ` pinskia at gcc dot gnu.org
                   ` (12 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-07-19 16:13 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|rtl-optimization            |tree-optimization
           Keywords|ra, wrong-code              |build, ice-on-valid-code

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Note I think g:08b99fe8ad6 is just exposing the failure. In that the change
exposed the ICE in SLP in the code that g:08b99fe8ad6 changed.

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

* [Bug tree-optimization/110742] [14 Regression] cc1plus ICE "Floating point exception" during profiled bootstrap since commit g:08b99fe8ad6
  2023-07-19 15:47 [Bug c++/110742] New: [14 Regression] cc1plus ICE "Floating point exception" during profiled bootstrap since commit 08b99fe8ad6 thiago.bauermann at linaro dot org
                   ` (2 preceding siblings ...)
  2023-07-19 16:13 ` [Bug tree-optimization/110742] " pinskia at gcc dot gnu.org
@ 2023-07-19 17:07 ` pinskia at gcc dot gnu.org
  2023-07-19 17:12 ` pinskia at gcc dot gnu.org
                   ` (11 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-07-19 17:07 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I can reproduce this via a cross compiler:
./cc1plus t.ii  -nostdinc -O2  -fprofile-generate   -fno-exceptions -fno-rtti
-march=armv8-a+simd -mfpu=neon-fp-armv8 -mfloat-abi=hard -mthumb

/home/thiago.bauermann/src/gcc/gcc/ira.cc: In function ‘void
setup_reg_class_relations()’:
/home/thiago.bauermann/src/gcc/gcc/ira.cc:1198:1: internal compiler error:
Floating point exception


So reducing ...

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

* [Bug tree-optimization/110742] [14 Regression] cc1plus ICE "Floating point exception" during profiled bootstrap since commit g:08b99fe8ad6
  2023-07-19 15:47 [Bug c++/110742] New: [14 Regression] cc1plus ICE "Floating point exception" during profiled bootstrap since commit 08b99fe8ad6 thiago.bauermann at linaro dot org
                   ` (3 preceding siblings ...)
  2023-07-19 17:07 ` pinskia at gcc dot gnu.org
@ 2023-07-19 17:12 ` pinskia at gcc dot gnu.org
  2023-07-19 18:50 ` pinskia at gcc dot gnu.org
                   ` (10 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-07-19 17:12 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Reducing ...

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

* [Bug tree-optimization/110742] [14 Regression] cc1plus ICE "Floating point exception" during profiled bootstrap since commit g:08b99fe8ad6
  2023-07-19 15:47 [Bug c++/110742] New: [14 Regression] cc1plus ICE "Floating point exception" during profiled bootstrap since commit 08b99fe8ad6 thiago.bauermann at linaro dot org
                   ` (4 preceding siblings ...)
  2023-07-19 17:12 ` pinskia at gcc dot gnu.org
@ 2023-07-19 18:50 ` pinskia at gcc dot gnu.org
  2023-07-19 18:51 ` pinskia at gcc dot gnu.org
                   ` (9 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-07-19 18:50 UTC (permalink / raw)
  To: gcc-bugs

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

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

options required:
`-O2  -fprofile-generate    -march=armv8-a+simd -mfpu=neon-fp-armv8
-mfloat-abi=hard`

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

* [Bug tree-optimization/110742] [14 Regression] cc1plus ICE "Floating point exception" during profiled bootstrap since commit g:08b99fe8ad6
  2023-07-19 15:47 [Bug c++/110742] New: [14 Regression] cc1plus ICE "Floating point exception" during profiled bootstrap since commit 08b99fe8ad6 thiago.bauermann at linaro dot org
                   ` (5 preceding siblings ...)
  2023-07-19 18:50 ` pinskia at gcc dot gnu.org
@ 2023-07-19 18:51 ` pinskia at gcc dot gnu.org
  2023-07-19 18:53 ` [Bug tree-optimization/110742] [14 Regression] cc1plus ICE "Floating point exception" during SLP and profiled bootstrap pinskia at gcc dot gnu.org
                   ` (8 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-07-19 18:51 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2023-07-19
               Host|armv8l-unknown-linux-gnueab |
                   |ihf                         |
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1

--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed.

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

* [Bug tree-optimization/110742] [14 Regression] cc1plus ICE "Floating point exception" during SLP and profiled bootstrap
  2023-07-19 15:47 [Bug c++/110742] New: [14 Regression] cc1plus ICE "Floating point exception" during profiled bootstrap since commit 08b99fe8ad6 thiago.bauermann at linaro dot org
                   ` (6 preceding siblings ...)
  2023-07-19 18:51 ` pinskia at gcc dot gnu.org
@ 2023-07-19 18:53 ` pinskia at gcc dot gnu.org
  2023-07-19 18:55 ` pinskia at gcc dot gnu.org
                   ` (7 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-07-19 18:53 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Removed reference to g:08b99fe8ad6 in the summary since the ICE is in SLP and
just happens to be compiling the code that was changed with g:08b99fe8ad6 .

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

* [Bug tree-optimization/110742] [14 Regression] cc1plus ICE "Floating point exception" during SLP and profiled bootstrap
  2023-07-19 15:47 [Bug c++/110742] New: [14 Regression] cc1plus ICE "Floating point exception" during profiled bootstrap since commit 08b99fe8ad6 thiago.bauermann at linaro dot org
                   ` (7 preceding siblings ...)
  2023-07-19 18:53 ` [Bug tree-optimization/110742] [14 Regression] cc1plus ICE "Floating point exception" during SLP and profiled bootstrap pinskia at gcc dot gnu.org
@ 2023-07-19 18:55 ` pinskia at gcc dot gnu.org
  2023-07-19 19:02 ` pinskia at gcc dot gnu.org
                   ` (6 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-07-19 18:55 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |14.0
      Known to work|                            |13.1.0

--- Comment #8 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Note my reduced testcase worked with GCC 13.1.0 so this is still a GCC 14
regression .

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

* [Bug tree-optimization/110742] [14 Regression] cc1plus ICE "Floating point exception" during SLP and profiled bootstrap
  2023-07-19 15:47 [Bug c++/110742] New: [14 Regression] cc1plus ICE "Floating point exception" during profiled bootstrap since commit 08b99fe8ad6 thiago.bauermann at linaro dot org
                   ` (8 preceding siblings ...)
  2023-07-19 18:55 ` pinskia at gcc dot gnu.org
@ 2023-07-19 19:02 ` pinskia at gcc dot gnu.org
  2023-07-19 21:19 ` thiago.bauermann at linaro dot org
                   ` (5 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-07-19 19:02 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Backtrace and some debug:
Program received signal SIGFPE, Arithmetic exception.
0x0000000001d00dd2 in multiple_p<unsigned long, unsigned int> (a=2, b=0) at
../../gcc/poly-int.h:2123
2123      return a % b == 0;
(gdb) bt
#0  0x0000000001d00dd2 in multiple_p<unsigned long, unsigned int> (a=2, b=0) at
../../gcc/poly-int.h:2123
#1  0x0000000001cf0c61 in vect_prologue_cost_for_slp (node=0x3a6a098,
cost_vec=0x7fffffffceb0) at ../../gcc/tree-vect-slp.cc:6088

(gdb) up
#1  0x0000000001cf0c61 in vect_prologue_cost_for_slp (node=0x3a6a098,
cost_vec=0x7fffffffceb0) at ../../gcc/tree-vect-slp.cc:6088
6088          && ! multiple_p (const_nunits, group_size))
(gdb) p group_size
$2 = 0
(gdb) p const_nunits
$3 = 2

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

* [Bug tree-optimization/110742] [14 Regression] cc1plus ICE "Floating point exception" during SLP and profiled bootstrap
  2023-07-19 15:47 [Bug c++/110742] New: [14 Regression] cc1plus ICE "Floating point exception" during profiled bootstrap since commit 08b99fe8ad6 thiago.bauermann at linaro dot org
                   ` (9 preceding siblings ...)
  2023-07-19 19:02 ` pinskia at gcc dot gnu.org
@ 2023-07-19 21:19 ` thiago.bauermann at linaro dot org
  2023-07-20 10:35 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: thiago.bauermann at linaro dot org @ 2023-07-19 21:19 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from Thiago Jung Bauermann <thiago.bauermann at linaro dot org> ---
Thank you very much for digging into this!

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

* [Bug tree-optimization/110742] [14 Regression] cc1plus ICE "Floating point exception" during SLP and profiled bootstrap
  2023-07-19 15:47 [Bug c++/110742] New: [14 Regression] cc1plus ICE "Floating point exception" during profiled bootstrap since commit 08b99fe8ad6 thiago.bauermann at linaro dot org
                   ` (10 preceding siblings ...)
  2023-07-19 21:19 ` thiago.bauermann at linaro dot org
@ 2023-07-20 10:35 ` rguenth at gcc dot gnu.org
  2023-07-20 11:08 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-07-20 10:35 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #11 from Richard Biener <rguenth at gcc dot gnu.org> ---
Huh.

t.ii:33:6: note: node (external) 0x3c91c88 (max_nunits=1, refcnt=2) vector(2)
long unsigned int
t.ii:33:6: note:        { }

and neither vec_stmts nor ->lanes.  Ah.  Looks like a latent issue in
vect_optimize_slp_pass::get_result_with_layout.

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

* [Bug tree-optimization/110742] [14 Regression] cc1plus ICE "Floating point exception" during SLP and profiled bootstrap
  2023-07-19 15:47 [Bug c++/110742] New: [14 Regression] cc1plus ICE "Floating point exception" during profiled bootstrap since commit 08b99fe8ad6 thiago.bauermann at linaro dot org
                   ` (11 preceding siblings ...)
  2023-07-20 10:35 ` rguenth at gcc dot gnu.org
@ 2023-07-20 11:08 ` rguenth at gcc dot gnu.org
  2023-07-21  7:29 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-07-20 11:08 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rsandifo at gcc dot gnu.org

--- Comment #12 from Richard Biener <rguenth at gcc dot gnu.org> ---
So we have those external def nodes for existing vectors in the IL.  Obviously
we cannot change the layout of those - where can we specify that?  I
see is_compatible_layout or change_layout_cost.  But start_choosing_layouts
already assigns layout 0 to it where I thought this would effectively
prevent changes?

Oddly in forward_pass we first have partition.layout == 0 && layout_i == 0
but still do stuff.

$38 = 0x3d8f690 = {{node_begin = 0, node_end = 1, layout = 0, in_degree = 0,
out_degree = 1}, {
    node_begin = 1, node_end = 2, layout = 1, in_degree = 1, out_degree = 0},
{node_begin = 2, 
    node_end = 3, layout = 2, in_degree = 0, out_degree = 0}}

later we ask if changing layout from 0 to 1 is OK.

I suppose the bug is in get_result_with_layout itself which assumes
changing vect_constant_def/vect_external_def is fine and thus pushes
the edge permute to the node?

I wonder if I fix that say with the following, if I also need to adjust
costs somewhere?

diff --git a/gcc/tree-vect-slp.cc b/gcc/tree-vect-slp.cc
index 693621ca990..1d79c77e8ce 100644
--- a/gcc/tree-vect-slp.cc
+++ b/gcc/tree-vect-slp.cc
@@ -5198,7 +5198,10 @@ vect_optimize_slp_pass::get_result_with_layout (slp_tree
node,
     return result;

   if (SLP_TREE_DEF_TYPE (node) == vect_constant_def
-      || SLP_TREE_DEF_TYPE (node) == vect_external_def)
+      || (SLP_TREE_DEF_TYPE (node) == vect_external_def
+         && (to_layout_i == 0
+             /* We can't permute vector defs.  */
+             || SLP_TREE_VEC_DEFS (node).is_empty ())))
     {
       /* If the vector is uniform or unchanged, there's nothing to do.  */
       if (to_layout_i == 0 || vect_slp_tree_uniform_p (node))

I'll also note that we do

          /* Handle externals and constants optimistically throughout.
             But treat existing vectors as fixed since we do not handle
             permuting them.  */
          unsigned int node_i = m_partitioned_nodes[rpo_i];
          auto &vertex = m_vertices[node_i];
          if ((SLP_TREE_DEF_TYPE (vertex.node) == vect_external_def
               && !SLP_TREE_VEC_DEFS (vertex.node).exists ())
              || SLP_TREE_DEF_TYPE (vertex.node) == vect_constant_def)
            vertex.partition = -1;

in create_partitions ().

I'm testing the above change now.

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

* [Bug tree-optimization/110742] [14 Regression] cc1plus ICE "Floating point exception" during SLP and profiled bootstrap
  2023-07-19 15:47 [Bug c++/110742] New: [14 Regression] cc1plus ICE "Floating point exception" during profiled bootstrap since commit 08b99fe8ad6 thiago.bauermann at linaro dot org
                   ` (12 preceding siblings ...)
  2023-07-20 11:08 ` rguenth at gcc dot gnu.org
@ 2023-07-21  7:29 ` cvs-commit at gcc dot gnu.org
  2023-07-21  7:29 ` rguenth at gcc dot gnu.org
  2023-07-21 21:35 ` thiago.bauermann at linaro dot org
  15 siblings, 0 replies; 17+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-07-21  7:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #13 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:9a8782e63790842d1bfa03e12eecf73c4aaeb1f8

commit r14-2697-g9a8782e63790842d1bfa03e12eecf73c4aaeb1f8
Author: Richard Biener <rguenther@suse.de>
Date:   Thu Jul 20 13:09:17 2023 +0200

    tree-optimization/110742 - fix latent issue with permuting existing vectors

    When we materialize a layout we push edge permutes to constant/external
    defs without checking we can actually do so.  For externals defined
    by vector stmts rather than scalar components we can't.

            PR tree-optimization/110742
            * tree-vect-slp.cc
(vect_optimize_slp_pass::get_result_with_layout):
            Do not materialize an edge permutation in an external node with
            vector defs.
            (vect_slp_analyze_node_operations_1): Guard purely internal
            nodes better.

            * g++.dg/torture/pr110742.C: New testcase.

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

* [Bug tree-optimization/110742] [14 Regression] cc1plus ICE "Floating point exception" during SLP and profiled bootstrap
  2023-07-19 15:47 [Bug c++/110742] New: [14 Regression] cc1plus ICE "Floating point exception" during profiled bootstrap since commit 08b99fe8ad6 thiago.bauermann at linaro dot org
                   ` (13 preceding siblings ...)
  2023-07-21  7:29 ` cvs-commit at gcc dot gnu.org
@ 2023-07-21  7:29 ` rguenth at gcc dot gnu.org
  2023-07-21 21:35 ` thiago.bauermann at linaro dot org
  15 siblings, 0 replies; 17+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-07-21  7:29 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #14 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed.

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

* [Bug tree-optimization/110742] [14 Regression] cc1plus ICE "Floating point exception" during SLP and profiled bootstrap
  2023-07-19 15:47 [Bug c++/110742] New: [14 Regression] cc1plus ICE "Floating point exception" during profiled bootstrap since commit 08b99fe8ad6 thiago.bauermann at linaro dot org
                   ` (14 preceding siblings ...)
  2023-07-21  7:29 ` rguenth at gcc dot gnu.org
@ 2023-07-21 21:35 ` thiago.bauermann at linaro dot org
  15 siblings, 0 replies; 17+ messages in thread
From: thiago.bauermann at linaro dot org @ 2023-07-21 21:35 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #15 from Thiago Jung Bauermann <thiago.bauermann at linaro dot org> ---
Thanks! I confirmed that I can't reproduce the problem anymore in trunk.

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

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

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-19 15:47 [Bug c++/110742] New: [14 Regression] cc1plus ICE "Floating point exception" during profiled bootstrap since commit 08b99fe8ad6 thiago.bauermann at linaro dot org
2023-07-19 15:50 ` [Bug c++/110742] " thiago.bauermann at linaro dot org
2023-07-19 16:09 ` [Bug rtl-optimization/110742] [14 Regression] cc1plus ICE "Floating point exception" during profiled bootstrap since commit g:08b99fe8ad6 pinskia at gcc dot gnu.org
2023-07-19 16:13 ` [Bug tree-optimization/110742] " pinskia at gcc dot gnu.org
2023-07-19 17:07 ` pinskia at gcc dot gnu.org
2023-07-19 17:12 ` pinskia at gcc dot gnu.org
2023-07-19 18:50 ` pinskia at gcc dot gnu.org
2023-07-19 18:51 ` pinskia at gcc dot gnu.org
2023-07-19 18:53 ` [Bug tree-optimization/110742] [14 Regression] cc1plus ICE "Floating point exception" during SLP and profiled bootstrap pinskia at gcc dot gnu.org
2023-07-19 18:55 ` pinskia at gcc dot gnu.org
2023-07-19 19:02 ` pinskia at gcc dot gnu.org
2023-07-19 21:19 ` thiago.bauermann at linaro dot org
2023-07-20 10:35 ` rguenth at gcc dot gnu.org
2023-07-20 11:08 ` rguenth at gcc dot gnu.org
2023-07-21  7:29 ` cvs-commit at gcc dot gnu.org
2023-07-21  7:29 ` rguenth at gcc dot gnu.org
2023-07-21 21:35 ` thiago.bauermann at linaro dot 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).