[Bug c/39121] strange behavior in chained operations

2015-08-09 Thread frankhb1989 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=39121 frankhb1989 at gmail dot com changed: What|Removed |Added CC||frankhb1989 at gmail dot co

[Bug c/39121] strange behavior in chained operations

2015-06-25 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=39121 Manuel López-Ibáñez changed: What|Removed |Added CC||manu at gcc dot gnu.org --- Commen

[Bug c/39121] strange behavior in chained operations

2015-06-25 Thread joe.carnuccio at qlogic dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=39121 --- Comment #7 from joe.carnuccio at qlogic dot com --- Ok, the sequence points are at each of the assignment operators. The crux of this is that doing the xor chain with dereferenced pointers fails (incorrect execution), whereas doing it with va

[Bug c/39121] strange behavior in chained operations

2015-06-25 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=39121 --- Comment #6 from Andrew Pinski --- (In reply to joe.carnuccio from comment #5) > Since using gcc -Os causes the correct execution, then "sequence point" does > not have anything to do with it. And you are wrong about that. -Os causes what yo

[Bug c/39121] strange behavior in chained operations

2015-06-25 Thread joe.carnuccio at qlogic dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=39121 --- Comment #5 from joe.carnuccio at qlogic dot com --- Since using gcc -Os causes the correct execution, then "sequence point" does not have anything to do with it.

[Bug c/39121] strange behavior in chained operations

2015-06-25 Thread joe.carnuccio at qlogic dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=39121 joe.carnuccio at qlogic dot com changed: What|Removed |Added CC||joe.carnuccio at qlogic

[Bug c/39121] strange behavior in chained operations

2009-02-06 Thread rguenth at gcc dot gnu dot org
--- Comment #3 from rguenth at gcc dot gnu dot org 2009-02-06 21:21 --- Evaluation order is undefined if there is no sequence point. -- rguenth at gcc dot gnu dot org changed: What|Removed |Added

[Bug c/39121] strange behavior in chained operations

2009-02-06 Thread nospam at pamies dot cat
--- Comment #2 from nospam at pamies dot cat 2009-02-06 21:07 --- Is not the same bug as #15145. I agree with you that there is just one sequence point, but the operation is not undefined. void swap(int *a, int *b) { *a ^= *b ^= *a ^= *b; } This code should be compiled to: *a = *a

[Bug c/39121] strange behavior in chained operations

2009-02-06 Thread pinskia at gcc dot gnu dot org
--- Comment #1 from pinskia at gcc dot gnu dot org 2009-02-06 20:09 --- This is undefined code as you are modifying *a twice without a sequence point inbetween the modifies. *** This bug has been marked as a duplicate of 15145 *** -- pinskia at gcc dot gnu dot org changed: