public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/67281] New: HTM builtins aren't treated as compiler barriers on powerpc
@ 2015-08-19 17:22 tuliom at linux dot vnet.ibm.com
  2015-08-19 17:52 ` [Bug target/67281] " pinskia at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: tuliom at linux dot vnet.ibm.com @ 2015-08-19 17:22 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67281

            Bug ID: 67281
           Summary: HTM builtins aren't treated as compiler barriers on
                    powerpc
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tuliom at linux dot vnet.ibm.com
  Target Milestone: ---

Depending on the level of optimization, GCC moves a memory access outside a
transaction which breaks the atomicity of the transaction.

This is a small testcase that reproduces this behavior:

$ cat tbegin-barrier.c
long
foo (long dest, long src0, long src1, long tries)
{
  long i;
  for (i = 0; i < tries; i++)
    {
      __builtin_tbegin (0);
      dest = src0 + src1;
      __builtin_tend (0);
    }
  return dest;
}

compiling using: -O2 -S -mcpu=power8 tbegin-barrier.c
gives
foo:
        cmpdi 0,6,0
        blelr 0
        mtctr 6
        add 3,4,5
        .p2align 4,,15
.L3:
        tbegin. 0
        tend. 0
        bdnz .L3
        blr


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-10-15 16:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-19 17:22 [Bug target/67281] New: HTM builtins aren't treated as compiler barriers on powerpc tuliom at linux dot vnet.ibm.com
2015-08-19 17:52 ` [Bug target/67281] " pinskia at gcc dot gnu.org
2015-08-19 18:43 ` tuliom at linux dot vnet.ibm.com
2015-08-19 18:51 ` pinskia at gcc dot gnu.org
2015-08-19 19:07 ` tuliom at linux dot vnet.ibm.com
2015-08-23 12:27 ` torvald at gcc dot gnu.org
2015-10-15 16:39 ` bergner at gcc dot gnu.org
2015-10-15 16:40 ` bergner at gcc dot gnu.org
2015-10-15 16:44 ` bergner at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).