This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, ARM] attribute target (thumb,arm) [3/6] respin (4th)
- From: Christian Bruel <christian dot bruel at st dot com>
- To: "ramrad01 at arm dot com" <ramrad01 at arm dot com>
- Cc: Ramana Radhakrishnan <ramana dot radhakrishnan at arm dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Richard Earnshaw <Richard dot Earnshaw at arm dot com>, "nickc at redhat dot com" <nickc at redhat dot com>
- Date: Mon, 1 Jun 2015 13:19:16 +0200
- Subject: Re: [PATCH, ARM] attribute target (thumb,arm) [3/6] respin (4th)
- Authentication-results: sourceware.org; auth=none
- References: <554A23B6 dot 8070606 at st dot com> <554B27DD dot 60407 at arm dot com> <5550699A dot 3040000 at st dot com> <CAJA7tRa7w_JX-oHoevhx-7xYi+ewrW8cjm=opaJPbsZKnP3Kqw at mail dot gmail dot com> <556C3486 dot 1080505 at st dot com> <CAJA7tRaSpkD5pF=uyJRp0Fv0tjL2wCVyFqbL4quGrowU2OpAdg at mail dot gmail dot com>
On 06/01/2015 01:09 PM, Ramana Radhakrishnan wrote:
On Mon, Jun 1, 2015 at 11:31 AM, Christian Bruel <christian.bruel@st.com> wrote:
Hi Ramana,
You've already approved [3/6]
(https://gcc.gnu.org/ml/gcc-patches/2015-05/msg00524.html)
Yes I know, but all patches that get committed need to be archived on
the lists according to policy. So, can you please send the patch
you've applied (or plan to apply) to the list for archival purposes.
Since there was a response, I thought there would be a patch in the
attachment ;)
sorry, my mistake and my confusion.
here is the committed patch at rev #222997.
Christian
Ramana
remains:
(4 /6) https://gcc.gnu.org/ml/gcc-patches/2015-05/msg01537.html
(5.1/6) https://gcc.gnu.org/ml/gcc-patches/2015-05/msg01539.html
(5.2/6) https://gcc.gnu.org/ml/gcc-patches/2015-05/msg01558.html
(6 /6) https://gcc.gnu.org/ml/gcc-patches/2015-05/msg01542.html
Cheers
Christian
On 06/01/2015 11:53 AM, Ramana Radhakrishnan wrote:
2015-05-11 9:49 GMT+01:00 Christian Bruel <christian.bruel@st.com>:
-----BEGIN PGP MESSAGE-----
Version: GnuPG v1.4.11 (GNU/Linux)
hQIOA7kay12Fw5I3EAf/dJLl6z88mNVga3f+gsF8SKunpHWh+OsNTdg0zovUsPH/
YX1l86qL92we5htdf86j8rKTOH9PdOQCITsAnwKecWgpas5cGV4s2LHcbX/wQyl4
UGnVaQhDrGZputPDjJkaysrX+aI/Tv0JWBm7XZE5pyTRN6ngm/kZZlOobe9kgOaK
6z3uUo1wxm0McKXqJ+Jfvk6mB24vONkVZQXrwgAUg/vwpM4hWxz/xIVr433co1G1
6LilcTmN1Ja6XcvItlp6VWBrxoUta3q2USRaVJRwWnrzph21Cc7PQyhT7tECbCz1
yQhjd5P2i7iBggvmP+yw3mKE/tffXJVZpM1Bivu78Qf+LdwwaMVYH5GBJX3JJ3as
ee8vJ2hZnPLIhVNqNSS1yRAOVLCa9ALjtyg9OAU/rLL3SHHNCIie6EOnPBpwmbNV
7UI6VWqfNK1b/+O7Me6DyJXMQvcCudR93BARdGV5+5reBtA1IEBt6EIKs20242hs
otb44M9po/2LuD6L9nsoy1wE43F3sOset53BaHo3Ui1KmhCtELVSs7uRdP5yZWbw
L6DBz1KTRijZ0jHBRmpm9xZNFkAZIbzBfU2iJsaf2+RY2FDjEO7gliTXyPIL8P5h
bfVwQ+MHAuQozTu5/tPQVfPreTkEMMnMPsunXVm6yEbR/Ix23Esgeg3xVAK3flES
qNLATAE6l7CC3LrN3jEo6VoSIE0qB6P6SKe3BhAqMplncMWhPM+Xi0vP++nXUS07
CT4YoxiwkpzLzYQ91hh4mxM16Z8S5wbL7aYKLMe7OXU0ejCvpmmtV2tELoxe1zXh
TEoPJo1SQB3LAhSRxHZwK03ticu0Ptr8b9oevxmMbPvl/mW7VWXoe7MCQZ/aPTbq
yCaJlDdBHYK2pgt4wept3XP6MRMo02PTFvQIHi/Bt3L4E+n/8ig6VX0dkIka/ieK
476eWuLSDfzMMdzlvvkhDCC6aT6Q/9ie59sBKchE1ALbTP0GPaI7hqI+3raTLv6U
CGtpfTksJ5nqj3OMXMtLk0yJ1lzt5D8924izGhS87m8=
=pSpa
-----END PGP MESSAGE-----
Missing patch ?
Ramana
Index: gcc/ChangeLog
===================================================================
--- gcc/ChangeLog (revision 222996)
+++ gcc/ChangeLog (revision 222997)
@@ -1,5 +1,14 @@
2015-05-11 Christian Bruel <christian.bruel@st.com>
+ * config/arm/arm-protos.h (arm_declare_function_name): Declare.
+ (is_called_in_ARM_mode): Remove.
+ * config/arm/arm.c (is_called_in_ARM_mode): Declare static bool.
+ (arm_declare_function_name): Moved from from ARM_DECLARE_FUNCTION_NAME.
+ * config/arm/arm.h (ARM_DECLARE_FUNCTION_NAME): Call
+ arm_declare_function_name.
+
+2015-05-11 Christian Bruel <christian.bruel@st.com>
+
* config/arm/arm.c (arm_option_override): Reoganized and split into :
(arm_option_params_internal); New function.
(arm_option_check_internal): New function.
Index: gcc/config/arm/arm.c
===================================================================
--- gcc/config/arm/arm.c (revision 222996)
+++ gcc/config/arm/arm.c (revision 222997)
@@ -121,6 +121,7 @@
static unsigned bit_count (unsigned long);
static int arm_address_register_rtx_p (rtx, int);
static int arm_legitimate_index_p (machine_mode, rtx, RTX_CODE, int);
+static bool is_called_in_ARM_mode (tree);
static int thumb2_legitimate_index_p (machine_mode, rtx, int);
static int thumb1_base_register_rtx_p (rtx, machine_mode, int);
static rtx arm_legitimize_address (rtx, rtx, machine_mode);
@@ -23851,7 +23852,7 @@
}
/* Return nonzero if FUNC must be entered in ARM mode. */
-int
+static bool
is_called_in_ARM_mode (tree func)
{
gcc_assert (TREE_CODE (func) == FUNCTION_DECL);
@@ -23858,12 +23859,12 @@
/* Ignore the problem about functions whose address is taken. */
if (TARGET_CALLEE_INTERWORKING && TREE_PUBLIC (func))
- return TRUE;
+ return true;
#ifdef ARM_PE
return lookup_attribute ("interfacearm", DECL_ATTRIBUTES (func)) != NULL_TREE;
#else
- return FALSE;
+ return false;
#endif
}
@@ -29233,6 +29234,25 @@
&& CONSTANT_POOL_ADDRESS_P (XEXP (x, 0)));
}
+void
+arm_declare_function_name (FILE *stream, const char *name, tree decl)
+{
+ if (TARGET_THUMB)
+ {
+ if (is_called_in_ARM_mode (decl)
+ || (TARGET_THUMB1 && !TARGET_THUMB1_ONLY
+ && cfun->is_thunk))
+ fprintf (stream, "\t.code 32\n");
+ else if (TARGET_THUMB1)
+ fprintf (stream, "\t.code\t16\n\t.thumb_func\n");
+ else
+ fprintf (stream, "\t.thumb\n\t.thumb_func\n");
+ }
+
+ if (TARGET_POKE_FUNCTION_NAME)
+ arm_poke_function_name (stream, (const char *) name);
+}
+
/* If MEM is in the form of [base+offset], extract the two parts
of address and set to BASE and OFFSET, otherwise return false
after clearing BASE and OFFSET. */
Index: gcc/config/arm/arm.h
===================================================================
--- gcc/config/arm/arm.h (revision 222996)
+++ gcc/config/arm/arm.h (revision 222997)
@@ -2183,23 +2183,7 @@
? 1 : 0)
#define ARM_DECLARE_FUNCTION_NAME(STREAM, NAME, DECL) \
- do \
- { \
- if (TARGET_THUMB) \
- { \
- if (is_called_in_ARM_mode (DECL) \
- || (TARGET_THUMB1 && !TARGET_THUMB1_ONLY \
- && cfun->is_thunk)) \
- fprintf (STREAM, "\t.code 32\n") ; \
- else if (TARGET_THUMB1) \
- fprintf (STREAM, "\t.code\t16\n\t.thumb_func\n") ; \
- else \
- fprintf (STREAM, "\t.thumb\n\t.thumb_func\n") ; \
- } \
- if (TARGET_POKE_FUNCTION_NAME) \
- arm_poke_function_name (STREAM, (const char *) NAME); \
- } \
- while (0)
+ arm_declare_function_name ((STREAM), (NAME), (DECL));
/* For aliases of functions we use .thumb_set instead. */
#define ASM_OUTPUT_DEF_FROM_DECLS(FILE, DECL1, DECL2) \
Index: gcc/config/arm/arm-protos.h
===================================================================
--- gcc/config/arm/arm-protos.h (revision 222996)
+++ gcc/config/arm/arm-protos.h (revision 222997)
@@ -30,6 +30,7 @@
extern int arm_volatile_func (void);
extern void arm_expand_prologue (void);
extern void arm_expand_epilogue (bool);
+extern void arm_declare_function_name (FILE *, const char *, tree);
extern void thumb2_expand_return (bool);
extern const char *arm_strip_name_encoding (const char *);
extern void arm_asm_output_labelref (FILE *, const char *);
@@ -181,9 +182,6 @@
extern void thumb1_expand_prologue (void);
extern void thumb1_expand_epilogue (void);
extern const char *thumb1_output_interwork (void);
-#ifdef TREE_CODE
-extern int is_called_in_ARM_mode (tree);
-#endif
extern int thumb_shiftable_const (unsigned HOST_WIDE_INT);
#ifdef RTX_CODE
extern enum arm_cond_code maybe_get_arm_condition_code (rtx);