This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/50142] New: There is bug when swap elements of an array via chain expression.


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]