From 22534ea5549e970de4466fe492dacc61c2ff471f Mon Sep 17 00:00:00 2001 From: Tamar Christina Date: Thu, 15 Mar 2018 10:53:17 +0000 Subject: [PATCH] re PR target/84711 (AArch32 big-endian fails when taking subreg of a vector mode to a scalar mode.) 2018-03-15 Tamar Christina PR target/84711 * config/arm/arm.c (arm_can_change_mode_class): Use GET_MODE_UNIT_SIZE instead of GET_MODE_SIZE when comparing Units. gcc/testsuite/ 2018-03-15 Tamar Christina PR target/84711 * gcc.target/arm/big-endian-subreg.c: New. From-SVN: r258554 --- gcc/ChangeLog | 6 ++++++ gcc/config/arm/arm.c | 4 ++-- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.target/arm/big-endian-subreg.c | 13 +++++++++++++ 4 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gcc.target/arm/big-endian-subreg.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0d6855d9ec5..7772d5d49d1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-03-15 Tamar Christina + + PR target/84711 + * config/arm/arm.c (arm_can_change_mode_class): Use GET_MODE_UNIT_SIZE + instead of GET_MODE_SIZE when comparing Units. + 2018-03-15 Vladimir Mezentsev PR target/68256 diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 90d62e699bc..70363224082 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -31508,8 +31508,8 @@ arm_can_change_mode_class (machine_mode from, machine_mode to, { if (TARGET_BIG_END && !(GET_MODE_SIZE (from) == 16 && GET_MODE_SIZE (to) == 8) - && (GET_MODE_SIZE (from) > UNITS_PER_WORD - || GET_MODE_SIZE (to) > UNITS_PER_WORD) + && (GET_MODE_UNIT_SIZE (from) > UNITS_PER_WORD + || GET_MODE_UNIT_SIZE (to) > UNITS_PER_WORD) && reg_classes_intersect_p (VFP_REGS, rclass)) return false; return true; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 994b8ee7fdd..4d6379de3f4 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-03-15 Tamar Christina + + PR target/84711 + * gcc.target/arm/big-endian-subreg.c: New. + 2018-03-15 Jakub Jelinek PR target/84860 diff --git a/gcc/testsuite/gcc.target/arm/big-endian-subreg.c b/gcc/testsuite/gcc.target/arm/big-endian-subreg.c new file mode 100644 index 00000000000..4b1ab122f34 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/big-endian-subreg.c @@ -0,0 +1,13 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target arm_neon_ok } */ +/* { dg-require-effective-target arm_hf_eabi } */ +/* { dg-add-options arm_neon } */ +/* { dg-additional-options "-mfp16-format=ieee -mfloat-abi=hard" } */ + +typedef __fp16 v4f16 + __attribute__ ((vector_size (8))); + +v4f16 fn1 (v4f16 p) +{ + return p; +} -- 2.30.2