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 middle-end/51752] trans-mem: publication safety violated


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51752

--- Comment #4 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-02-09 16:43:40 UTC ---
But isn't with

  __transaction_atomic
    {
      for (i = 0; i < 10; i++)
        if (x[i])
          x[i] += data;
    }

and

  __transaction_atomic { x[9] = 1; }

occuring concurrently the loop transaction terminated?  Thus,

  __transaction_atomic
    {
      tem = data;
      for (i = 0; i < 10; i++)
        if (x[i])
          x[i] += tem;
    }

equivalent?  We don't hoist out of the transaction region (well, as far
as I can see - the transaction region seems to be specified in a very
weak way, without virtual operands or any IL barrier or such).

<bb 2>:
  # .MEM_2 = VDEF <.MEM_1(D)>
  data = 23;
  __transaction_atomic  // SUBCODE=[ GTMA_HAVE_STORE ]

<bb 3>:
  # .MEM_3 = VDEF <.MEM_2>
  x[9] = 1;
  # .MEM_4 = VDEF <.MEM_3>
  __builtin__ITM_commitTransaction ();

<bb 4>:
  # VUSE <.MEM_4>
  return;

the __transaction_atomic  // SUBCODE=[ GTMA_HAVE_STORE ] statement
looks like an overly optimistic way to start a transaction in my quick view.


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