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: "steven at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 Feb 2004 13:43:17 -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 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