This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/32721] CCP removes volatile qualifiers.
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 Jul 2007 12:19:11 -0000
- Subject: [Bug tree-optimization/32721] CCP removes volatile qualifiers.
- References: <bug-32721-14766@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from rguenth at gcc dot gnu dot org 2007-07-13 12:19 -------
Actually, the optimized dump ist still correct:
main ()
{
int D.2011;
<bb 2>:
spinlock[0] = 0;
spinlock[1] = 0;
<bb 3>:
D.2011 = spinlock[0];
if (D.2011 != 0)
goto <bb 3>;
else
goto <bb 4>;
<bb 4>:
return;
}
spinlock[0] is re-loaded in every loop iteration. Likewise the assembly
is correct. Only if I remove the volatile qualifier from the declaration
of spinlock then FRE removes the redundancy. And this is because while
we keep the has_volatile_ops on the stmt after the propagation of the
pointer, the first alias pass clears it.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32721