public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/104455] New: Cannot select -march=armv7-a using GCC 11
@ 2022-02-08 23:45 noloader at gmail dot com
  2022-02-09 11:47 ` [Bug target/104455] " rearnsha at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: noloader at gmail dot com @ 2022-02-08 23:45 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 104455
           Summary: Cannot select -march=armv7-a using GCC 11
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: noloader at gmail dot com
  Target Milestone: ---

Hi Everyone,

We are trying to fix a compile problem Debian encountered on Sid [1,2]. The
machine is armhf, but I don't have access to it. Sid is using GCC 11, but I am
not sure which version. The problem does not exist in GCC 10 and below.

I think this is the test case. Below, test.S is mostly armv4 but has some armv7
instructions. I used movw and movt as an example since they are armv7.

$ cat test.S
        .globl return_magic
        .type  return_magic,%function

return_magic:

        movw r0, #0x1234
        movt r0, #0x5678
        bl   0

$ g++ -g2 -O3 -Wa,--noexecstack -march=armv7-a test.S -c

When Debian compiles with GCC 11, it results in:

  cc1: error: ‘-mfloat-abi=hard’: selected architecture lacks an FPU

test.S does not use floating point or neon instructions. This source file does
not need a fpu. We don't care what the platform default is because we don't use
it. But in this case, the machine is armhf so GCC should know it should use
hard floats.

When I attempt to add -mfpu=auto per [3], it results in another error:

  cc1: sorry, unimplemented: -mfpu=auto not currently supported without an
explicit CPU.
  cc1: error: -mfloat-abi=hard: selected processor lacks an FPU

test.S does not use floating point or neon instructions. This source file does
not need a fpu. I also tried -mfpu=none, but it results in:

  g++: error: unrecognized argument in option ‘-mfpu=none’
  g++: note: valid arguments to ‘-mfpu=’ are: auto crypto-neon-fp-armv8
  fp-armv8 fpv4-sp-d16 fpv5-d16 fpv5-sp-d16 neon neon-fp-armv8 neon-fp16
  neon-vfpv3 neon-vfpv4 vfp vfp3 vfpv2 vfpv3 vfpv3-d16 vfpv3-d16-fp16
  vfpv3-fp16 vfpv3xd vfpv3xd-fp16 vfpv4 vfpv4-d16; did you mean ‘neon’?

In the past we avoided specifying a -mfpu option because the code [used to]
work with GCC 4 and above, Clang 3 and above, armel, armhf and Android with
soft floats. The compiler always knew what float abi it should use.

I would like to drop -march=armv7-a, but GCC requires me to use an ISA option
before I use instructions from the ISA. I've never liked the rule, but it is
what it is. (Microsoft's C/C++ compiler got this right).

[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1001995
[2] https://github.com/weidai11/cryptopp/issues/1094
[3] https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html

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

end of thread, other threads:[~2022-02-11 15:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-08 23:45 [Bug c++/104455] New: Cannot select -march=armv7-a using GCC 11 noloader at gmail dot com
2022-02-09 11:47 ` [Bug target/104455] " rearnsha at gcc dot gnu.org
2022-02-10  3:12 ` noloader at gmail dot com
2022-02-10 11:17 ` rearnsha at gcc dot gnu.org
2022-02-10 20:44 ` noloader at gmail dot com
2022-02-10 21:16 ` schwab@linux-m68k.org
2022-02-11 15:24 ` rearnsha 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).