This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug optimization/14272] [tree-ssa] miscompilation of __exchange_and_add (atomicity.h)


------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]