PATCH RFC: PR 33094: Test DECL_INITIAL in make_rtl_for_nonlocal_decl

Mark Mitchell mark@codesourcery.com
Sun Sep 30 21:59:00 GMT 2007


Jason Merrill wrote:

> DECL_EXTERNAL doesn't indicate whether or not something is defined, it
> indicates whether or not we need to call assemble_external when we see a
> reference to it.

Fair enough.  Indeed, the documentation for DECL_EXTERNAL in tree.h
makes clear that DECL_EXTERNAL may be set at the same time that a
definition is available; DECL_EXTERNAL just means that if you reference
the object in this translation unit, you're generating an external
reference.

> DECL_NOT_REALLY_EXTERN also doesn't indicate whether or not something is
> defined, it indicates whether or not we should emit it if we have a
> definition and it is needed.

Right.  I'm sure we could come up with a better name. :-)  I also wonder
whether, in the post-cgraph world, we could simplify a lot of this
handling in the C++ front end.  We used to play these games to make sure
that the definitions didn't get emitted for COMDAT functions until
needed -- but, now, cgraph will presumably do that for us.

So, could we just get rid of DECL_NOT_REALLY_EXTERN, and, instead of
setting that, just clear DECL_EXTERNAL?

In any case,

> Tested x86_64-pc-linux-gnu, applied to trunk.  I'd like to apply this to 4.2 as well; OK, Mark?

please wait until after the 4.2.2 release and then apply this.

(I'm trying to avoid making the mistake I made with 4.2.2 RC1 where I
kept letting patches in until I felt I had to do RC2...)

Thanks,

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713



More information about the Gcc-patches mailing list