public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/54004] New: __atomic_always_lock_free has a fault implementation in which the target has no saying
@ 2012-07-17 20:57 hp at gcc dot gnu.org
  2012-07-17 21:03 ` [Bug tree-optimization/54004] __atomic_always_lock_free / __atomic_is_lock_free has a faulty " hp at gcc dot gnu.org
  2012-07-19 22:26 ` hp at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: hp at gcc dot gnu.org @ 2012-07-17 20:57 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 54004
           Summary: __atomic_always_lock_free has a fault implementation
                    in which the target has no saying
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: hp@gcc.gnu.org
        Depends on: 54003


Created attachment 27819
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27819
Conceptual patch - note comments

Basically, fold_builtin_atomic_always_lock_free compares alignment of the type
of the atomic data to that of the normal alignment for a mode.  A better
default is to compare to the *natural* alignment.  For most targets, the two
are the same. If that's approach is not ok, then a target hook is needed. 
Conceptual patch (i.e. untested, uncompiled) for the first approach attached. 
Note that this suggestion is counter to the documented dogma of "presence of
library or atomic pattern implies lock-free-ness", but that already has
inconsistencies, see linked PR.

Note that this likely means we need a libgcc implementation for
__atomic_is_lock_free or at least document that the target needs to supply one.


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

* [Bug tree-optimization/54004] __atomic_always_lock_free / __atomic_is_lock_free has a faulty implementation in which the target has no saying
  2012-07-17 20:57 [Bug tree-optimization/54004] New: __atomic_always_lock_free has a fault implementation in which the target has no saying hp at gcc dot gnu.org
@ 2012-07-17 21:03 ` hp at gcc dot gnu.org
  2012-07-19 22:26 ` hp at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: hp at gcc dot gnu.org @ 2012-07-17 21:03 UTC (permalink / raw)
  To: gcc-bugs

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

Hans-Peter Nilsson <hp at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|__atomic_always_lock_free   |__atomic_always_lock_free /
                   |has a fault implementation  |__atomic_is_lock_free has a
                   |in which the target has no  |faulty implementation in
                   |saying                      |which the target has no
                   |                            |saying

--- Comment #1 from Hans-Peter Nilsson <hp at gcc dot gnu.org> 2012-07-17 21:03:43 UTC ---
Changing the title to explicitly include __atomic_is_lock_free here (and to fix
a typo).  Not exactly the same problem, but once the issue shared with
__atomic_always_lock_free is fixed, it'd be nice to expand through a MD
pattern, and not just emit a library call.


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

* [Bug tree-optimization/54004] __atomic_always_lock_free / __atomic_is_lock_free has a faulty implementation in which the target has no saying
  2012-07-17 20:57 [Bug tree-optimization/54004] New: __atomic_always_lock_free has a fault implementation in which the target has no saying hp at gcc dot gnu.org
  2012-07-17 21:03 ` [Bug tree-optimization/54004] __atomic_always_lock_free / __atomic_is_lock_free has a faulty " hp at gcc dot gnu.org
@ 2012-07-19 22:26 ` hp at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: hp at gcc dot gnu.org @ 2012-07-19 22:26 UTC (permalink / raw)
  To: gcc-bugs

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

Hans-Peter Nilsson <hp at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #27819|0                           |1
        is obsolete|                            |

--- Comment #2 from Hans-Peter Nilsson <hp at gcc dot gnu.org> 2012-07-19 22:26:45 UTC ---
Created attachment 27838
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27838
An updated version that actually compiles

The s/mode_align/natural_align/ change didn't include the declaration.  Sorry.


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

end of thread, other threads:[~2012-07-19 22:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-17 20:57 [Bug tree-optimization/54004] New: __atomic_always_lock_free has a fault implementation in which the target has no saying hp at gcc dot gnu.org
2012-07-17 21:03 ` [Bug tree-optimization/54004] __atomic_always_lock_free / __atomic_is_lock_free has a faulty " hp at gcc dot gnu.org
2012-07-19 22:26 ` hp 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).