This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch: PR 17408/17409


On Sat, 11 Sep 2004, Dale Johannesen wrote:

> Having now read what the standard requires (which seems poorly chosen,
> but it's Too Late Now), getting all cases right seems messy.  Setting
> DECL_EXTERN on an initialized object obviously leads to trouble, and
> is contrary to the meaning of that flag.  I'm now thinking in terms of
> adding a bit, which tells whether an initialized object was defined using
> 'extern' or not.  The code that resolves

For the present bugs, there is probably a reasonably straightforward local 
fix.  DECL_EXTERNAL should end up getting reset in start_decl.  
Investigate what's going wrong.

The proper long-term fix would involve C-specific bits for linkage 
(external, internal, none), storage duration (static, automatic) and 
whether a tentative definition has been seen, from which the middle-end 
flags are derived.  (It would be nice to do that derivation only at the 
point where a whole translation unit is passed off to the middle-end, but 
I don't think that would work because target attribute handlers want to 
look at these flags before then.  So it may instead be necessary to 
recompute the middle-end flags whenever a decl is changed.)  But this 
isn't suitable for the present development stage.

-- 
Joseph S. Myers               http://www.srcf.ucam.org/~jsm28/gcc/
  http://www.srcf.ucam.org/~jsm28/gcc/#c90status - status of C90 for GCC 4.0
    jsm@polyomino.org.uk (personal mail)
    jsm28@gcc.gnu.org (Bugzilla assignments and CCs)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]