public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/107626] New: STRICT_ALIGNMENT and TARGET_SLOW_UNALIGNED_ACCESS usage
@ 2022-11-10 22:48 pinskia at gcc dot gnu.org
  2022-11-10 23:02 ` [Bug middle-end/107626] " pinskia at gcc dot gnu.org
  2022-11-11  9:22 ` rguenth at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-11-10 22:48 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 107626
           Summary: STRICT_ALIGNMENT and TARGET_SLOW_UNALIGNED_ACCESS
                    usage
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Keywords: documentation, internal-improvement
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---

As explained in bug 107601 comment #3, these target macros/hooks usage should
be auditted in the middle-end to make sure they are used correctly and explain
better in the documentation on what their usage is.

STRICT_ALIGNMENT says all (some?) unaligned access will cause a trap and GCC
should not try to use them at all.
While TARGET_SLOW_UNALIGNED_ACCESS should tell the middle-end if a load/store
with a specific mode with a specific alignment will be much slow (where much is
usually in the order of 10x or so) than an aligned case.

An good example for usage of TARGET_SLOW_UNALIGNED_ACCESS is the powerpc*-linux
(ABI and arch) which says a floating point load/store to a 4 byte aligned (even
a 8 byte load) will not cause a trap so it will be handled in HW while
otherwise it will cause a trap (and the Linux kernel should handle the
load/store) and it will be slow. So this is techincally not a STRICT_ALIGNMENT
target as required by the ABI but  TARGET_SLOW_UNALIGNED_ACCESS should be used
there.

This should be expanded and put in the documentation here.

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

* [Bug middle-end/107626] STRICT_ALIGNMENT and TARGET_SLOW_UNALIGNED_ACCESS usage
  2022-11-10 22:48 [Bug middle-end/107626] New: STRICT_ALIGNMENT and TARGET_SLOW_UNALIGNED_ACCESS usage pinskia at gcc dot gnu.org
@ 2022-11-10 23:02 ` pinskia at gcc dot gnu.org
  2022-11-11  9:22 ` rguenth at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-11-10 23:02 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2022-11-10
           Assignee|unassigned at gcc dot gnu.org      |pinskia at gcc dot gnu.org

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I am going to try my hand at this for GCC 14.

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

* [Bug middle-end/107626] STRICT_ALIGNMENT and TARGET_SLOW_UNALIGNED_ACCESS usage
  2022-11-10 22:48 [Bug middle-end/107626] New: STRICT_ALIGNMENT and TARGET_SLOW_UNALIGNED_ACCESS usage pinskia at gcc dot gnu.org
  2022-11-10 23:02 ` [Bug middle-end/107626] " pinskia at gcc dot gnu.org
@ 2022-11-11  9:22 ` rguenth at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-11-11  9:22 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Some backends use TARGET_SLOW_UNALIGNED_ACCESS to indicate that some modes
adhere to STRICT_ALIGNMENT and unaligned accesses will trap though to avoid
setting STRICT_ALIGNMENT which applies to all modes.

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

end of thread, other threads:[~2022-11-11  9:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-10 22:48 [Bug middle-end/107626] New: STRICT_ALIGNMENT and TARGET_SLOW_UNALIGNED_ACCESS usage pinskia at gcc dot gnu.org
2022-11-10 23:02 ` [Bug middle-end/107626] " pinskia at gcc dot gnu.org
2022-11-11  9:22 ` rguenth 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).