[Bug c/117425] Miscompile with different optimization flags

2024-11-02 Thread yunboni at smail dot nju.edu.cn via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117425 --- Comment #6 from Yunbo Ni --- (In reply to Andrew Pinski from comment #5) > A good resource for sequence points is https://c-faq.com/expr/seqpoints.html > . Thanks for your detailed explanation! I'll check it out.

[Bug c/117425] Miscompile with different optimization flags

2024-11-02 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117425 --- Comment #5 from Andrew Pinski --- A good resource for sequence points is https://c-faq.com/expr/seqpoints.html .

[Bug c/117425] Miscompile with different optimization flags

2024-11-02 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117425 --- Comment #4 from Andrew Pinski --- That is: ``` e() ; ((*c = 0, 0) || 0); ``` vs: ``` ((*c = 0, 0) || 0); e() ; ``` GCC has a warning for sequence points (-Wsequence-point) but this one is hard to figure out since e() depends on th

[Bug c/117425] Miscompile with different optimization flags

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

[Bug c/117425] Miscompile with different optimization flags

2024-11-02 Thread yunboni at smail dot nju.edu.cn via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117425 --- Comment #2 from Yunbo Ni --- (In reply to Sam James from comment #1) > (In reply to Yunbo Ni from comment #0) > > The version is gcc 4.7.3. > > When you say this, do you mean that is the first version you saw it on? Sorry for the misunders

[Bug c/117425] Miscompile with different optimization flags

2024-11-02 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117425 Sam James changed: What|Removed |Added CC||sjames at gcc dot gnu.org --- Comment #1 fr