This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v2, i386]: Fix PR 63538, With -mcmodel=medium .lrodata accesses do not use 64-bit addresses


On Tue, Nov 4, 2014 at 10:47 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
> On Tue, Nov 4, 2014 at 10:46 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
>
>>> Following patch fixes PR 63538, where the data in the large data
>>> section was accessed through 32bit address. The patch unifies places
>>> where large data sections are determined and passes all declarations
>>> to ix86_in_large_data_p only.
>>>
>>> The patch fixes the testcase form the PR. Also, the code from several
>>> tests involving various -mlarge-data-threshold= settings looks
>>> consistent now.
>
> [...]
>
>> We probably want to avoid putting automatic variables (and STRING_CSTs
>> ?) to large data section. However, it is important that we use the
>> same condition in ix86_encode_section_info and
>> x86_64_elf_select_section (and likes), otherwise the data can go into
>> large section, while the access to the data will be via limited 32bit
>> pointers.
>>
>> The attached alternative patch rejects automatic variables and
>> STRING_CSTs from large data sections. Please note, that it still
>> access the data with the correct instructions.
>
> Considering that STRING_CSTs always have TREE_STATIC set, the patch
> should allow them, similar to the patch at [1].

Yes, it would be nice to be able to have STRING_CSTs in .lrodata.
Thanks for the patch.

Sri

>
> Attached is the final patch.
>
> 2014-11-04  Uros Bizjak  <ubizjak@gmail.com>
>
>     PR target/63538
>     * config/i386/i386.c (in_large_data_p): Reject automatic variables.
>     (ix86_encode_section_info): Do not check for non-automatic varibles
>     when setting SYMBOL_FLAG_FAR_ADDR flag.
>     (x86_64_elf_select_section): Do not check ix86_cmodel here.
>     (x86_64_elf_unique_section): Ditto.
>     (x86_elf_aligned_common): Emit tab before .largecomm.
>
> testsuite/ChangeLog:
>
> 2014-11-03  Uros Bizjak  <ubizjak@gmail.com>
>
>     PR target/63538
>     * gcc.target/i386/pr63538.c: New test.
>
> I plan to commit the patch in a couple of days to mainline and 4.9 branch.
>
> [1] https://gcc.gnu.org/ml/gcc-patches/2014-10/msg01963.html
>
> Uros.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]