------- Additional Comments From law at redhat dot com 2005-07-09 21:58 -------
Subject: Re: [4.0/4.1 Regression] &volatile_var !=
&volatile_var is always true
On Sat, 2005-07-09 at 17:58 +0000, pinskia at gcc dot gnu dot org wrote:
> ------- Additional Comments From pinskia at gcc dot gnu dot org 2005-07-09
> 17:58 -------
> This fails also at -O0:
> volatile int x;
>
> int main()
> {
> if (&x != &x)
> abort ();
> return 0;
> }
>
> And this testcase worked in 3.4.x too so this is defintely a fold bug.
It's a bug in how the folder uses operand_equal_p. operand_equal_p is
not equivalent to a C equality test, but fold_binary is using it to
evaluate a C equality test and thus getting the wrong results.
I've got a patch ready to go, but won't get it checked in until Monday
or possibly even Tuesday depending on some personal commitments.
jeff
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22321