This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH ARM v3] PR69770 -mlong-calls does not affect calls to __gnu_mcount_nc generated by -pg
- From: Christophe Lyon <christophe dot lyon at linaro dot org>
- To: Charles Baylis <charles dot baylis at linaro dot org>
- Cc: Kugan <kugan dot vivekanandarajah at linaro dot org>, Kyrylo Tkachov <kyrylo dot tkachov at arm dot com>, Ramana Radhakrishnan <Ramana dot Radhakrishnan at arm dot com>, Richard Earnshaw <Richard dot Earnshaw at arm dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 29 Mar 2016 15:03:23 +0200
- Subject: Re: [PATCH ARM v3] PR69770 -mlong-calls does not affect calls to __gnu_mcount_nc generated by -pg
- Authentication-results: sourceware.org; auth=none
- References: <CADnVucDrK4LXBEwEEVJi8fNre42LvyqOx+PjHY18SyhK11fMtQ at mail dot gmail dot com>
On 29 March 2016 at 13:41, Charles Baylis <charles.baylis@linaro.org> wrote:
> On 29 March 2016 at 02:16, Kugan <kugan.vivekanandarajah@linaro.org> wrote:
>>
>> Hi Charles,
>>
>> +static void
>> +arm_emit_long_call_profile_insn ()
>> +{
>> + rtx sym_ref = gen_rtx_SYMBOL_REF (Pmode, "__gnu_mcount_nc");
>> + /* if movt/movw are not available, use a constant pool */
>> + if (!arm_arch_thumb2)
>>
>> Should this be !TARGET_USE_MOVT?
>
> Hi Kugan,
>
> Thanks for the review.
>
> TARGET_USE_MOVT has additional conditions which mean that it can be
> false on targets with MOVW/MOVT depending on the tuning parameters for
> the target CPU. Because this patch works in a slightly odd way, I
> think it is better to use MOVW/MOVT where possible so that the
> slightly hacky use of the literal pool is avoided. Since this only
> happens when profiling, it is not essential to have the fully
> optimised code sequence here. I'm happy to change it if anybody feels
> strongly though.
>
> I've noticed in the quoted snippet that there are some GNU coding
> style errors, so I've respun the patch with those corrected.
>
> gcc/ChangeLog:
>
> 2016-03-29 Charles Baylis <charles.baylis@linaro.org>
>
> * config/arm/arm-protos.h (arm_emit_long_call_profile): New function.
> * config/arm/arm.c (arm_emit_long_call_profile_insn): New function.
> (arm_expand_prologue): Likewise.
> (thumb1_expand_prologue): Likewise.
> (arm_output_long_call_to_profile_func): Likewise.
> (arm_emit_long_call_profile): Likewise.
> * config/arm/arm.h: (ASM_OUTPUT_REG_PUSH) Update comment.
> * config/arm/arm.md (arm_long_call_profile): New pattern.
> * config/arm/bpabi.h (ARM_FUNCTION_PROFILER_SUPPORTS_LONG_CALLS): New
> define.
> * config/arm/thumb1.md (thumb1_long_call_profile): New pattern.
Hi Charles,
In thumb1.md, I noticed:
@@ -1798,7 +1798,7 @@
[(unspec_volatile [(match_operand:SI 0 "s_register_operand" "l")]
VUNSPEC_EH_RETURN)
(clobber (match_scratch:SI 1 "=&l"))]
- "TARGET_THUMB1"
+ "TARGET_THUMB1 && 0"
"#"
"&& reload_completed"
[(const_int 0)]
which looks like an artifact of WIP.
> * config/arm/unspecs.md (unspecv): Add VUNSPEC_LONG_CALL_PROFILE.
>
> gcc/testsuite/ChangeLog:
>
> 2016-03-29 Charles Baylis <charles.baylis@linaro.org>
>
> * gcc.target/arm/pr69770.c: New test.