[Bug optimization/14272] [tree-ssa] miscompilation of __exchange_and_add (atomicity.h)
steven at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Wed Feb 25 13:43:00 GMT 2004
------- Additional Comments From steven at gcc dot gnu dot org 2004-02-25 13:43 -------
This is not _really_ a TER problem, but a problem with volatiles and aliasing:
***************
*** 17,34 ****
Coalesced label blocks: 0 (Max so far: 0)
! int __exchange_and_add(volatile int*, int) (__mem, __val)
{
int __tmp;
int __result;
int T.1;
! volatile 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%]
--- 17,35 ----
Coalesced label blocks: 0 (Max so far: 0)
! int __exchange_and_add(int*, int) (__mem, __val)
{
int __tmp;
int __result;
int T.1;
! int T.0;
# BLOCK 0
# PRED: ENTRY [100.0%] (fallthru,exec)
+ # VUSE <TMT.2_7>;
__result_2 = *__mem_1;
! T.1_5 = __result_2 + __val_4;
! # TMT.2_8 = VDEF <TMT.2_7>;
*__mem_1 = T.1_5;
return __result_2;
# SUCC: EXIT [100.0%]
Note the missing VUSE in the dump where __mem is volatile.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14272
More information about the Gcc-bugs
mailing list