[Bug middle-end/109057] Does GCC interpret assembly when deciding to optimize away a variable?

2023-03-07 Thread hbucher at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109057 --- Comment #9 from Henry --- Just to make it clear, I'm not saying this is a bug on GCC. Im just trying to understand what is happening since this is affecting some of our benchmarks. Then we can counter with some wit. Perhaps there is an a

[Bug middle-end/109057] Does GCC interpret assembly when deciding to optimize away a variable?

2023-03-07 Thread hbucher at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109057 --- Comment #6 from Henry --- Still, why is it then if you change the type to uint32_t the behavior changes? And why the entire static array is cut out from the object file?

[Bug middle-end/109057] Does GCC interpret assembly when deciding to optimize away a variable?

2023-03-07 Thread hbucher at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109057 --- Comment #4 from Henry --- Yes it is optimized away. Note that even in this case the entire static array is optimized away from the object file.

[Bug middle-end/109057] Does GCC interpret assembly when deciding to optimize away a variable?

2023-03-07 Thread hbucher at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109057 --- Comment #1 from Henry --- Two caveats: 1. If you add something like `xor %0,%0` inside the assembly text, LUT is not optimized inline void DoNotOptimize( uint8_t value) { asm volatile("xor %0,%0" : : "r,m"(value) : "memory"); } void fun

[Bug c++/109057] New: Does GCC interpret assembly when deciding to optimize away a variable?

2023-03-07 Thread hbucher at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109057 Bug ID: 109057 Summary: Does GCC interpret assembly when deciding to optimize away a variable? Product: gcc Version: unknown Status: UNCONFIRMED Severity: norm

[Bug c++/109047] New: Harmonize __attribute__((target_clones)) requirement in function prototype

2023-03-06 Thread hbucher at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109047 Bug ID: 109047 Summary: Harmonize __attribute__((target_clones)) requirement in function prototype Product: gcc Version: unknown Status: UNCONFIRMED Severity:

[Bug libstdc++/106469] Undefined behavior triggered on Mersenne Twister engine due to unsigned integer overflow

2022-07-29 Thread hbucher at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106469 --- Comment #6 from Henry --- > This sanitizer is stupid. That is an unjust comment on great work from the LLVM team. An unsigned overflow in user code is almost always a bug due to some oversight, there is no denying that. Look at Arianne 5 f

[Bug libstdc++/106469] Undefined behavior triggered on Mersenne Twister engine due to unsigned integer overflow

2022-07-28 Thread hbucher at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106469 --- Comment #3 from Henry --- I agree that technically it is not UB. However I still think it is bad practice. So far that single line is the only place in all libstdc++ that triggers that undefined. I cannot believe that a developer conscio

[Bug libstdc++/106469] New: Undefined behavior triggered on Mersenne Twister engine due to unsigned integer overflow

2022-07-28 Thread hbucher at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106469 Bug ID: 106469 Summary: Undefined behavior triggered on Mersenne Twister engine due to unsigned integer overflow Product: gcc Version: 13.0 Status: UNCONFIRMED