This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Problem with ARM longcalls
- From: Richard Guenther <richard dot guenther at gmail dot com>
- To: Bernd Schmidt <bernds at codesourcery dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 14 Apr 2011 15:00:38 +0200
- Subject: Re: Problem with ARM longcalls
- References: <4D8A15E2.5020005@codesourcery.com> <4DA6EB5A.8010606@codesourcery.com>
On Thu, Apr 14, 2011 at 2:40 PM, Bernd Schmidt <bernds@codesourcery.com> wrote:
> Ping. ?Contains only changes outside config/arm.
>
> http://gcc.gnu.org/m/gcc-patches/2011-03/msg01509.html
Ok.
Thanks,
Richard.
>
> Bernd
>
> On 03/23/2011 04:46 PM, Bernd Schmidt wrote:
>> I've discovered a problem with -mlong-calls on ARM. The bug was first
>> reported against a new target, but I'd copied the relevant code from the
>> ARM backend.
>>
>> We use current_function_section in arm_is_long_call_p to decide whether
>> we're calling something that goes into the same section. The problem
>> with this is that current_function_section can only be used during
>> final, since it relies on the global variable in_cold_section_p which is
>> set up only in assemble_start_function. On ARM, this problem manifests
>> as short-calls when a long-call would be required; in the other port it
>> was an "insn doesn't satisfy its constraints" error.
>>
>> The following patch is against 4.5, since the problem appears hidden in
>> mainline (the initialization of first_function_block_is_cold has
>> changed). Ok for trunk and branches after arm-linux tests complete?
>
>> ? ? ? * function.c (init_function_start): Call decide_function_section.
>> ? ? ? * varasm.c (decide_function_section): New function.
>> ? ? ? (assemble_start_function): When not using
>> ? ? ? flag_reorder_blocks_and_partition, don't compute in_cold_section_p
>> ? ? ? or first_function_block_is_cold.
>> ? ? ? * rtl.h (decide_function_section): Declare.
>>
>> ? ? ? * gcc.target/arm/cold-lc.c: New test.
>