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

--- Comment #45 from rguenther at suse dot de <rguenther at suse dot de> 
2010-11-14 17:38:46 UTC ---
On Sun, 14 Nov 2010, hubicka at gcc dot gnu.org wrote:

> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40436
> 
> --- Comment #44 from Jan Hubicka <hubicka at gcc dot gnu.org> 2010-11-14 
> 16:16:35 UTC ---
> OK, ialloc is because 4.3 folds:
>   oldbit_430 = 0;
>   D.12699_431 = oldbit_430 & 1;
>   D.12698_462 = D.12699_431;
>   D.12095_241 = D.12698_462;
>   if (D.12095_241 != 0)
>     goto <bb 71>;
>   else
>     goto <bb 72>;
> 
> In mainline the same sequence misses oldbit_430 = 0.
> 
> static __inline__ int
> test_and_set_bit_simple(unsigned long nr, volatile void * addr)
> {
>  unsigned long reg1, reg2;
>         int oldbit;
> 
>         return oldbit & 1;
> }
> 
> 
> 
> 
> 
> static __inline__ int
> test_and_clear_bit_simple(unsigned long nr, volatile void * addr)
> {
>  unsigned long reg1, reg2;
>         int oldbit;
> 
> 
>         return oldbit & 1;
> }
> 
> 
> 
> 
> 
> static __inline__ int
> test_and_change_bit_simple(unsigned long nr, volatile void * addr)
> {
>  unsigned long reg1, reg2;
>         int oldbit;
> 
> 
>         return oldbit & 1;
> }
> 
> So another source code bug.
> Richard, do you remember if we dropped initialization by zero for 
> uninitialized
> vars?  

I don't even remember that we did that.  Btw, CCP should be able
to fold it with UNDEFINED given that & 1 cannot yield zero (but
we're very conservative here now due to past bugs ...)

Reply via email to