This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch, avr] Fix PR 71151
- From: Senthil Kumar Selvaraj <senthil_kumar dot selvaraj at atmel dot com>
- To: Georg-Johann Lay <avr at gjlay dot de>
- Cc: <gcc-patches at gcc dot gnu dot org>, Denis Chertykov <chertykov at gmail dot com>
- Date: Sun, 19 Jun 2016 11:48:49 +0530
- Subject: Re: [Patch, avr] Fix PR 71151
- Authentication-results: sourceware.org; auth=none
- References: <87y46m1h3y dot fsf at atmel dot com> <5763F43D dot 8080306 at gjlay dot de>
Georg-Johann Lay writes:
> Senthil Kumar Selvaraj schrieb:
>> Hi,
>>
>> This patch fixes PR 71151 by eliminating the
>> TARGET_ASM_FUNCTION_RODATA_SECTION hook and setting
>> JUMP_TABLES_IN_TEXT_SECTION to 1.
>>
>> As described in the bugzilla entry, this hook assumed it will get
>> called only for jumptable rodata for functions. This was true until
>> 6.1, when a commit in varasm.c started calling the hook for mergeable
>> string/constant data as well.
>>
>> This resulted in string constants ending up in a section intended for
>> jumptables (flash), and broke code using those constants, which
>> expects them to be present in rodata (SRAM).
>>
>> Given that the original reason for placing jumptables in a section was
>> fixed by Johann in PR 63323, this patch restores the original
>> behavior. Reg testing on both gcc-6-branch and trunk showed no regressions.
>>
>> As pointed out by Johann, this may end up increasing code
>> size if there are lots of branches that cross the jump tables. I
>> intend to propose a separate patch that gives additional information
>> to the target hook (SECCAT_RODATA_{STRING,JUMPTABLE}) so it can know
>> what type of function rodata is coming on. Johann also suggested
>> handling jump table generation ourselves - I'll experiment with that
>> some more.
>>
>> If ok, could someone commit please? Could you also backport to
>> gcc-6-branch?
>>
>> Regards
>> Senthil
>>
>> gcc/ChangeLog
>>
>> 2016-06-03 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
>>
>
> Missing PR target/71151
>
>> * config/avr/avr.c (avr_asm_function_rodata_section): Remove.
>> * config/avr/avr.c (TARGET_ASM_FUNCTION_RODATA_SECTION): Remove.
>>
>> gcc/testsuite/ChangeLog
>>
>> 2016-06-03 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
>>
>
> Missing PR target/71151
>
>> * gcc/testsuite/gcc.target/avr/pr71151-1.c: New.
>> * gcc/testsuite/gcc.target/avr/pr71151-2.c: New.
>>
Sorry I missed that. Is it ok to modify the entry alone again?
I just started using the mklog perl script from gcc/contrib
instead of writing the entries by hand - I didn't realize
that script doesn't know about PRs.
Regards
Senthil