public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/115191] New: [15 regression] ICE when building stklos (in verify_range, at value-range.cc:1526)
@ 2024-05-22 14:40 sjames at gcc dot gnu.org
  2024-05-22 14:41 ` [Bug tree-optimization/115191] " sjames at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: sjames at gcc dot gnu.org @ 2024-05-22 14:40 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 115191
           Summary: [15 regression] ICE when building stklos (in
                    verify_range, at value-range.cc:1526)
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sjames at gcc dot gnu.org
                CC: aldyh at gcc dot gnu.org
  Target Milestone: ---

```
$ x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I.   -DPCRE2POSIX_SHARED 
-I/usr/lib64/libffi/include    -O2 -c -o socket.o socket.c
during GIMPLE pass: phiopt
In file included from socket.c:34:
socket.c: In function ‘STk_socket_accept’:
stklos.h:282:18: internal compiler error: in verify_range, at
value-range.cc:1526
  282 |   SCM CPP_CONCAT(STk_, _cname) _params
      |                  ^~~~
stklos.h:92:33: note: in definition of macro ‘CPP_CONCAT’
   92 | #define CPP_CONCAT(x, y)        x##y
      |                                 ^
socket.c:434:1: note: in expansion of macro ‘DEFINE_PRIMITIVE’
  434 | DEFINE_PRIMITIVE("socket-accept", socket_accept, subr12,
      | ^~~~~~~~~~~~~~~~
0x55d4f104ac8b irange::verify_range()
       
/usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/value-range.cc:1526
0x55d4f23b0da2 global_range_query::range_of_expr(vrange&, tree_node*, gimple*)
       
/usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/value-query.cc:436
0x55d4f21f9e12 value_replacement
       
/usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/tree-ssa-phiopt.cc:1330
0x55d4f21fb64a execute
       
/usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/tree-ssa-phiopt.cc:4265
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/x86_64-pc-linux-gnu/15/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with:
/var/tmp/portage/sys-devel/gcc-15.0.9999/work/gcc-15.0.9999/configure
--host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr
--bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/15
--includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/15/include
--datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/15
--mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/15/man
--infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/15/info
--with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15
--disable-silent-rules --disable-dependency-tracking
--with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/15/python
--enable-languages=c,c++,fortran,rust --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
15.0.9999 p, commit bc7d81fe2f725b4043ce8b9ffb11d80032ce3f75'
--with-gcc-major-version-only --enable-libstdcxx-time --enable-lto
--disable-libstdcxx-pch --enable-shared --enable-threads=posix
--enable-__cxa_atexit --enable-clocale=gnu --enable-multilib
--with-multilib-list=m32,m64 --disable-fixed-point --enable-targets=all
--enable-libgomp --disable-libssp --disable-libada --disable-cet
--disable-systemtap --enable-valgrind-annotations --disable-vtable-verify
--disable-libvtv --with-zstd --with-isl --disable-isl-version-check
--enable-default-pie --enable-host-pie --enable-host-bind-now
--enable-default-ssp --disable-fixincludes --with-build-config=bootstrap-O3
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.0.0 20240522 (experimental)
73a167cfa225d5ee7092d41596b9fea1719898ff (Gentoo Hardened 15.0.9999 p, commit
bc7d81fe2f725b4043ce8b9ffb11d80032ce3f75)
```

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

* [Bug tree-optimization/115191] [15 regression] ICE when building stklos (in verify_range, at value-range.cc:1526)
  2024-05-22 14:40 [Bug tree-optimization/115191] New: [15 regression] ICE when building stklos (in verify_range, at value-range.cc:1526) sjames at gcc dot gnu.org
@ 2024-05-22 14:41 ` sjames at gcc dot gnu.org
  2024-05-22 14:46 ` sjames at gcc dot gnu.org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: sjames at gcc dot gnu.org @ 2024-05-22 14:41 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Sam James <sjames at gcc dot gnu.org> ---
Created attachment 58267
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58267&action=edit
socket.i

I'm reducing.

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

* [Bug tree-optimization/115191] [15 regression] ICE when building stklos (in verify_range, at value-range.cc:1526)
  2024-05-22 14:40 [Bug tree-optimization/115191] New: [15 regression] ICE when building stklos (in verify_range, at value-range.cc:1526) sjames at gcc dot gnu.org
  2024-05-22 14:41 ` [Bug tree-optimization/115191] " sjames at gcc dot gnu.org
@ 2024-05-22 14:46 ` sjames at gcc dot gnu.org
  2024-05-22 15:09 ` sjames at gcc dot gnu.org
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: sjames at gcc dot gnu.org @ 2024-05-22 14:46 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Sam James <sjames at gcc dot gnu.org> ---
Just -O1 is enough.

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

* [Bug tree-optimization/115191] [15 regression] ICE when building stklos (in verify_range, at value-range.cc:1526)
  2024-05-22 14:40 [Bug tree-optimization/115191] New: [15 regression] ICE when building stklos (in verify_range, at value-range.cc:1526) sjames at gcc dot gnu.org
  2024-05-22 14:41 ` [Bug tree-optimization/115191] " sjames at gcc dot gnu.org
  2024-05-22 14:46 ` sjames at gcc dot gnu.org
@ 2024-05-22 15:09 ` sjames at gcc dot gnu.org
  2024-05-22 18:36 ` pinskia at gcc dot gnu.org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: sjames at gcc dot gnu.org @ 2024-05-22 15:09 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Sam James <sjames at gcc dot gnu.org> ---
```
typedef void *SCM;
void set_socket_io_ports();
void STk_socket_accept(SCM line_buffered) {
  if (!line_buffered)
    line_buffered = (SCM)3;
  set_socket_io_ports(line_buffered != 1);
}
```

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

* [Bug tree-optimization/115191] [15 regression] ICE when building stklos (in verify_range, at value-range.cc:1526)
  2024-05-22 14:40 [Bug tree-optimization/115191] New: [15 regression] ICE when building stklos (in verify_range, at value-range.cc:1526) sjames at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2024-05-22 15:09 ` sjames at gcc dot gnu.org
@ 2024-05-22 18:36 ` pinskia at gcc dot gnu.org
  2024-05-22 20:31 ` pinskia at gcc dot gnu.org
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-05-22 18:36 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code
   Target Milestone|---                         |15.0
            Version|unknown                     |15.0

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

* [Bug tree-optimization/115191] [15 regression] ICE when building stklos (in verify_range, at value-range.cc:1526)
  2024-05-22 14:40 [Bug tree-optimization/115191] New: [15 regression] ICE when building stklos (in verify_range, at value-range.cc:1526) sjames at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2024-05-22 18:36 ` pinskia at gcc dot gnu.org
@ 2024-05-22 20:31 ` pinskia at gcc dot gnu.org
  2024-05-22 20:35 ` aldyh at gcc dot gnu.org
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-05-22 20:31 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2024-05-22

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

                      /* After the optimization PHI result can have value
                         which it couldn't have previously.  */
                      int_range_max r;
                      if (get_global_range_query ()->range_of_expr (r, phires,
                                                                    phi))


Yes int_range_max here is almost definitely wrong for pointer types.
Note this code is originally from r13-4878-g3d6bb832022160 .

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

* [Bug tree-optimization/115191] [15 regression] ICE when building stklos (in verify_range, at value-range.cc:1526)
  2024-05-22 14:40 [Bug tree-optimization/115191] New: [15 regression] ICE when building stklos (in verify_range, at value-range.cc:1526) sjames at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2024-05-22 20:31 ` pinskia at gcc dot gnu.org
@ 2024-05-22 20:35 ` aldyh at gcc dot gnu.org
  2024-05-22 20:36 ` aldyh at gcc dot gnu.org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: aldyh at gcc dot gnu.org @ 2024-05-22 20:35 UTC (permalink / raw)
  To: gcc-bugs

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

Aldy Hernandez <aldyh at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |aldyh at gcc dot gnu.org
            Summary|[15 regression] ICE when    |[15 regression] ICE when
                   |building stklos in          |building stklos (in
                   |verify_range due to         |verify_range, at
                   |phiopt's value_replacement  |value-range.cc:1526)
   Last reconfirmed|2024-05-22 00:00:00         |

--- Comment #5 from Aldy Hernandez <aldyh at gcc dot gnu.org> ---
Mine.

Phiopt is using int_range_max for a range that could be either an int or a
pointer.

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

* [Bug tree-optimization/115191] [15 regression] ICE when building stklos (in verify_range, at value-range.cc:1526)
  2024-05-22 14:40 [Bug tree-optimization/115191] New: [15 regression] ICE when building stklos (in verify_range, at value-range.cc:1526) sjames at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2024-05-22 20:35 ` aldyh at gcc dot gnu.org
@ 2024-05-22 20:36 ` aldyh at gcc dot gnu.org
  2024-05-22 20:36 ` aldyh at gcc dot gnu.org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: aldyh at gcc dot gnu.org @ 2024-05-22 20:36 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Aldy Hernandez <aldyh at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #4)
> Confirmed.
> 
>                       /* After the optimization PHI result can have value
>                          which it couldn't have previously.  */
>                       int_range_max r;
>                       if (get_global_range_query ()->range_of_expr (r,
> phires,
>                                                                     phi))
> 
> 
> Yes int_range_max here is almost definitely wrong for pointer types.
> Note this code is originally from r13-4878-g3d6bb832022160 .

Exactly.  Assuming r could be either an integer or a pointer, that should be
Value_Range which is type agnostic.

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

* [Bug tree-optimization/115191] [15 regression] ICE when building stklos (in verify_range, at value-range.cc:1526)
  2024-05-22 14:40 [Bug tree-optimization/115191] New: [15 regression] ICE when building stklos (in verify_range, at value-range.cc:1526) sjames at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2024-05-22 20:36 ` aldyh at gcc dot gnu.org
@ 2024-05-22 20:36 ` aldyh at gcc dot gnu.org
  2024-05-22 20:48 ` sjames at gcc dot gnu.org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: aldyh at gcc dot gnu.org @ 2024-05-22 20:36 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Aldy Hernandez <aldyh at gcc dot gnu.org> ---
Created attachment 58272
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58272&action=edit
patch in testing

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

* [Bug tree-optimization/115191] [15 regression] ICE when building stklos (in verify_range, at value-range.cc:1526)
  2024-05-22 14:40 [Bug tree-optimization/115191] New: [15 regression] ICE when building stklos (in verify_range, at value-range.cc:1526) sjames at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2024-05-22 20:36 ` aldyh at gcc dot gnu.org
@ 2024-05-22 20:48 ` sjames at gcc dot gnu.org
  2024-05-23  6:15 ` cvs-commit at gcc dot gnu.org
  2024-05-23  6:16 ` aldyh at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: sjames at gcc dot gnu.org @ 2024-05-22 20:48 UTC (permalink / raw)
  To: gcc-bugs

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

Sam James <sjames at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED

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

* [Bug tree-optimization/115191] [15 regression] ICE when building stklos (in verify_range, at value-range.cc:1526)
  2024-05-22 14:40 [Bug tree-optimization/115191] New: [15 regression] ICE when building stklos (in verify_range, at value-range.cc:1526) sjames at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2024-05-22 20:48 ` sjames at gcc dot gnu.org
@ 2024-05-23  6:15 ` cvs-commit at gcc dot gnu.org
  2024-05-23  6:16 ` aldyh at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-05-23  6:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Aldy Hernandez <aldyh@gcc.gnu.org>:

https://gcc.gnu.org/g:35a293a6454ac0cd88735036f536d8f4ec65951a

commit r15-785-g35a293a6454ac0cd88735036f536d8f4ec65951a
Author: Aldy Hernandez <aldyh@redhat.com>
Date:   Wed May 22 22:32:57 2024 +0200

    [prange] Use type agnostic range in phiopt [PR115191]

    Fix a use of int_range_max in phiopt that should be a type agnostic
    range, because it could be either a pointer or an int.

            PR tree-optimization/115191

    gcc/ChangeLog:

            * tree-ssa-phiopt.cc (value_replacement): Use Value_Range instead
            of int_range_max.

    gcc/testsuite/ChangeLog:

            * gcc.dg/tree-ssa/pr115191.c: New test.

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

* [Bug tree-optimization/115191] [15 regression] ICE when building stklos (in verify_range, at value-range.cc:1526)
  2024-05-22 14:40 [Bug tree-optimization/115191] New: [15 regression] ICE when building stklos (in verify_range, at value-range.cc:1526) sjames at gcc dot gnu.org
                   ` (9 preceding siblings ...)
  2024-05-23  6:15 ` cvs-commit at gcc dot gnu.org
@ 2024-05-23  6:16 ` aldyh at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: aldyh at gcc dot gnu.org @ 2024-05-23  6:16 UTC (permalink / raw)
  To: gcc-bugs

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

Aldy Hernandez <aldyh at gcc dot gnu.org> changed:

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

--- Comment #9 from Aldy Hernandez <aldyh at gcc dot gnu.org> ---
Fixed.

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

end of thread, other threads:[~2024-05-23  6:16 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-22 14:40 [Bug tree-optimization/115191] New: [15 regression] ICE when building stklos (in verify_range, at value-range.cc:1526) sjames at gcc dot gnu.org
2024-05-22 14:41 ` [Bug tree-optimization/115191] " sjames at gcc dot gnu.org
2024-05-22 14:46 ` sjames at gcc dot gnu.org
2024-05-22 15:09 ` sjames at gcc dot gnu.org
2024-05-22 18:36 ` pinskia at gcc dot gnu.org
2024-05-22 20:31 ` pinskia at gcc dot gnu.org
2024-05-22 20:35 ` aldyh at gcc dot gnu.org
2024-05-22 20:36 ` aldyh at gcc dot gnu.org
2024-05-22 20:36 ` aldyh at gcc dot gnu.org
2024-05-22 20:48 ` sjames at gcc dot gnu.org
2024-05-23  6:15 ` cvs-commit at gcc dot gnu.org
2024-05-23  6:16 ` aldyh 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).