On 25/02/15 10:42, Terry Guo wrote:
-----Original Message-----
From: gcc-patches-ow...@gcc.gnu.org [mailto:gcc-patches-
ow...@gcc.gnu.org] On Behalf Of Richard Earnshaw
Sent: Wednesday, February 18, 2015 2:45 AM
To: Terry Guo; gcc-patches@gcc.gnu.org
Cc: Richard Earnshaw; Ramana Radhakrishnan
Subject: Re: [Patch][ARM]Don't put volatile memory access in IT block for
cortex-m7
On 12/02/15 11:12, Terry Guo wrote:
Hi there,
This patch intends to prevent gcc from putting volatile memory access
into IT block for target like cortex-m7.
gcc/ChangeLog:
2015-02-12 Terry Guo <terry....@arm.com>
* config/arm/arm.c (arm_tune_cortex_m7): New global variable.
* config/arm/arm.h (TARGET_NO_VOLATILE_CE): New macro.
(arm_tune_cortex_m7): Declare new global variable.
* config/arm/arm.md (arm_comparison_operator): Disabled if not
allow
volatile memory access in IT block.
gcc/testsuite/ChangeLog:
2015-02-12 Terry Guo <terry....@arm.com>
* gcc.target/arm/cortex-m7-it-volatile.c: New test.
Not ok.
+/* Targets that don't support accessing volatile memory inside IT
block. */
+#define TARGET_NO_VOLATILE_CE (arm_tune_cortex_m7)
Please don't create feature bits that explicitly test for a particular target.
Instead, define generic 'features' and then arrange for either the
architecture tables, or tuning tables (as appropriate) to enable that feature.
See how arm_arch_arm_hwdiv is defined for how to do this.
R.
Thanks Richard. Patch is updated per your suggestion. Is this one OK for
current stage and 4.8/4.9?
This is OK for trunk. I suggest you let it gestate there for a few days
before doing back-ports.
R.
BR,
Terry
gcc/testsuite/ChangeLog:
2015-02-25 Terry Guo <terry....@arm.com>
* gcc.target/arm/no-volatile-in-it.c: New test.
gcc/ChangeLog:
2015-02-25 Terry Guo <terry....@arm.com>
* config/arm/arm-cores.def (cortex-m7): Add flag FL_NO_VOLATILE_CE.
* config/arm/arm-protos.h (FL_NO_VOLATILE_CE): New flag.
(arm_arch_no_volatile_ce): Declare new global variable.
* config/arm/arm.c (arm_arch_no_volatile_ce): Define new global variable.
(arm_option_override): Assign value to arm_arch_no_volatile_ce.
* config/arm/arm.h (arm_arch_no_volatile_ce): Declare it.
(TARGET_NO_VOLATILE_CE): New macro.
* config/arm/arm.md (arm_comparison_operator): Disabled if not allow
volatile memory access in IT block