This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: PR target/63815: [5 Regression] g++.dg/other/pr53811.C fails with -mcmodel=large -fpic
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Uros Bizjak <ubizjak at gmail dot com>
- Date: Wed, 12 Nov 2014 13:11:40 -0800
- Subject: Re: PATCH: PR target/63815: [5 Regression] g++.dg/other/pr53811.C fails with -mcmodel=large -fpic
- Authentication-results: sourceware.org; auth=none
- References: <20141112204317 dot GA13104 at intel dot com> <20141112210249 dot GQ5026 at tucnak dot redhat dot com>
On Wed, Nov 12, 2014 at 1:02 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> On Wed, Nov 12, 2014 at 12:43:17PM -0800, H.J. Lu wrote:
>> @@ -42686,8 +42692,12 @@ x86_output_mi_thunk (FILE *file, tree, HOST_WIDE_INT delta,
>> else
>> {
>> if (ix86_cmodel == CM_LARGE_PIC && SYMBOLIC_CONST (fnaddr))
>> - fnaddr = legitimize_pic_address (fnaddr,
>> - gen_rtx_REG (Pmode, tmp_regno));
>> + {
>> + SET_REGNO (pic_offset_table_rtx, R11_REG);
>
> If pic_offset_table_rtx has never been initialized, how you can use
It is a pseudo PIC register which is uninitialized:
(gdb) call debug_rtx (this_target_rtl->x_pic_offset_table_rtx)
(reg:DI 89)
(gdb)
> SET_REGNO on it? Shouldn't that be pic_offset_table_rtx = gen_raw_REG (Pmode, R11_REG);
I added the following comments and am checking it into trunk:
// CM_LARGE_PIC always uses pseudo PIC register which is
// uninitialized. Since FUNCTION is local and calling it
// doesn't go through PLT, we use scratch register %r11 as
// PIC register and initialize it here.
--
H.J.
-----