public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
* [Bug c/53656] New: sequence point bug @ 2012-06-13 12:09 alexcheremkhin at gmail dot com 2012-06-13 12:47 ` [Bug c/53656] " joseph at codesourcery dot com ` (2 more replies) 0 siblings, 3 replies; 4+ messages in thread From: alexcheremkhin at gmail dot com @ 2012-06-13 12:09 UTC (permalink / raw) To: gcc-bugs http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53656 Bug #: 53656 Summary: sequence point bug Classification: Unclassified Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassigned@gcc.gnu.org ReportedBy: alexcheremkhin@gmail.com Created attachment 27614 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27614 source code $gcc -v COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/i686-pc-linux-gnu/4.6.0/lto-wrapper Целевая архитектура: i686-pc-linux-gnu Параметры конфигурации: ./configure Модель многопоточности: posix gcc версия 4.6.0 (GCC) Optimization options do not matter (result is the same). Source code: ---------------------------------------------------- /* bug.c */ #include <stdio.h> int x = 0; int f() { return x++; } int main() { int y = x++ + f(); printf("x=%d\n", x); return 0; } ------------------------------------------------------ The program should have printed 'x=2', but prints 'x=1'. It looks like the variable x had been read to a register before call of f(), and incremented after the call. The function call makes a sequence point, so the behaviuor is not correct. Alexey Cheremkhin; Compiler Department, KM211. avc@km211.ru ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c/53656] sequence point bug 2012-06-13 12:09 [Bug c/53656] New: sequence point bug alexcheremkhin at gmail dot com @ 2012-06-13 12:47 ` joseph at codesourcery dot com 2012-06-14 15:38 ` alexcheremkhin at gmail dot com 2012-06-14 17:55 ` pinskia at gcc dot gnu.org 2 siblings, 0 replies; 4+ messages in thread From: joseph at codesourcery dot com @ 2012-06-13 12:47 UTC (permalink / raw) To: gcc-bugs http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53656 --- Comment #1 from joseph at codesourcery dot com <joseph at codesourcery dot com> 2012-06-13 12:47:23 UTC --- Looks similar to bug 48814. ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c/53656] sequence point bug 2012-06-13 12:09 [Bug c/53656] New: sequence point bug alexcheremkhin at gmail dot com 2012-06-13 12:47 ` [Bug c/53656] " joseph at codesourcery dot com @ 2012-06-14 15:38 ` alexcheremkhin at gmail dot com 2012-06-14 17:55 ` pinskia at gcc dot gnu.org 2 siblings, 0 replies; 4+ messages in thread From: alexcheremkhin at gmail dot com @ 2012-06-14 15:38 UTC (permalink / raw) To: gcc-bugs http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53656 --- Comment #2 from Alexey Cheremkhin <alexcheremkhin at gmail dot com> 2012-06-14 15:38:36 UTC --- (In reply to comment #1) > Looks similar to bug 48814. Thank you very much. It is definitely the same bug. Bug 48814 was fixed on 2012-03-16, so I simply used the patch. Alexey Cheremkhin; Compiler Department, KM211. avc@km211.ru ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c/53656] sequence point bug 2012-06-13 12:09 [Bug c/53656] New: sequence point bug alexcheremkhin at gmail dot com 2012-06-13 12:47 ` [Bug c/53656] " joseph at codesourcery dot com 2012-06-14 15:38 ` alexcheremkhin at gmail dot com @ 2012-06-14 17:55 ` pinskia at gcc dot gnu.org 2 siblings, 0 replies; 4+ messages in thread From: pinskia at gcc dot gnu.org @ 2012-06-14 17:55 UTC (permalink / raw) To: gcc-bugs http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53656 Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |DUPLICATE --- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-06-14 17:55:28 UTC --- Closing as a dup then. *** This bug has been marked as a duplicate of bug 48814 *** ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-06-14 17:55 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2012-06-13 12:09 [Bug c/53656] New: sequence point bug alexcheremkhin at gmail dot com 2012-06-13 12:47 ` [Bug c/53656] " joseph at codesourcery dot com 2012-06-14 15:38 ` alexcheremkhin at gmail dot com 2012-06-14 17:55 ` pinskia at gcc dot gnu.org
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).