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

            Bug ID: 68896
           Summary: [ARM] target attribute ignored
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: chrbr at gcc dot gnu.org
          Reporter: clyon at gcc dot gnu.org
  Target Milestone: ---
            Target: arm

Hi,

With a modified version of attr-neon3.c, it seems that the 1st target attribute
is ignored.

===============================
/* { dg-do compile } */
/* { dg-require-effective-target arm_crypto_ok } */
/* { dg-require-effective-target arm_fp_ok } */
/* { dg-options "-O2" } */
/* { dg-add-options arm_fp } */

/* Reset fpu to a value compatible with the next pragmas.  */
#pragma GCC target ("fpu=vfp")
#pragma GCC push_options

#include <arm_neon.h>

/* Check that neon is used.  */
int8x8_t __attribute__ ((target("fpu=neon")))
my (int8x8_t __a, int8x8_t __b)
{
  return __a + __b;
}

/* Check that crypto builtins are recognized.  */
poly128_t __attribute__ ((target("fpu=crypto-neon-fp-armv8")))
foo (poly128_t* ptr)
{
  return vldrq_p128 (ptr);
}

/* Check that default mode is restored.  */
int8x8_t
my1 (int8x8_t __a, int8x8_t __b)
{
  return __a + __b;
}

/* { dg-final { scan-assembler-times "\.fpu vfp" 1 } } */
/* { dg-final { scan-assembler-times "\.fpu neon" 1 } } */
/* { dg-final { scan-assembler-times "\.fpu crypto-neon-fp-armv8" 1 } } */
/* { dg-final { scan-assembler-times "vld1" 1 } } */
/* { dg-final { scan-assembler-times "vadd" 1} } */
======================================

Compiling with
/home/christophe.lyon/src/GCC/builds/gcc-fsf-arm-attribs/obj-arm-none-linux-gnueabihf/gcc3/gcc/xgcc
-B/home/christophe.lyon/src/GCC/builds/gcc-fsf-arm-attribs/obj-arm-none-linux-gnueabihf/gcc3/gcc/
/home/christophe.lyon/src/GCC/sources/gcc-fsf/arm-attribs/gcc/testsuite/gcc.target/arm/attr-neon3.c
-fno-diagnostics-show-caret -fdiagnostics-color=never -O2 -ffat-lto-objects
-DSTACK_SIZE=16384 -S -o attr-neon3.s

GCC configured: --target=arm-none-linux-gnueabihf --with-float=hard
--with-mode=arm --with-cpu=cortex-a9 --with-fpu=neon

Notice how the first function (my) is compiled with '.fpu vfp'

Reply via email to