[Bug sanitizer/120471] -fsanitize=undefined causes read of uninitialized variable when accessing element in an array at -O0 level

2025-05-29 Thread xiaohuba2021 at 163 dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120471 --- Comment #4 from xiaohuba2021 --- (In reply to Xi Ruoyao from comment #2) > I cannot reproduce it locally, nor on godbolt: > https://godbolt.org/z/rxf8Es1n5. switch the language to c++ successfully reproduce it: https://godbolt.org/z/z6WhKKa

[Bug sanitizer/120471] -fsanitize=undefined causes read of uninitialized variable when accessing element in an array at -O0 level

2025-05-29 Thread xiaohuba2021 at 163 dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120471 --- Comment #1 from xiaohuba2021 --- sorry, there is a blank line on the top of the source code. so line 5 should actually be `volatile int v = (ll % 2 ? b : ib)[c % 3];`

[Bug sanitizer/120471] New: -fsanitize=undefined causes read of uninitialized variable when accessing element in an array at -O0 level

2025-05-29 Thread xiaohuba2021 at 163 dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120471 Bug ID: 120471 Summary: -fsanitize=undefined causes read of uninitialized variable when accessing element in an array at -O0 level Product: gcc Version: 15.1.0

[Bug rtl-optimization/119846] New: function returning vla causes ICE

2025-04-17 Thread xiaohuba2021 at 163 dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119846 Bug ID: 119846 Summary: function returning vla causes ICE Product: gcc Version: 15.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: rtl-optimizati

[Bug c++/118726] GCC generates wrong code when using non-structured binding declaration as the condition of a for-loop at O2 level

2025-02-01 Thread xiaohuba2021 at 163 dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118726 --- Comment #2 from xiaohuba2021 --- There is a typo in the code mentioned above. The correct version is: ``` #include int main() { volatile int x = 10; for (int l = 1; int d = x - l; l = d + 1) { int &z = d; std::cout

[Bug c++/118726] GCC generates wrong code when using non-structured binding declaration as the condition of a for-loop at O2 level

2025-02-01 Thread xiaohuba2021 at 163 dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118726 --- Comment #1 from xiaohuba2021 --- upd: the code does not crash, but is killed due to a timeout.

[Bug c++/118726] New: GCC generates wrong code when using non-structured binding declaration as the condition of a for-loop at O2 level

2025-02-01 Thread xiaohuba2021 at 163 dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118726 Bug ID: 118726 Summary: GCC generates wrong code when using non-structured binding declaration as the condition of a for-loop at O2 level Product: gcc Version: 1

[Bug tree-optimization/117448] New: gcc failed to optimize dividing to subtracting with simple assumption

2024-11-05 Thread xiaohuba2021 at 163 dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117448 Bug ID: 117448 Summary: gcc failed to optimize dividing to subtracting with simple assumption Product: gcc Version: 15.0 Status: UNCONFIRMED Severity: normal

[Bug tree-optimization/116742] -Wuninitialized failed to issue uninitialized variable

2024-09-22 Thread xiaohuba2021 at 163 dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116742 --- Comment #3 from xiaohuba2021 --- So is there any workaround or patch?

[Bug tree-optimization/116765] New: gcc generate wrong code with -O3 -march=skylake

2024-09-18 Thread xiaohuba2021 at 163 dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116765 Bug ID: 116765 Summary: gcc generate wrong code with -O3 -march=skylake Product: gcc Version: 15.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component:

[Bug tree-optimization/116765] gcc generate wrong code with -O3 -march=skylake

2024-09-18 Thread xiaohuba2021 at 163 dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116765 --- Comment #1 from xiaohuba2021 --- godbolt link: https://godbolt.org/z/4vTjcdhv5

[Bug c++/116742] New: -Wuninitialized failed to issue uninitialized variable

2024-09-16 Thread xiaohuba2021 at 163 dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116742 Bug ID: 116742 Summary: -Wuninitialized failed to issue uninitialized variable Product: gcc Version: 15.0 Status: UNCONFIRMED Severity: normal Priority: P3 Comp

[Bug c++/116459] gcc 12.2.0 optimized out functions which has observable side affect

2024-08-22 Thread xiaohuba2021 at 163 dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116459 --- Comment #7 from xiaohuba2021 --- Created attachment 58975 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58975&action=edit The miscompiled program

[Bug c++/116459] gcc 12.2.0 optimized out functions which has observable side affect

2024-08-22 Thread xiaohuba2021 at 163 dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116459 --- Comment #4 from xiaohuba2021 --- Yes, it seems that only 12.1 and 12.2 are affected. But I wonder what's the cause of it, and are there any patches for it?

[Bug c++/116459] gcc 12.2.0 optimized out functions which has observable side affect

2024-08-22 Thread xiaohuba2021 at 163 dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116459 --- Comment #2 from xiaohuba2021 --- > Uncomment line 20 (mask = 1) or explicitly add operator= for struct Matrix > solves this problem. sorry, the code above produces the correct answer, since line 20 is uncommented. Comment it and it will ou

[Bug c++/116459] gcc 12.0 optimized out functions which has observable side affect

2024-08-22 Thread xiaohuba2021 at 163 dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116459 xiaohuba2021 changed: What|Removed |Added CC||xiaohuba2021 at 163 dot com --- Comment

[Bug c++/116459] New: gcc 12.0 optimized out functions which has observable side affect

2024-08-22 Thread xiaohuba2021 at 163 dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116459 Bug ID: 116459 Summary: gcc 12.0 optimized out functions which has observable side affect Product: gcc Version: 12.2.0 Status: UNCONFIRMED Severity: normal