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

            Bug ID: 88799
           Summary: Arm -mcpu=PROCESSOR does not result in assembly
                    directives for .arch and .arch_extension
           Product: gcc
           Version: 8.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pcarroll at codesourcery dot com
  Target Milestone: ---

Created attachment 45410
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=45410&action=edit
Example test case with embedded PLDW instruction

In June 2017, the mechanism for handling -march and -mcpu was modified for the
GCC 8 Arm compiler. In December 2017, the Arm compiler began emitting .arch
directives within each function that was being emitted, if the current
architecture had changed from the previous function.  The problem seems to be
that this new behavior does not track architecture extensions that have been
specified on the command line or in the source.

For example, if I compile a C file with the command line "-S -mcpu=cortex-a9"
and the C file contains an asm instruction that is beyond the basic
architecture instruction set, the GCC 8 compiler generates this assembly code: 

        .cpu cortex-a9
        .eabi_attribute 20, 1
        :
        .global myfunc
        .arch armv7-a
        .syntax unified
        .arm
        :
        pldw L1
L1:
        :

When this is assembled, I get the message
Error: Selected processor does not support `pldw L1` in ARM mode

If I insert a '.arch_extension mp' directive after the '.arch armv7-a', the
assembly file does assemble without error.

This is a regression from GCC 7.

Reply via email to