Message ID | 554A23B6.8070606@st.com |
---|---|
State | New |
Headers | show |
On 06/05/15 15:22, Christian Bruel wrote: > Re-implement ARM_DECLARE_FUNCTION_NAME as a function. That will make > changed related to unified/divided and mode directives easier to insert. Patch could be smaller as below. > > Thanks > > Christian > > 2014-09-23 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. > > diff '--exclude=.svn' -ruN gnu_trunk.p2/gcc/gcc/config/arm/arm.c gnu_trunk.p3/gcc/gcc/config/arm/arm.c > --- gnu_trunk.p2/gcc/gcc/config/arm/arm.c 2015-05-06 14:27:41.042302661 +0200 > +++ gnu_trunk.p3/gcc/gcc/config/arm/arm.c 2015-05-06 14:31:48.750726995 +0200 > @@ -23451,6 +23451,23 @@ > fprintf (f, "}\n"); > } > > +/* Return nonzero if FUNC must be entered in ARM mode. */ > +static bool > +is_called_in_ARM_mode (tree func) > +{ > + gcc_assert (TREE_CODE (func) == FUNCTION_DECL); > + > + /* Ignore the problem about functions whose address is taken. */ > + if (TARGET_CALLEE_INTERWORKING && TREE_PUBLIC (func)) > + return true; > + > +#ifdef ARM_PE > + return lookup_attribute ("interfacearm", DECL_ATTRIBUTES (func)) != NULL_TREE; > +#else > + return false; > +#endif > +} > + > /* Generate code to return from a thumb function. > If 'reg_containing_return_addr' is -1, then the return address is > actually on the stack, at the stack pointer. */ > @@ -23886,22 +23903,6 @@ > return 0; > } > > -/* Return nonzero if FUNC must be entered in ARM mode. */ > -int > -is_called_in_ARM_mode (tree func) > -{ > - gcc_assert (TREE_CODE (func) == FUNCTION_DECL); > - > - /* Ignore the problem about functions whose address is taken. */ > - if (TARGET_CALLEE_INTERWORKING && TREE_PUBLIC (func)) > - return TRUE; > - > -#ifdef ARM_PE > - return lookup_attribute ("interfacearm", DECL_ATTRIBUTES (func)) != NULL_TREE; > -#else > - return FALSE; > -#endif > -} Instead of moving this around , just redefine with static bool. > > /* Given the stack offsets and register mask in OFFSETS, decide how > many additional registers to push instead of subtracting a constant > @@ -29270,6 +29271,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); > +} > + Move to end of file. > /* 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. */ > @@ -29390,4 +29410,5 @@ > *pri = tmp; > return; > } > + > #include "gt-arm.h" > diff '--exclude=.svn' -ruN gnu_trunk.p2/gcc/gcc/config/arm/arm.h gnu_trunk.p3/gcc/gcc/config/arm/arm.h > --- gnu_trunk.p2/gcc/gcc/config/arm/arm.h 2015-05-06 14:27:45.362310057 +0200 > +++ gnu_trunk.p3/gcc/gcc/config/arm/arm.h 2015-05-06 14:31:48.750726995 +0200 > @@ -2157,23 +2157,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) \ > diff '--exclude=.svn' -ruN gnu_trunk.p2/gcc/gcc/config/arm/arm-protos.h gnu_trunk.p3/gcc/gcc/config/arm/arm-protos.h > --- gnu_trunk.p2/gcc/gcc/config/arm/arm-protos.h 2015-05-06 14:27:45.362310057 +0200 > +++ gnu_trunk.p3/gcc/gcc/config/arm/arm-protos.h 2015-05-06 14:31:48.750726995 +0200 > @@ -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); Ok with those changes. Ramana
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
Hi Ramana, You've already approved [3/6] (https://gcc.gnu.org/ml/gcc-patches/2015-05/msg00524.html) 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 >
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 ;) 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 >> >
2014-09-23 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. diff '--exclude=.svn' -ruN gnu_trunk.p2/gcc/gcc/config/arm/arm.c gnu_trunk.p3/gcc/gcc/config/arm/arm.c --- gnu_trunk.p2/gcc/gcc/config/arm/arm.c 2015-05-06 14:27:41.042302661 +0200 +++ gnu_trunk.p3/gcc/gcc/config/arm/arm.c 2015-05-06 14:31:48.750726995 +0200 @@ -23451,6 +23451,23 @@ fprintf (f, "}\n"); } +/* Return nonzero if FUNC must be entered in ARM mode. */ +static bool +is_called_in_ARM_mode (tree func) +{ + gcc_assert (TREE_CODE (func) == FUNCTION_DECL); + + /* Ignore the problem about functions whose address is taken. */ + if (TARGET_CALLEE_INTERWORKING && TREE_PUBLIC (func)) + return true; + +#ifdef ARM_PE + return lookup_attribute ("interfacearm", DECL_ATTRIBUTES (func)) != NULL_TREE; +#else + return false; +#endif +} + /* Generate code to return from a thumb function. If 'reg_containing_return_addr' is -1, then the return address is actually on the stack, at the stack pointer. */ @@ -23886,22 +23903,6 @@ return 0; } -/* Return nonzero if FUNC must be entered in ARM mode. */ -int -is_called_in_ARM_mode (tree func) -{ - gcc_assert (TREE_CODE (func) == FUNCTION_DECL); - - /* Ignore the problem about functions whose address is taken. */ - if (TARGET_CALLEE_INTERWORKING && TREE_PUBLIC (func)) - return TRUE; - -#ifdef ARM_PE - return lookup_attribute ("interfacearm", DECL_ATTRIBUTES (func)) != NULL_TREE; -#else - return FALSE; -#endif -} /* Given the stack offsets and register mask in OFFSETS, decide how many additional registers to push instead of subtracting a constant @@ -29270,6 +29271,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. */ @@ -29390,4 +29410,5 @@ *pri = tmp; return; } + #include "gt-arm.h" diff '--exclude=.svn' -ruN gnu_trunk.p2/gcc/gcc/config/arm/arm.h gnu_trunk.p3/gcc/gcc/config/arm/arm.h --- gnu_trunk.p2/gcc/gcc/config/arm/arm.h 2015-05-06 14:27:45.362310057 +0200 +++ gnu_trunk.p3/gcc/gcc/config/arm/arm.h 2015-05-06 14:31:48.750726995 +0200 @@ -2157,23 +2157,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) \ diff '--exclude=.svn' -ruN gnu_trunk.p2/gcc/gcc/config/arm/arm-protos.h gnu_trunk.p3/gcc/gcc/config/arm/arm-protos.h --- gnu_trunk.p2/gcc/gcc/config/arm/arm-protos.h 2015-05-06 14:27:45.362310057 +0200 +++ gnu_trunk.p3/gcc/gcc/config/arm/arm-protos.h 2015-05-06 14:31:48.750726995 +0200 @@ -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);