This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFA: PATCH to tree optimizers for target/39179 (PE binds_local_p issue)
- From: Richard Guenther <richard dot guenther at gmail dot com>
- To: Jason Merrill <jason at redhat dot com>
- Cc: gcc-patches List <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 18 Feb 2009 21:55:28 +0100
- Subject: Re: RFA: PATCH to tree optimizers for target/39179 (PE binds_local_p issue)
- References: <499C7376.9000208@redhat.com>
On Wed, Feb 18, 2009 at 9:45 PM, Jason Merrill <jason@redhat.com> wrote:
> The PE binds_local_p returns true for many more variables than the default
> (ELF) definition, so it shows up problems with aggressive use of that hook.
> Two places in the tree optimizers assume that if TREE_STATIC is set and
> binds_local_p is true, we know the value of a const variable. This is not
> true in the C++ front end, where variables routinely have both TREE_STATIC
> and DECL_EXTERNAL set. Apparently this is incorrect, and C++ linkage code
> is overdue for an overhaul--the tricks we use to defer linkage choices until
> EOF can be simplified a lot now that we're always in unit-at-a-time
> mode--but fixing that isn't feasible for the 4.4 timeframe. Just checking
> !DECL_EXTERNAL fixes the bug simply.
>
> In discussion of the PR, there was some confusion about what binds_local_p
> actually means, so I've clarified a couple of uses of "module" in the
> headers.
>
> I tested that this fixes the bug with a i386-pc-mingw32 cross-compiler, and
> regression tested on x86_64-pc-linux-gnu.
>
> OK for trunk?
Ok.
It would be nice to have the C++ FE cleaned up here during 4.5.
Thanks,
Richard.