[Bug lto/105727] __builtin_constant_p expansion in LTO

2024-10-02 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105727 Andrew Pinski changed: What|Removed |Added CC||jwerner at chromium dot org --- Comment

[Bug lto/105727] __builtin_constant_p expansion in LTO

2022-05-26 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105727 --- Comment #16 from Jakub Jelinek --- That may be true, but I think only the 1/2/4/8/16 sizes are interesting to handle with special code. And as the function is provably called by a function which can have any size and through LTO can get a co

[Bug lto/105727] __builtin_constant_p expansion in LTO

2022-05-26 Thread hubicka at kam dot mff.cuni.cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105727 --- Comment #15 from hubicka at kam dot mff.cuni.cz --- > No, see c#10. I know it will work if BUILD_BUG call is removed. However the only reason I can see why original author put it there is that he/she wanted to write special case checkers for

[Bug lto/105727] __builtin_constant_p expansion in LTO

2022-05-26 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105727 --- Comment #14 from Martin Liška --- (In reply to Martin Liška from comment #13) > > To me it looked like a protection that size is not going to be large > > (or perhaps author wants to add extra special cases as they are needed) > > No, see c

[Bug lto/105727] __builtin_constant_p expansion in LTO

2022-05-26 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105727 --- Comment #13 from Martin Liška --- > To me it looked like a protection that size is not going to be large > (or perhaps author wants to add extra special cases as they are needed) No, see c#10.

[Bug lto/105727] __builtin_constant_p expansion in LTO

2022-05-25 Thread hubicka at kam dot mff.cuni.cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105727 --- Comment #12 from hubicka at kam dot mff.cuni.cz --- > > My guess is that the > > BUILD_BUG(); > > line is the sole thing that is wrong, it should be just break; > > as the memory_is_poisoned_n(addr, size); will handle all the sizes, > > regar

Re: [Bug lto/105727] __builtin_constant_p expansion in LTO

2022-05-25 Thread Jan Hubicka via Gcc-bugs
> > My guess is that the > > BUILD_BUG(); > > line is the sole thing that is wrong, it should be just break; > > as the memory_is_poisoned_n(addr, size); will handle all the sizes, > > regardless if they are constants or not. > > Sure, I'm going to suggest such a change. To me it looked like a pro

[Bug lto/105727] __builtin_constant_p expansion in LTO

2022-05-25 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105727 --- Comment #11 from Martin Liška --- (In reply to Jakub Jelinek from comment #10) > My guess is that the > BUILD_BUG(); > line is the sole thing that is wrong, it should be just break; > as the memory_is_poisoned_n(addr, size); will handle all

[Bug lto/105727] __builtin_constant_p expansion in LTO

2022-05-25 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105727 --- Comment #10 from Jakub Jelinek --- My guess is that the BUILD_BUG(); line is the sole thing that is wrong, it should be just break; as the memory_is_poisoned_n(addr, size); will handle all the sizes, regardless if they are constants or not.

[Bug lto/105727] __builtin_constant_p expansion in LTO

2022-05-25 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105727 --- Comment #9 from Martin Liška --- > Sure, we might not inline or ipa cp/vrp all of them... That's the explanation as bool kasan_check_range(unsigned long addr, size_t size, bool write, unsigned long

[Bug lto/105727] __builtin_constant_p expansion in LTO

2022-05-25 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105727 Jakub Jelinek changed: What|Removed |Added CC||jakub at gcc dot gnu.org --- Comment #8

[Bug lto/105727] __builtin_constant_p expansion in LTO

2022-05-25 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105727 --- Comment #7 from Martin Liška --- (In reply to Jan Hubicka from comment #6) > I don't know what clang does, but GCC keeps builtin_constant_p till late > optimization and resolves it then. So here we cross module inline (or > constant propagat

[Bug lto/105727] __builtin_constant_p expansion in LTO

2022-05-25 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105727 --- Comment #6 from Jan Hubicka --- I don't know what clang does, but GCC keeps builtin_constant_p till late optimization and resolves it then. So here we cross module inline (or constant propagate) and then it becomes constant. Outcome of __bu

[Bug lto/105727] __builtin_constant_p expansion in LTO

2022-05-25 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105727 Martin Liška changed: What|Removed |Added Resolution|--- |INVALID Status|WAITING

[Bug lto/105727] __builtin_constant_p expansion in LTO

2022-05-25 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105727 --- Comment #4 from Jakub Jelinek --- I don't see anything wrong on it. If memory_is_poisoned is inlined into main, size is constant, if memory_is_poisoned is cloned and ipa-cp or ipa-vrp optimized, likewise.

[Bug lto/105727] __builtin_constant_p expansion in LTO

2022-05-25 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105727 Andrew Pinski changed: What|Removed |Added Status|NEW |WAITING --- Comment #3 from Andrew Pins

[Bug lto/105727] __builtin_constant_p expansion in LTO

2022-05-25 Thread fw at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105727 Florian Weimer changed: What|Removed |Added CC||fw at gcc dot gnu.org --- Comment #2 f

[Bug lto/105727] __builtin_constant_p expansion in LTO

2022-05-25 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105727 Martin Liška changed: What|Removed |Added Ever confirmed|0 |1 See Also|