public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/111555] New: [AArch64] __ARM_FEATURE_UNALIGNED should be undefined with -mstrict-align
@ 2023-09-23 17:42 lasse.collin at tukaani dot org
  2023-09-23 17:47 ` [Bug target/111555] " pinskia at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: lasse.collin at tukaani dot org @ 2023-09-23 17:42 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 111555
           Summary: [AArch64] __ARM_FEATURE_UNALIGNED should be undefined
                    with -mstrict-align
           Product: gcc
           Version: 13.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: lasse.collin at tukaani dot org
  Target Milestone: ---

On 32-bit ARM, the macro __ARM_FEATURE_UNALIGNED is defined when using
-munaligned-access and not defined when using -mno-unaligned-access. On AArch64
the macro is always defined with both -mno-strict-align and -mstrict-align. I
think the macro shouldn't be defined with -mstrict-align on AArch64.

For comparison, with Clang on AArch64 the definition of __ARM_FEATURE_UNALIGNED
is omitted with -mstrict-align and -mno-unaligned-access.

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

* [Bug target/111555] [AArch64] __ARM_FEATURE_UNALIGNED should be undefined with -mstrict-align
  2023-09-23 17:42 [Bug target/111555] New: [AArch64] __ARM_FEATURE_UNALIGNED should be undefined with -mstrict-align lasse.collin at tukaani dot org
@ 2023-09-23 17:47 ` pinskia at gcc dot gnu.org
  2024-03-14 23:37 ` syq at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-09-23 17:47 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2023-09-23
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed. Though the ACLE spec
(https://developer.arm.com/documentation/ihi0053/d/?lang=en) is not clear here
as this part was written as part of aarch32/thumb2 part rather than referencing
aarch64 ...

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

* [Bug target/111555] [AArch64] __ARM_FEATURE_UNALIGNED should be undefined with -mstrict-align
  2023-09-23 17:42 [Bug target/111555] New: [AArch64] __ARM_FEATURE_UNALIGNED should be undefined with -mstrict-align lasse.collin at tukaani dot org
  2023-09-23 17:47 ` [Bug target/111555] " pinskia at gcc dot gnu.org
@ 2024-03-14 23:37 ` syq at gcc dot gnu.org
  2024-03-14 23:45 ` pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: syq at gcc dot gnu.org @ 2024-03-14 23:37 UTC (permalink / raw)
  To: gcc-bugs

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

YunQiang Su <syq at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |syq at gcc dot gnu.org

--- Comment #2 from YunQiang Su <syq at gcc dot gnu.org> ---
`-mno-unaligned-access` is also supported by MIPSr6.

I guess we should add a more generic macro for this case?
Is __UNALIGN_ACCESS_DISABLED__ OK?

For AArch64, clang supports `-mno-unaligned-access`, while gcc doesn't,
should we add it as an alias of -mstrict-align?

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

* [Bug target/111555] [AArch64] __ARM_FEATURE_UNALIGNED should be undefined with -mstrict-align
  2023-09-23 17:42 [Bug target/111555] New: [AArch64] __ARM_FEATURE_UNALIGNED should be undefined with -mstrict-align lasse.collin at tukaani dot org
  2023-09-23 17:47 ` [Bug target/111555] " pinskia at gcc dot gnu.org
  2024-03-14 23:37 ` syq at gcc dot gnu.org
@ 2024-03-14 23:45 ` pinskia at gcc dot gnu.org
  2024-03-14 23:46 ` pinskia at gcc dot gnu.org
  2024-03-15  2:20 ` i at maskray dot me
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-03-14 23:45 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to YunQiang Su from comment #2)
> For AArch64, clang supports `-mno-unaligned-access`, while gcc doesn't,
> should we add it as an alias of -mstrict-align?

-mno-unaligned-access is the arm option here rather than the aarch64 option :).
I suspect clang folks decided to have the same option for both targets. I don't
think we should support -mno-unaligned-access for aarch64 GCC.

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

* [Bug target/111555] [AArch64] __ARM_FEATURE_UNALIGNED should be undefined with -mstrict-align
  2023-09-23 17:42 [Bug target/111555] New: [AArch64] __ARM_FEATURE_UNALIGNED should be undefined with -mstrict-align lasse.collin at tukaani dot org
                   ` (2 preceding siblings ...)
  2024-03-14 23:45 ` pinskia at gcc dot gnu.org
@ 2024-03-14 23:46 ` pinskia at gcc dot gnu.org
  2024-03-15  2:20 ` i at maskray dot me
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-03-14 23:46 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #3)
> (In reply to YunQiang Su from comment #2)
> > For AArch64, clang supports `-mno-unaligned-access`, while gcc doesn't,
> > should we add it as an alias of -mstrict-align?
> 
> -mno-unaligned-access is the arm option here rather than the aarch64 option
> :).
> I suspect clang folks decided to have the same option for both targets. I
> don't think we should support -mno-unaligned-access for aarch64 GCC.

See PR 99890 where -mstrict-align was rejected for arm.

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

* [Bug target/111555] [AArch64] __ARM_FEATURE_UNALIGNED should be undefined with -mstrict-align
  2023-09-23 17:42 [Bug target/111555] New: [AArch64] __ARM_FEATURE_UNALIGNED should be undefined with -mstrict-align lasse.collin at tukaani dot org
                   ` (3 preceding siblings ...)
  2024-03-14 23:46 ` pinskia at gcc dot gnu.org
@ 2024-03-15  2:20 ` i at maskray dot me
  4 siblings, 0 replies; 6+ messages in thread
From: i at maskray dot me @ 2024-03-15  2:20 UTC (permalink / raw)
  To: gcc-bugs

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

Fangrui Song <i at maskray dot me> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |i at maskray dot me

--- Comment #5 from Fangrui Song <i at maskray dot me> ---
It seems that newer ports prefer -mstrict-align/-mno-strict-align to
-mno-unaligned-access/-munaligned-access.
Clang handling these options as aliases is unfortunate. I'll fix this issue in 
https://github.com/llvm/llvm-project/pull/85350 (hopefully milestone: 19.1.0)

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

end of thread, other threads:[~2024-03-15  2:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-23 17:42 [Bug target/111555] New: [AArch64] __ARM_FEATURE_UNALIGNED should be undefined with -mstrict-align lasse.collin at tukaani dot org
2023-09-23 17:47 ` [Bug target/111555] " pinskia at gcc dot gnu.org
2024-03-14 23:37 ` syq at gcc dot gnu.org
2024-03-14 23:45 ` pinskia at gcc dot gnu.org
2024-03-14 23:46 ` pinskia at gcc dot gnu.org
2024-03-15  2:20 ` i at maskray dot me

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).