[Bug tree-optimization/112949] evrp produces incorrect range for __builtin_clz

2023-12-10 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112949 --- Comment #7 from Andrew Pinski --- Specifically https://gcc.gnu.org/bugzilla/show_bug.cgi?id=32455#c4 .

[Bug tree-optimization/112949] evrp produces incorrect range for __builtin_clz

2023-12-10 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112949 Andrew Pinski changed: What|Removed |Added See Also||https://gcc.gnu.org/bugzill

[Bug tree-optimization/112949] evrp produces incorrect range for __builtin_clz

2023-12-10 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112949 --- Comment #5 from Andrew Pinski --- Oh the definition of __builtin_clz does not have return value so the value is undefined to begin with.

[Bug tree-optimization/112949] evrp produces incorrect range for __builtin_clz

2023-12-10 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112949 Andrew Pinski changed: What|Removed |Added Resolution|--- |INVALID Status|UNCONFIRMED

[Bug tree-optimization/112949] evrp produces incorrect range for __builtin_clz

2023-12-10 Thread kristerw at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112949 --- Comment #3 from Krister Walfridsson --- The C program is obviously UB. But the optimization is done on GIMPLE, and it is not obvious to me that the GIMPLE code is UB -- we have a function called __builtin_clz that calls an internal

[Bug tree-optimization/112949] evrp produces incorrect range for __builtin_clz

2023-12-10 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112949 --- Comment #2 from Andrew Pinski --- defining __builtin_clz makes this code undefined. Especially when it comes to calling itself. That is the ranges here are ok and correct but rather the usage is undefined. gcc.dg/pr100521.c is just

[Bug tree-optimization/112949] evrp produces incorrect range for __builtin_clz

2023-12-10 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112949 --- Comment #1 from Andrew Pinski --- I think the testcase is broken rather than anything else.