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 target/67281] HTM builtins aren't treated as compiler barriers on powerpc


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.

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