[Bug c/116690] Miscompile with different optimization flags

2024-09-12 Thread vincent-gcc at vinc17 dot net via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116690 Vincent Lefèvre changed: What|Removed |Added CC||vincent-gcc at vinc17 dot net --- Com

[Bug c/116690] Miscompile with different optimization flags

2024-09-11 Thread xry111 at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116690 Xi Ruoyao changed: What|Removed |Added CC||xry111 at gcc dot gnu.org --- Comment #7 fr

[Bug c/116690] Miscompile with different optimization flags

2024-09-11 Thread yunboni at smail dot nju.edu.cn via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116690 --- Comment #6 from Yunbo Ni --- (In reply to Andrew Pinski from comment #5) > (In reply to Yunbo Ni from comment #4) > > Thanks for your kind and detailed explanation! BTW, when I change the value > > of b to 1 in line 3 and compiled this code

[Bug c/116690] Miscompile with different optimization flags

2024-09-11 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116690 --- Comment #5 from Andrew Pinski --- (In reply to Yunbo Ni from comment #4) > Thanks for your kind and detailed explanation! BTW, when I change the value > of b to 1 in line 3 and compiled this code with -O0 flag, it gets killed > with with pro

[Bug c/116690] Miscompile with different optimization flags

2024-09-11 Thread yunboni at smail dot nju.edu.cn via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116690 --- Comment #4 from Yunbo Ni --- (In reply to Andrew Pinski from comment #3) > Note in C++, it is undefined at the point of return in a rather than > afterwards. > > Also note PR 104690 is filed about catching this with -fsanitize=undefined. >

[Bug c/116690] Miscompile with different optimization flags

2024-09-11 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116690 Andrew Pinski changed: What|Removed |Added See Also||https://gcc.gnu.org/bugzill

[Bug c/116690] Miscompile with different optimization flags

2024-09-11 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116690 Andrew Pinski changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[Bug c/116690] Miscompile with different optimization flags

2024-09-11 Thread yunboni at smail dot nju.edu.cn via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116690 --- Comment #1 from Yunbo Ni --- (In reply to Yunbo Ni from comment #0) > Created attachment 59101 [details] > The preprocessed file when using -O2 > > When I compiled this code with -O0 and -O2 flags, its outputs were different: > > ```c > #i