This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug optimization/14272] [tree-ssa] miscompilation of __exchange_and_add (atomicity.h)
- From: "amacleod at redhat dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 Feb 2004 14:06:32 -0000
- Subject: [Bug optimization/14272] [tree-ssa] miscompilation of __exchange_and_add (atomicity.h)
- References: <20040224133459.14272.ehrhardt@mathematik.uni-ulm.de>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From amacleod at redhat dot com 2004-02-25 14:06 -------
Hmm.
__exchange_and_add (__mem, __val)
{
int __tmp;
int __result;
int T.1;
int T.0;
# BLOCK 0
# PRED: ENTRY [100.0%] (fallthru,exec)
__result_2 = *__mem_1;
T.0_3 = *__mem_1;
T.1_5 = T.0_3 + __val_4;
*__mem_1 = T.1_5;
return __result_2;
# SUCC: EXIT [100.0%]
}
Since there are dereferences to memory and a store to memory here, ought there
not be a virtual operand of some sort to prevent the movement of the
dereferences past the store?
Diego? Its like this right from the very beginning...
Thats why TER is doing the replacement.. no virtual operands mean no side
effects....
Andrew
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14272