[Bug tree-optimization/115191] [15 regression] ICE when building stklos (in verify_range, at value-range.cc:1526)

2024-05-22 Thread aldyh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115191

Aldy Hernandez  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED

--- Comment #9 from Aldy Hernandez  ---
Fixed.

[Bug tree-optimization/115191] [15 regression] ICE when building stklos (in verify_range, at value-range.cc:1526)

2024-05-22 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115191

--- Comment #8 from GCC Commits  ---
The master branch has been updated by Aldy Hernandez :

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

commit r15-785-g35a293a6454ac0cd88735036f536d8f4ec65951a
Author: Aldy Hernandez 
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.

[Bug tree-optimization/115191] [15 regression] ICE when building stklos (in verify_range, at value-range.cc:1526)

2024-05-22 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115191

Sam James  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED

[Bug tree-optimization/115191] [15 regression] ICE when building stklos (in verify_range, at value-range.cc:1526)

2024-05-22 Thread aldyh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115191

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

[Bug tree-optimization/115191] [15 regression] ICE when building stklos (in verify_range, at value-range.cc:1526)

2024-05-22 Thread aldyh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115191

--- Comment #6 from Aldy Hernandez  ---
(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.

[Bug tree-optimization/115191] [15 regression] ICE when building stklos (in verify_range, at value-range.cc:1526)

2024-05-22 Thread aldyh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115191

Aldy Hernandez  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  ---
Mine.

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

[Bug tree-optimization/115191] [15 regression] ICE when building stklos (in verify_range, at value-range.cc:1526)

2024-05-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115191

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #4 from Andrew Pinski  ---
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 .

[Bug tree-optimization/115191] [15 regression] ICE when building stklos (in verify_range, at value-range.cc:1526)

2024-05-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115191

Andrew Pinski  changed:

   What|Removed |Added

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

[Bug tree-optimization/115191] [15 regression] ICE when building stklos (in verify_range, at value-range.cc:1526)

2024-05-22 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115191

--- Comment #3 from Sam James  ---
```
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);
}
```

[Bug tree-optimization/115191] [15 regression] ICE when building stklos (in verify_range, at value-range.cc:1526)

2024-05-22 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115191

--- Comment #2 from Sam James  ---
Just -O1 is enough.

[Bug tree-optimization/115191] [15 regression] ICE when building stklos (in verify_range, at value-range.cc:1526)

2024-05-22 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115191

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

I'm reducing.