This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/67281] HTM builtins aren't treated as compiler barriers on powerpc
- From: "bergner at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 19 Aug 2015 20:25:55 +0000
- Subject: [Bug target/67281] HTM builtins aren't treated as compiler barriers on powerpc
- Auto-submitted: auto-generated
- References: <bug-67281-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67281
Peter Bergner <bergner at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |bergner at gcc dot gnu.org
--- Comment #5 from Peter Bergner <bergner at gcc dot gnu.org> ---
(In reply to Tulio Magno Quites Machado Filho from comment #4)
> I disagree with you.
I agree with Tulio.
> Here's an example:
>
> long
> foo (long dest, long *src0, long src1, long tries)
> {
> long i;
> for (i = 0; i < tries; i++)
> {
> __builtin_tbegin (0);
> dest = *src0 + src1;
> if (dest == 13)
> __builtin_tabort(0);
> __builtin_tend (0);
> }
> return dest;
> }
Even better is to change src1 to a pointer too and dereference that within the
transaction. If *src0 and *src1 are two memory locations that should be
updated together and atomically, then allowing them to move past the tbegin.
could break that requirement.