public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/50142] New: There is bug when swap elements of an array via chain expression.
@ 2011-08-21 11:38 thomas.c.zhao at gmail dot com
  2011-08-21 12:01 ` [Bug c/50142] " rguenth at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: thomas.c.zhao at gmail dot com @ 2011-08-21 11:38 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50142

             Bug #: 50142
           Summary: There is bug when swap elements of an array via chain
                    expression.
    Classification: Unclassified
           Product: gcc
           Version: 4.0.3
            Status: UNCONFIRMED
          Severity: critical
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: thomas.c.zhao@gmail.com


[gcc version]: 4.0.3
[system type]: sparc-sun-solaris2.10
[build options]: none
[source code]:
main()
{
 int a[] = {1,2};
 a[0] ^= a[1] ^= a[0] ^= a[1];
 printf("a[0]=%d a[1]=%d\n", a[0], a[1]);
}

[expected result]: a[0]=2 a[1]=1
[actual result]: a[0]=0 a[1]=1

btw: gcc3 is ok.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-08-22  8:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-21 11:38 [Bug c/50142] New: There is bug when swap elements of an array via chain expression thomas.c.zhao at gmail dot com
2011-08-21 12:01 ` [Bug c/50142] " rguenth at gcc dot gnu.org
2011-08-22  3:33 ` thomas.c.zhao at gmail dot com
2011-08-22  6:47 ` jakub at gcc dot gnu.org
2011-08-22  8:11 ` thomas.c.zhao at gmail dot com

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).