This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: bug in 4.1.1?
- From: Andrew Pinski <pinskia at physics dot uc dot edu>
- To: jimmyb at huawei dot com (jimmy)
- Cc: gcc at gcc dot gnu dot org, fantadox at huawei dot com, maheshsb at huawei dot com
- Date: Sun, 13 Aug 2006 10:55:41 -0400 (EDT)
- Subject: Re: bug in 4.1.1?
>
> When compiling the following the code with gcc 4.1.1 without
> optimization, the output is wrong.
>
> gcc -v is
>
> Using built-in specs.
> Target: i686-pc-linux-gnu
> Configured with: ./configure --prefix=/home/jb/local
> Thread model: posix
> gcc version 4.1.1
>
> <=====code=====>
>
> #include<stdio.h>
>
> int main()
> {
> int b[2] = {3, 5};
>
> b[0] ^= b[1] ^= b[0] ^= b[1];
There is no sequence point between the assignments of b[0]
so the behavior is undefined.
-- Pinski