[PATCH] Fix PR27657, bogus undefined reference error to static var with -g and -O

Richard Guenther richard.guenther@gmail.com
Sun Feb 4 15:29:00 GMT 2007


On 1/29/07, Richard Guenther <rguenther@suse.de> wrote:
>
> This fixes PR27657 by following the hint from Geoff to fix
> reference_to_unused to notice if a variable was emitted or not
> using the varpool infrastructure we have.
>
> I'm not 100% sure I don't miss some corner cases, but the testcases
> are all fixed and a bootstrap and regtest on x86_64-unknown-linux-gnu
> is (nearly) finished.
>
> I will apply this to the mainline tomorrow.

Backported to the 4.2 branch (s/varpool/cgraph_varpool/), bootstrapped
and tested on x86_64-unknown-linux-gnu and sanity tested by a distro
rebuild.

Applied to the branch.

Richard.


> 2007-01-30  Richard Guenther  <rguenther@suse.de>
>
>         PR middle-end/27657
>         * dwarf2out.c (reference_to_unused): Query varpool if the
>         variable was output.
>
>         * g++.dg/debug/pr27657.C: New testcase.



More information about the Gcc-patches mailing list