Re: [PATCH v2] ARM: Introduce ARM_DEFAULT_SHORT_ENUMS

2017-04-05 Thread Sebastian Huber
- Sebastian Huber  schrieb:
> Allow targets to define the default for the short enums option.
> 
> v2: Move ARM_DEFAULT_SHORT_ENUMS to arm.h.
> 
> gcc/
> 
>   * config/arm/arm.h: (ARM_DEFAULT_SHORT_ENUMS): Provide default
>   definition.
>   * config/arm/arm.c: (arm_default_short_enums): Use
>   ARM_DEFAULT_SHORT_ENUMS.
>   * config/arm/rtems.h (ARM_DEFAULT_SHORT_ENUMS) Define.

Its not a regression fix, so not really appropriate for the current stage of 
GCC 7 and the GCC 6 release branch, but is only a cosmetic change for all ARM 
variants except RTEMS. RTEMS releases are tied to a particular GCC version. We 
would like to use GCC 6.4 for the upcoming RTEMS 4.12 release.

If nobody objects I will commit this on Friday with corresponding release notes:

Index: htdocs/gcc-6/changes.html
===
RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-6/changes.html,v
retrieving revision 1.98
diff -u -r1.98 changes.html
--- htdocs/gcc-6/changes.html   18 Mar 2017 22:38:29 -  1.98
+++ htdocs/gcc-6/changes.html   5 Apr 2017 18:04:32 -
@@ -891,6 +891,22 @@
 
href="https://software.intel.com/en-us/blogs/2016/09/12/deprecate-pcommit-instruction;>deprecated
 pcommit instruction has been removed.
   
+
+
  
 
 
cvs diff: Diffing htdocs/gcc-7
Index: htdocs/gcc-7/changes.html
===
RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-7/changes.html,v
retrieving revision 1.73
diff -u -r1.73 changes.html
--- htdocs/gcc-7/changes.html   22 Mar 2017 16:25:11 -  1.73
+++ htdocs/gcc-7/changes.html   5 Apr 2017 18:04:32 -
@@ -1043,7 +1043,10 @@
 
 
 
-
+RTEMS
+   
+ The ABI changes on ARM so that no short enums are used by 
default.
+   
 
 
 

-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax : +49 89 189 47 41-09
E-Mail  : sebastian.huber at embedded-brains.de
PGP : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.


[PATCH v2] ARM: Introduce ARM_DEFAULT_SHORT_ENUMS

2017-04-04 Thread Sebastian Huber
Allow targets to define the default for the short enums option.

v2: Move ARM_DEFAULT_SHORT_ENUMS to arm.h.

gcc/

* config/arm/arm.h: (ARM_DEFAULT_SHORT_ENUMS): Provide default
definition.
* config/arm/arm.c: (arm_default_short_enums): Use
ARM_DEFAULT_SHORT_ENUMS.
* config/arm/rtems.h (ARM_DEFAULT_SHORT_ENUMS) Define.
---
 gcc/config/arm/arm.c   | 3 +--
 gcc/config/arm/arm.h   | 6 ++
 gcc/config/arm/rtems.h | 2 ++
 3 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index bc1e607..8f45bb9 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -26546,12 +26546,11 @@ arm_promote_function_mode (const_tree type 
ATTRIBUTE_UNUSED,
   return mode;
 }
 
-/* AAPCS based ABIs use short enums by default.  */
 
 static bool
 arm_default_short_enums (void)
 {
-  return TARGET_AAPCS_BASED && arm_abi != ARM_ABI_AAPCS_LINUX;
+  return ARM_DEFAULT_SHORT_ENUMS;
 }
 
 
diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h
index 4dab73d..275004a 100644
--- a/gcc/config/arm/arm.h
+++ b/gcc/config/arm/arm.h
@@ -343,6 +343,12 @@ extern int arm_fpu_attr;
 #define ARM_DEFAULT_ABI ARM_ABI_APCS
 #endif
 
+/* AAPCS based ABIs use short enums by default.  */
+#ifndef ARM_DEFAULT_SHORT_ENUMS
+#define ARM_DEFAULT_SHORT_ENUMS \
+  (TARGET_AAPCS_BASED && arm_abi != ARM_ABI_AAPCS_LINUX)
+#endif
+
 /* Map each of the micro-architecture variants to their corresponding
major architecture revision.  */
 
diff --git a/gcc/config/arm/rtems.h b/gcc/config/arm/rtems.h
index 53cd987..b34bbe8 100644
--- a/gcc/config/arm/rtems.h
+++ b/gcc/config/arm/rtems.h
@@ -27,3 +27,5 @@
builtin_assert ("system=rtems");\
TARGET_BPABI_CPP_BUILTINS();\
 } while (0)
+
+#define ARM_DEFAULT_SHORT_ENUMS false
-- 
1.8.4.5