summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorclyon <clyon@138bc75d-0d04-0410-961f-82ee72b054a4>2013-11-08 14:22:10 +0000
committerclyon <clyon@138bc75d-0d04-0410-961f-82ee72b054a4>2013-11-08 14:22:10 +0000
commit03398dd0ab4a8260f97bfbd6d0693bc0d8b492e8 (patch)
treed58cba4096d4e525d1792dba7cb833bd9dc1d667
parentdc58c9d45aafe8b0b59db1491f3a5acf24d1ae7f (diff)
downloadgcc-03398dd0ab4a8260f97bfbd6d0693bc0d8b492e8.tar.gz
gcc/
2013-11-05 Zhenqiang Chen <zhenqiang.chen@linaro.org> Backport from trunk r203267, r203603 and r204247. 2013-10-08 Zhenqiang Chen <zhenqiang.chen@linaro.org> PR target/58423 * config/arm/arm.c (arm_emit_ldrd_pop): Attach RTX_FRAME_RELATED_P on INSN. 2013-10-15 Matthew Gretton-Dann <matthew.gretton-dann@arm.com> Ramana Radhakrishnan <ramana.radhakrishnan@arm.com> * config/arm/t-aprofile: New file. * config.gcc: Handle --with-multilib-list option. 2013-10-31 Zhenqiang Chen <zhenqiang.chen@linaro.org> * lower-subreg.c (resolve_simple_move): Copy REG_INC note. gcc/testsuite/ 2013-11-05 Zhenqiang Chen <zhenqiang.chen@linaro.org> Backport from trunk r204247. 2013-10-31 Zhenqiang Chen <zhenqiang.chen@linaro.org> * gcc.target/arm/lp1243022.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_8-branch@204570 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog.linaro19
-rw-r--r--gcc/config.gcc37
-rw-r--r--gcc/config/arm/arm.c11
-rw-r--r--gcc/config/arm/t-aprofile177
-rw-r--r--gcc/lower-subreg.c23
-rw-r--r--gcc/testsuite/ChangeLog.linaro7
-rw-r--r--gcc/testsuite/gcc.target/arm/lp1243022.c201
7 files changed, 471 insertions, 4 deletions
diff --git a/gcc/ChangeLog.linaro b/gcc/ChangeLog.linaro
index 0e0945a083e..f32f3a60442 100644
--- a/gcc/ChangeLog.linaro
+++ b/gcc/ChangeLog.linaro
@@ -1,3 +1,22 @@
+2013-11-05 Zhenqiang Chen <zhenqiang.chen@linaro.org>
+
+ Backport from trunk r203267, r203603 and r204247.
+ 2013-10-08 Zhenqiang Chen <zhenqiang.chen@linaro.org>
+
+ PR target/58423
+ * config/arm/arm.c (arm_emit_ldrd_pop): Attach
+ RTX_FRAME_RELATED_P on INSN.
+
+ 2013-10-15 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
+ Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
+
+ * config/arm/t-aprofile: New file.
+ * config.gcc: Handle --with-multilib-list option.
+
+ 2013-10-31 Zhenqiang Chen <zhenqiang.chen@linaro.org>
+
+ * lower-subreg.c (resolve_simple_move): Copy REG_INC note.
+
2013-10-17 Christophe Lyon <christophe.lyon@linaro.org>
Backport from trunk r200956
diff --git a/gcc/config.gcc b/gcc/config.gcc
index af561ceb50a..d123b23e1ef 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -3284,6 +3284,43 @@ case "${target}" in
if test "x$with_arch" != x && test "x$with_cpu" != x; then
echo "Warning: --with-arch overrides --with-cpu=$with_cpu" 1>&2
fi
+
+ # Add extra multilibs
+ if test "x$with_multilib_list" != x; then
+ arm_multilibs=`echo $with_multilib_list | sed -e 's/,/ /g'`
+ for arm_multilib in ${arm_multilibs}; do
+ case ${arm_multilib} in
+ aprofile)
+ # Note that arm/t-aprofile is a
+ # stand-alone make file fragment to be
+ # used only with itself. We do not
+ # specifically use the
+ # TM_MULTILIB_OPTION framework because
+ # this shorthand is more
+ # pragmatic. Additionally it is only
+ # designed to work without any
+ # with-cpu, with-arch with-mode
+ # with-fpu or with-float options.
+ if test "x$with_arch" != x \
+ || test "x$with_cpu" != x \
+ || test "x$with_float" != x \
+ || test "x$with_fpu" != x \
+ || test "x$with_mode" != x ; then
+ echo "Error: You cannot use any of --with-arch/cpu/fpu/float/mode with --with-multilib-list=aprofile" 1>&2
+ exit 1
+ fi
+ tmake_file="${tmake_file} arm/t-aprofile"
+ break
+ ;;
+ default)
+ ;;
+ *)
+ echo "Error: --with-multilib-list=${with_multilib_list} not supported." 1>&2
+ exit 1
+ ;;
+ esac
+ done
+ fi
;;
fr*-*-*linux*)
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index d2a0fdbac5c..b98d7b5c0b4 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -17607,8 +17607,8 @@ arm_emit_ldrd_pop (unsigned long saved_regs_mask)
mem = gen_frame_mem (DImode, stack_pointer_rtx);
tmp = gen_rtx_SET (DImode, gen_rtx_REG (DImode, j), mem);
- RTX_FRAME_RELATED_P (tmp) = 1;
tmp = emit_insn (tmp);
+ RTX_FRAME_RELATED_P (tmp) = 1;
/* Generate dwarf info. */
@@ -17636,8 +17636,8 @@ arm_emit_ldrd_pop (unsigned long saved_regs_mask)
mem = gen_frame_mem (SImode, stack_pointer_rtx);
tmp = gen_rtx_SET (SImode, gen_rtx_REG (SImode, j), mem);
- RTX_FRAME_RELATED_P (tmp) = 1;
tmp = emit_insn (tmp);
+ RTX_FRAME_RELATED_P (tmp) = 1;
/* Generate dwarf info. */
REG_NOTES (tmp) = alloc_reg_note (REG_CFA_RESTORE,
@@ -17661,8 +17661,9 @@ arm_emit_ldrd_pop (unsigned long saved_regs_mask)
plus_constant (Pmode,
stack_pointer_rtx,
offset));
- RTX_FRAME_RELATED_P (tmp) = 1;
- emit_insn (tmp);
+ tmp = emit_insn (tmp);
+ arm_add_cfa_adjust_cfa_note (tmp, offset,
+ stack_pointer_rtx, stack_pointer_rtx);
offset = 0;
}
@@ -17685,6 +17686,8 @@ arm_emit_ldrd_pop (unsigned long saved_regs_mask)
gen_rtx_REG (SImode, PC_REGNUM),
NULL_RTX);
REG_NOTES (par) = dwarf;
+ arm_add_cfa_adjust_cfa_note (par, UNITS_PER_WORD,
+ stack_pointer_rtx, stack_pointer_rtx);
}
}
diff --git a/gcc/config/arm/t-aprofile b/gcc/config/arm/t-aprofile
new file mode 100644
index 00000000000..ce45d4d210a
--- /dev/null
+++ b/gcc/config/arm/t-aprofile
@@ -0,0 +1,177 @@
+# Copyright (C) 2012-2013 Free Software Foundation, Inc.
+#
+# This file is part of GCC.
+#
+# GCC is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GCC is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# This is a target makefile fragment that attempts to get
+# multilibs built for the range of CPU's, FPU's and ABI's that
+# are relevant for the A-profile architecture. It should
+# not be used in conjunction with another make file fragment and
+# assumes --with-arch, --with-cpu, --with-fpu, --with-float, --with-mode
+# have their default values during the configure step. We enforce
+# this during the top-level configury.
+
+MULTILIB_OPTIONS =
+MULTILIB_DIRNAMES =
+MULTILIB_EXCEPTIONS =
+MULTILIB_MATCHES =
+MULTILIB_REUSE =
+
+# We have the following hierachy:
+# ISA: A32 (.) or T32 (thumb)
+# Architecture: ARMv7-A (v7-a), ARMv7VE (v7ve), or ARMv8-A (v8-a).
+# FPU: VFPv3-D16 (fpv3), NEONv1 (simdv1), VFPv4-D16 (fpv4),
+# NEON-VFPV4 (simdvfpv4), NEON for ARMv8 (simdv8), or None (.).
+# Float-abi: Soft (.), softfp (softfp), or hard (hardfp).
+
+# We use the option -mcpu=cortex-a7 because we do not yet have march=armv7ve
+# or march=armv7a+virt as a command line option for the compiler.
+MULTILIB_OPTIONS += mthumb
+MULTILIB_DIRNAMES += thumb
+
+MULTILIB_OPTIONS += march=armv7-a/mcpu=cortex-a7/march=armv8-a
+MULTILIB_DIRNAMES += v7-a v7ve v8-a
+
+MULTILIB_OPTIONS += mfpu=vfpv3-d16/mfpu=neon/mfpu=vfpv4-d16/mfpu=neon-vfpv4/mfpu=neon-fp-armv8
+MULTILIB_DIRNAMES += fpv3 simdv1 fpv4 simdvfpv4 simdv8
+
+MULTILIB_OPTIONS += mfloat-abi=softfp/mfloat-abi=hard
+MULTILIB_DIRNAMES += softfp hard
+
+# We don't build no-float libraries with an FPU.
+MULTILIB_EXCEPTIONS += *mfpu=vfpv3-d16
+MULTILIB_EXCEPTIONS += *mfpu=neon
+MULTILIB_EXCEPTIONS += *mfpu=vfpv4-d16
+MULTILIB_EXCEPTIONS += *mfpu=neon-vfpv4
+MULTILIB_EXCEPTIONS += *mfpu=neon-fp-armv8
+
+# We don't build libraries requiring an FPU at the CPU/Arch/ISA level.
+MULTILIB_EXCEPTIONS += mfloat-abi=*
+MULTILIB_EXCEPTIONS += mfpu=*
+MULTILIB_EXCEPTIONS += mthumb/mfloat-abi=*
+MULTILIB_EXCEPTIONS += mthumb/mfpu=*
+MULTILIB_EXCEPTIONS += *march=armv7-a/mfloat-abi=*
+MULTILIB_EXCEPTIONS += *mcpu=cortex-a7/mfloat-abi=*
+MULTILIB_EXCEPTIONS += *march=armv8-a/mfloat-abi=*
+
+# Ensure the correct FPU variants apply to the correct base architectures.
+MULTILIB_EXCEPTIONS += *mcpu=cortex-a7/*mfpu=vfpv3-d16*
+MULTILIB_EXCEPTIONS += *mcpu=cortex-a7/*mfpu=neon/*
+MULTILIB_EXCEPTIONS += *march=armv8-a/*mfpu=vfpv3-d16*
+MULTILIB_EXCEPTIONS += *march=armv8-a/*mfpu=neon/*
+MULTILIB_EXCEPTIONS += *march=armv7-a/*mfpu=vfpv4-d16*
+MULTILIB_EXCEPTIONS += *march=armv7-a/*mfpu=neon-vfpv4*
+MULTILIB_EXCEPTIONS += *march=armv8-a/*mfpu=vfpv4-d16*
+MULTILIB_EXCEPTIONS += *march=armv8-a/*mfpu=neon-vfpv4*
+MULTILIB_EXCEPTIONS += *march=armv7-a/*mfpu=neon-fp-armv8*
+MULTILIB_EXCEPTIONS += *mcpu=cortex-a7/*mfpu=neon-fp-armv8*
+
+# CPU Matches
+MULTILIB_MATCHES += march?armv7-a=mcpu?cortex-a8
+MULTILIB_MATCHES += march?armv7-a=mcpu?cortex-a9
+MULTILIB_MATCHES += march?armv7-a=mcpu?cortex-a5
+MULTILIB_MATCHES += mcpu?cortex-a7=mcpu?cortex-a15
+MULTILIB_MATCHES += march?armv8-a=mcpu?cortex-a53
+
+# FPU matches
+MULTILIB_MATCHES += mfpu?vfpv3-d16=mfpu?vfpv3
+MULTILIB_MATCHES += mfpu?vfpv3-d16=mfpu?vfpv3-fp16
+MULTILIB_MATCHES += mfpu?vfpv3-d16=mfpu?vfpv3-fp16-d16
+MULTILIB_MATCHES += mfpu?vfpv4-d16=mfpu?vfpv4
+MULTILIB_MATCHES += mfpu?neon-fp-armv8=mfpu?crypto-neon-fp-armv8
+
+
+# Map all requests for vfpv3 with a later CPU to vfpv3-d16 v7-a.
+# So if new CPUs are added above at the newer architecture levels,
+# do something to map them below here.
+# We take the approach of mapping down to v7-a regardless of what
+# the fp option is if the integer architecture brings things down.
+# This applies to any similar combination at the v7ve and v8-a arch
+# levels.
+
+MULTILIB_REUSE += march.armv7-a/mfpu.vfpv3-d16/mfloat-abi.hard=mcpu.cortex-a7/mfpu.vfpv3-d16/mfloat-abi.hard
+MULTILIB_REUSE += march.armv7-a/mfpu.vfpv3-d16/mfloat-abi.softfp=mcpu.cortex-a7/mfpu.vfpv3-d16/mfloat-abi.softfp
+MULTILIB_REUSE += march.armv7-a/mfpu.vfpv3-d16/mfloat-abi.hard=march.armv8-a/mfpu.vfpv3-d16/mfloat-abi.hard
+MULTILIB_REUSE += march.armv7-a/mfpu.vfpv3-d16/mfloat-abi.softfp=march.armv8-a/mfpu.vfpv3-d16/mfloat-abi.softfp
+MULTILIB_REUSE += march.armv7-a/mfpu.vfpv3-d16/mfloat-abi.hard=march.armv7-a/mfpu.vfpv4-d16/mfloat-abi.hard
+MULTILIB_REUSE += march.armv7-a/mfpu.vfpv3-d16/mfloat-abi.softfp=march.armv7-a/mfpu.vfpv4-d16/mfloat-abi.softfp
+MULTILIB_REUSE += march.armv7-a/mfpu.vfpv3-d16/mfloat-abi.hard=march.armv7-a/mfpu.fp-armv8/mfloat-abi.hard
+MULTILIB_REUSE += march.armv7-a/mfpu.vfpv3-d16/mfloat-abi.softfp=march.armv7-a/mfpu.fp-armv8/mfloat-abi.softfp
+MULTILIB_REUSE += march.armv7-a/mfpu.vfpv3-d16/mfloat-abi.hard=march.armv7-a/mfpu.vfpv4/mfloat-abi.hard
+MULTILIB_REUSE += march.armv7-a/mfpu.vfpv3-d16/mfloat-abi.softfp=march.armv7-a/mfpu.vfpv4/mfloat-abi.softfp
+
+
+MULTILIB_REUSE += march.armv7-a/mfpu.neon/mfloat-abi.hard=mcpu.cortex-a7/mfpu.neon/mfloat-abi.hard
+MULTILIB_REUSE += march.armv7-a/mfpu.neon/mfloat-abi.softfp=mcpu.cortex-a7/mfpu.neon/mfloat-abi.softfp
+MULTILIB_REUSE += march.armv7-a/mfpu.neon/mfloat-abi.hard=march.armv8-a/mfpu.neon/mfloat-abi.hard
+MULTILIB_REUSE += march.armv7-a/mfpu.neon/mfloat-abi.softfp=march.armv8-a/mfpu.neon/mfloat-abi.softfp
+MULTILIB_REUSE += march.armv7-a/mfpu.neon/mfloat-abi.hard=march.armv7-a/mfpu.neon-vfpv4/mfloat-abi.hard
+MULTILIB_REUSE += march.armv7-a/mfpu.neon/mfloat-abi.softfp=march.armv7-a/mfpu.neon-vfpv4/mfloat-abi.softfp
+MULTILIB_REUSE += march.armv7-a/mfpu.neon/mfloat-abi.hard=march.armv7-a/mfpu.neon-fp-armv8/mfloat-abi.hard
+MULTILIB_REUSE += march.armv7-a/mfpu.neon/mfloat-abi.softfp=march.armv7-a/mfpu.neon-fp-armv8/mfloat-abi.softfp
+
+
+MULTILIB_REUSE += mcpu.cortex-a7/mfpu.vfpv4-d16/mfloat-abi.hard=mcpu.cortex-a7/mfpu.fp-armv8/mfloat-abi.hard
+MULTILIB_REUSE += mcpu.cortex-a7/mfpu.vfpv4-d16/mfloat-abi.softfp=mcpu.cortex-a7/mfpu.fp-armv8/mfloat-abi.softfp
+MULTILIB_REUSE += mcpu.cortex-a7/mfpu.vfpv4-d16/mfloat-abi.hard=march.armv8-a/mfpu.vfpv4/mfloat-abi.hard
+MULTILIB_REUSE += mcpu.cortex-a7/mfpu.vfpv4-d16/mfloat-abi.softfp=march.armv8-a/mfpu.vfpv4/mfloat-abi.softfp
+MULTILIB_REUSE += mcpu.cortex-a7/mfpu.vfpv4-d16/mfloat-abi.hard=march.armv8-a/mfpu.vfpv4-d16/mfloat-abi.hard
+MULTILIB_REUSE += mcpu.cortex-a7/mfpu.vfpv4-d16/mfloat-abi.softfp=march.armv8-a/mfpu.vfpv4-d16/mfloat-abi.softfp
+
+
+MULTILIB_REUSE += mcpu.cortex-a7/mfpu.neon-vfpv4/mfloat-abi.hard=march.armv8-a/mfpu.neon-vfpv4/mfloat-abi.hard
+MULTILIB_REUSE += mcpu.cortex-a7/mfpu.neon-vfpv4/mfloat-abi.softfp=march.armv8-a/mfpu.neon-vfpv4/mfloat-abi.softfp
+MULTILIB_REUSE += mcpu.cortex-a7/mfpu.neon-vfpv4/mfloat-abi.hard=mcpu.cortex-a7/mfpu.neon-fp-armv8/mfloat-abi.hard
+MULTILIB_REUSE += mcpu.cortex-a7/mfpu.neon-vfpv4/mfloat-abi.softfp=mcpu.cortex-a7/mfpu.neon-fp-armv8/mfloat-abi.softfp
+
+
+
+# And again for mthumb.
+
+MULTILIB_REUSE += mthumb/march.armv7-a/mfpu.vfpv3-d16/mfloat-abi.hard=mthumb/mcpu.cortex-a7/mfpu.vfpv3-d16/mfloat-abi.hard
+MULTILIB_REUSE += mthumb/march.armv7-a/mfpu.vfpv3-d16/mfloat-abi.softfp=mthumb/mcpu.cortex-a7/mfpu.vfpv3-d16/mfloat-abi.softfp
+MULTILIB_REUSE += mthumb/march.armv7-a/mfpu.vfpv3-d16/mfloat-abi.hard=mthumb/march.armv8-a/mfpu.vfpv3-d16/mfloat-abi.hard
+MULTILIB_REUSE += mthumb/march.armv7-a/mfpu.vfpv3-d16/mfloat-abi.softfp=mthumb/march.armv8-a/mfpu.vfpv3-d16/mfloat-abi.softfp
+MULTILIB_REUSE += mthumb/march.armv7-a/mfpu.vfpv3-d16/mfloat-abi.hard=mthumb/march.armv7-a/mfpu.vfpv4-d16/mfloat-abi.hard
+MULTILIB_REUSE += mthumb/march.armv7-a/mfpu.vfpv3-d16/mfloat-abi.softfp=mthumb/march.armv7-a/mfpu.vfpv4-d16/mfloat-abi.softfp
+MULTILIB_REUSE += mthumb/march.armv7-a/mfpu.vfpv3-d16/mfloat-abi.hard=mthumb/march.armv7-a/mfpu.fp-armv8/mfloat-abi.hard
+MULTILIB_REUSE += mthumb/march.armv7-a/mfpu.vfpv3-d16/mfloat-abi.softfp=mthumb/march.armv7-a/mfpu.fp-armv8/mfloat-abi.softfp
+MULTILIB_REUSE += mthumb/march.armv7-a/mfpu.vfpv3-d16/mfloat-abi.hard=mthumb/march.armv7-a/mfpu.vfpv4/mfloat-abi.hard
+MULTILIB_REUSE += mthumb/march.armv7-a/mfpu.vfpv3-d16/mfloat-abi.softfp=mthumb/march.armv7-a/mfpu.vfpv4/mfloat-abi.softfp
+
+
+MULTILIB_REUSE += mthumb/march.armv7-a/mfpu.neon/mfloat-abi.hard=mthumb/mcpu.cortex-a7/mfpu.neon/mfloat-abi.hard
+MULTILIB_REUSE += mthumb/march.armv7-a/mfpu.neon/mfloat-abi.softfp=mthumb/mcpu.cortex-a7/mfpu.neon/mfloat-abi.softfp
+MULTILIB_REUSE += mthumb/march.armv7-a/mfpu.neon/mfloat-abi.hard=mthumb/march.armv8-a/mfpu.neon/mfloat-abi.hard
+MULTILIB_REUSE += mthumb/march.armv7-a/mfpu.neon/mfloat-abi.softfp=mthumb/march.armv8-a/mfpu.neon/mfloat-abi.softfp
+MULTILIB_REUSE += mthumb/march.armv7-a/mfpu.neon/mfloat-abi.hard=mthumb/march.armv7-a/mfpu.neon-vfpv4/mfloat-abi.hard
+MULTILIB_REUSE += mthumb/march.armv7-a/mfpu.neon/mfloat-abi.softfp=mthumb/march.armv7-a/mfpu.neon-vfpv4/mfloat-abi.softfp
+MULTILIB_REUSE += mthumb/march.armv7-a/mfpu.neon/mfloat-abi.hard=mthumb/march.armv7-a/mfpu.neon-fp-armv8/mfloat-abi.hard
+MULTILIB_REUSE += mthumb/march.armv7-a/mfpu.neon/mfloat-abi.softfp=mthumb/march.armv7-a/mfpu.neon-fp-armv8/mfloat-abi.softfp
+
+
+MULTILIB_REUSE += mthumb/mcpu.cortex-a7/mfpu.vfpv4-d16/mfloat-abi.hard=mthumb/mcpu.cortex-a7/mfpu.fp-armv8/mfloat-abi.hard
+MULTILIB_REUSE += mthumb/mcpu.cortex-a7/mfpu.vfpv4-d16/mfloat-abi.softfp=mthumb/mcpu.cortex-a7/mfpu.fp-armv8/mfloat-abi.softfp
+MULTILIB_REUSE += mthumb/mcpu.cortex-a7/mfpu.vfpv4-d16/mfloat-abi.hard=mthumb/march.armv8-a/mfpu.vfpv4/mfloat-abi.hard
+MULTILIB_REUSE += mthumb/mcpu.cortex-a7/mfpu.vfpv4-d16/mfloat-abi.softfp=mthumb/march.armv8-a/mfpu.vfpv4/mfloat-abi.softfp
+MULTILIB_REUSE += mthumb/mcpu.cortex-a7/mfpu.vfpv4-d16/mfloat-abi.hard=mthumb/march.armv8-a/mfpu.vfpv4-d16/mfloat-abi.hard
+MULTILIB_REUSE += mthumb/mcpu.cortex-a7/mfpu.vfpv4-d16/mfloat-abi.softfp=mthumb/march.armv8-a/mfpu.vfpv4-d16/mfloat-abi.softfp
+
+
+MULTILIB_REUSE += mthumb/mcpu.cortex-a7/mfpu.neon-vfpv4/mfloat-abi.hard=mthumb/march.armv8-a/mfpu.neon-vfpv4/mfloat-abi.hard
+MULTILIB_REUSE += mthumb/mcpu.cortex-a7/mfpu.neon-vfpv4/mfloat-abi.softfp=mthumb/march.armv8-a/mfpu.neon-vfpv4/mfloat-abi.softfp
+MULTILIB_REUSE += mthumb/mcpu.cortex-a7/mfpu.neon-vfpv4/mfloat-abi.hard=mthumb/mcpu.cortex-a7/mfpu.neon-fp-armv8/mfloat-abi.hard
+MULTILIB_REUSE += mthumb/mcpu.cortex-a7/mfpu.neon-vfpv4/mfloat-abi.softfp=mthumb/mcpu.cortex-a7/mfpu.neon-fp-armv8/mfloat-abi.softfp
diff --git a/gcc/lower-subreg.c b/gcc/lower-subreg.c
index 05927e13b08..cc5c9587d1d 100644
--- a/gcc/lower-subreg.c
+++ b/gcc/lower-subreg.c
@@ -966,7 +966,20 @@ resolve_simple_move (rtx set, rtx insn)
rtx reg;
reg = gen_reg_rtx (orig_mode);
+
+#ifdef AUTO_INC_DEC
+ {
+ rtx move = emit_move_insn (reg, src);
+ if (MEM_P (src))
+ {
+ rtx note = find_reg_note (insn, REG_INC, NULL_RTX);
+ if (note)
+ add_reg_note (move, REG_INC, XEXP (note, 0));
+ }
+ }
+#else
emit_move_insn (reg, src);
+#endif
src = reg;
}
@@ -1056,6 +1069,16 @@ resolve_simple_move (rtx set, rtx insn)
mdest = simplify_gen_subreg (orig_mode, dest, GET_MODE (dest), 0);
minsn = emit_move_insn (real_dest, mdest);
+#ifdef AUTO_INC_DEC
+ if (MEM_P (real_dest)
+ && !(resolve_reg_p (real_dest) || resolve_subreg_p (real_dest)))
+ {
+ rtx note = find_reg_note (insn, REG_INC, NULL_RTX);
+ if (note)
+ add_reg_note (minsn, REG_INC, XEXP (note, 0));
+ }
+#endif
+
smove = single_set (minsn);
gcc_assert (smove != NULL_RTX);
diff --git a/gcc/testsuite/ChangeLog.linaro b/gcc/testsuite/ChangeLog.linaro
index 838025e91c7..2165e91c568 100644
--- a/gcc/testsuite/ChangeLog.linaro
+++ b/gcc/testsuite/ChangeLog.linaro
@@ -1,3 +1,10 @@
+2013-11-05 Zhenqiang Chen <zhenqiang.chen@linaro.org>
+
+ Backport from trunk r204247.
+ 2013-10-31 Zhenqiang Chen <zhenqiang.chen@linaro.org>
+
+ * gcc.target/arm/lp1243022.c: New test.
+
2013-11-04 Kugan Vivekanandarajah <kuganv@linaro.org>
Backport from trunk r204336
diff --git a/gcc/testsuite/gcc.target/arm/lp1243022.c b/gcc/testsuite/gcc.target/arm/lp1243022.c
new file mode 100644
index 00000000000..91a544d1b7d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/lp1243022.c
@@ -0,0 +1,201 @@
+/* { dg-do compile { target arm_thumb2 } } */
+/* { dg-options "-O2 -fdump-rtl-subreg2" } */
+
+/* { dg-final { scan-rtl-dump "REG_INC" "subreg2" } } */
+/* { dg-final { cleanup-rtl-dump "subreg2" } } */
+struct device;
+typedef unsigned int __u32;
+typedef unsigned long long u64;
+typedef __u32 __le32;
+typedef u64 dma_addr_t;
+typedef unsigned gfp_t;
+int dev_warn (const struct device *dev, const char *fmt, ...);
+struct usb_bus
+{
+ struct device *controller;
+};
+struct usb_hcd
+{
+ struct usb_bus self;
+};
+struct xhci_generic_trb
+{
+ __le32 field[4];
+};
+union xhci_trb
+{
+ struct xhci_generic_trb generic;
+};
+struct xhci_segment
+{
+ union xhci_trb *trbs;
+ dma_addr_t dma;
+};
+struct xhci_ring
+{
+ struct xhci_segment *first_seg;
+};
+struct xhci_hcd
+{
+ struct xhci_ring *cmd_ring;
+ struct xhci_ring *event_ring;
+};
+struct usb_hcd *xhci_to_hcd (struct xhci_hcd *xhci)
+{
+}
+dma_addr_t xhci_trb_virt_to_dma (struct xhci_segment * seg,
+ union xhci_trb * trb);
+struct xhci_segment *trb_in_td (struct xhci_segment *start_seg,
+ dma_addr_t suspect_dma);
+xhci_test_trb_in_td (struct xhci_hcd *xhci, struct xhci_segment *input_seg,
+ union xhci_trb *start_trb, union xhci_trb *end_trb,
+ dma_addr_t input_dma, struct xhci_segment *result_seg,
+ char *test_name, int test_number)
+{
+ unsigned long long start_dma;
+ unsigned long long end_dma;
+ struct xhci_segment *seg;
+ start_dma = xhci_trb_virt_to_dma (input_seg, start_trb);
+ end_dma = xhci_trb_virt_to_dma (input_seg, end_trb);
+ {
+ dev_warn (xhci_to_hcd (xhci)->self.controller,
+ "%d\n", test_number);
+ dev_warn (xhci_to_hcd (xhci)->self.controller,
+ "Expected seg %p, got seg %p\n", result_seg, seg);
+ }
+}
+xhci_check_trb_in_td_math (struct xhci_hcd *xhci, gfp_t mem_flags)
+{
+ struct
+ {
+ dma_addr_t input_dma;
+ struct xhci_segment *result_seg;
+ }
+ simple_test_vector[] =
+ {
+ {
+ 0, ((void *) 0)
+ }
+ ,
+ {
+ xhci->event_ring->first_seg->dma - 16, ((void *) 0)}
+ ,
+ {
+ xhci->event_ring->first_seg->dma - 1, ((void *) 0)}
+ ,
+ {
+ xhci->event_ring->first_seg->dma, xhci->event_ring->first_seg}
+ ,
+ {
+ xhci->event_ring->first_seg->dma + (64 - 1) * 16,
+ xhci->event_ring->first_seg
+ }
+ ,
+ {
+ xhci->event_ring->first_seg->dma + (64 - 1) * 16 + 1, ((void *) 0)}
+ ,
+ {
+ xhci->event_ring->first_seg->dma + (64) * 16, ((void *) 0)}
+ ,
+ {
+ (dma_addr_t) (~0), ((void *) 0)
+ }
+ };
+ struct
+ {
+ struct xhci_segment *input_seg;
+ union xhci_trb *start_trb;
+ union xhci_trb *end_trb;
+ dma_addr_t input_dma;
+ struct xhci_segment *result_seg;
+ }
+ complex_test_vector[] =
+ {
+ {
+ .input_seg = xhci->event_ring->first_seg,.start_trb =
+ xhci->event_ring->first_seg->trbs,.end_trb =
+ &xhci->event_ring->first_seg->trbs[64 - 1],.input_dma =
+ xhci->cmd_ring->first_seg->dma,.result_seg = ((void *) 0),
+ }
+ ,
+ {
+ .input_seg = xhci->event_ring->first_seg,.start_trb =
+ xhci->event_ring->first_seg->trbs,.end_trb =
+ &xhci->cmd_ring->first_seg->trbs[64 - 1],.input_dma =
+ xhci->cmd_ring->first_seg->dma,.result_seg = ((void *) 0),
+ }
+ ,
+ {
+ .input_seg = xhci->event_ring->first_seg,.start_trb =
+ xhci->cmd_ring->first_seg->trbs,.end_trb =
+ &xhci->cmd_ring->first_seg->trbs[64 - 1],.input_dma =
+ xhci->cmd_ring->first_seg->dma,.result_seg = ((void *) 0),
+ }
+ ,
+ {
+ .input_seg = xhci->event_ring->first_seg,.start_trb =
+ &xhci->event_ring->first_seg->trbs[0],.end_trb =
+ &xhci->event_ring->first_seg->trbs[3],.input_dma =
+ xhci->event_ring->first_seg->dma + 4 * 16,.result_seg = ((void *) 0),
+ }
+ ,
+ {
+ .input_seg = xhci->event_ring->first_seg,.start_trb =
+ &xhci->event_ring->first_seg->trbs[3],.end_trb =
+ &xhci->event_ring->first_seg->trbs[6],.input_dma =
+ xhci->event_ring->first_seg->dma + 2 * 16,.result_seg = ((void *) 0),
+ }
+ ,
+ {
+ .input_seg = xhci->event_ring->first_seg,.start_trb =
+ &xhci->event_ring->first_seg->trbs[64 - 3],.end_trb =
+ &xhci->event_ring->first_seg->trbs[1],.input_dma =
+ xhci->event_ring->first_seg->dma + 2 * 16,.result_seg = ((void *) 0),
+ }
+ ,
+ {
+ .input_seg = xhci->event_ring->first_seg,.start_trb =
+ &xhci->event_ring->first_seg->trbs[64 - 3],.end_trb =
+ &xhci->event_ring->first_seg->trbs[1],.input_dma =
+ xhci->event_ring->first_seg->dma + (64 - 4) * 16,.result_seg =
+ ((void *) 0),
+ }
+ ,
+ {
+ .input_seg = xhci->event_ring->first_seg,.start_trb =
+ &xhci->event_ring->first_seg->trbs[64 - 3],.end_trb =
+ &xhci->event_ring->first_seg->trbs[1],.input_dma =
+ xhci->cmd_ring->first_seg->dma + 2 * 16,.result_seg = ((void *) 0),
+ }
+ };
+ unsigned int num_tests;
+ int i, ret;
+ num_tests =
+ (sizeof (simple_test_vector) / sizeof ((simple_test_vector)[0]) +
+ (sizeof (struct
+ {
+ }
+ )));
+ for (i = 0; i < num_tests; i++)
+ {
+ ret =
+ xhci_test_trb_in_td (xhci, xhci->event_ring->first_seg,
+ xhci->event_ring->first_seg->trbs,
+ &xhci->event_ring->first_seg->trbs[64 - 1],
+ simple_test_vector[i].input_dma,
+ simple_test_vector[i].result_seg, "Simple", i);
+ if (ret < 0)
+ return ret;
+ }
+ for (i = 0; i < num_tests; i++)
+ {
+ ret =
+ xhci_test_trb_in_td (xhci, complex_test_vector[i].input_seg,
+ complex_test_vector[i].start_trb,
+ complex_test_vector[i].end_trb,
+ complex_test_vector[i].input_dma,
+ complex_test_vector[i].result_seg, "Complex", i);
+ if (ret < 0)
+ return ret;
+ }
+}