This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Lazy DECL_RTL breakage for weak alias
- To: wilson at cygnus dot com
- Subject: Re: Lazy DECL_RTL breakage for weak alias
- From: Mark Mitchell <mark at codesourcery dot com>
- Date: Fri, 16 Mar 2001 15:28:59 -0800
- Cc: gcc-patches at gcc dot gnu dot org
- Organization: CodeSourcery, LLC
- References: <mark@codesourcery.com><200103161925.LAA05767@wilson.cygnus.com>
>>>>> "Jim" == Jim Wilson <wilson@cygnus.com> writes:
Jim> You can't reproduce it because of your dwarf2out.c patch late
Jim> last night which was submitted about the same time I
Jim> submitted my patch.
Jim> However, that patch "works" by reducing the debug info. This
On H.J.'s test-case, it produced identical .s files to what GCC 2.95
produced -- without the change, dwarf2out.c was actually trying to
talk about symbols that didn't exist in the generated object file.
Opposite problem, sort-of.
The difference, perhaps, was that his test-case was for an initialized
constant that we perhaps didn't output at all.
I'll look further at your test-case.
Jim> The problem with the lazy DECL_RTL code is that a NULL
Jim> DECL_RTL is now ambiguous. It could mean that the decl is
Jim> not supposed to have any DECL_RTL.
True.
However, if we don't have RTL by the time we hit
rtl_for_decl_location, I think we will never need it. If there's no
RTL, then there's no location -- and we shouldn't be trying to
describe one to the debugger.
Jim> A possible solution is to state that we must always generate
Jim> the DECL_RTL before reaching the debug output routines. We
I agree -- if there's going to be RTL, we must do it by this point.
That's why I used DECL_RTL_IF_SET there.
Jim> could then fix my testcase by adding a call to make_decl_rtl
Jim> someplace appropriate, assemble_alias perhaps. This still
Jim> needs my make_decl_rtl patch to work though.
Right -- if we really need RTL for this entity.
Thanks for the revised test-case. I'll look at that.
What does it mean if something is TREE_PUBLIC, not TREE_STATIC, and
not DECL_EXTERNAL is that always an alias? That means it has external
linkage, is defined here, but no storage. One example of such a thing
is a constant (like `const int i = 3;') which me might not output.
But, there's no RTL for something like that.
It may well be that your patch is correct; I'm just trying to
understand a little better.
All right, I suggest this:
- Leave in the dwarf2out.c patch.
- Add in your make_decl_rtl patch.
- Explicitly call make_decl_rtl in assemble_alias.
How does that sound?
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com