This is the mail archive of the 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: [4.0/4.1 Regression] debug info omitted for uninitialized variables

> On Tue, Jul 05, 2005 at 08:43:22AM +0200, Jan Hubicka wrote:
> > 
> > > to fix a serious 4.0/4.1 regression:
> > > 
> > >
> > > 
> > > where debug info is omitted for uninitialized variables. It seems that
> > > check_global_declarations does the wrong thing on uninitialized
> > > variables.
> > 
> > Hmm, there are quite few nasty bits here.  I think you are right in the
> > bug audit trail that check_global_declarations should be reordred after
> > cgraph finalization as it checks TREE_ASM_WRITTEN flag that is clearly
> > not set in a way it expects.
> > 
> There are 2 patches here, one for mainline and the other for gcc 4.0.
> But I am afraid that the patch for mainline may be time consuming. Also
> I am not sure if it handles "BLOCK_VARS (ext_block)" correctly. On
> Linux/x86-64, BLOCK_VARS (ext_block) changes after cgraph_optimize. I

This sounds rather surpsing (ie there is nothing in cgraph code dealing
with the ext_block or BLOCK_VARS so if it worked originally, it should
still work, but perhaps something gets changed during gimplification...
> +  /* Ask the back end to emit functions and variables that are
> +     enqueued.   These emissions may be needed for correct debug
> +     information.  See PR 21828.  The right fix may be to call
> +     check_global_declarations after cgraph_optimize.  But it doesn't
> +     work on gcc 4.0 branch without backporting varpool fixes from
> +     mainline.  */
> +  cgraph_varpool_assemble_pending_decls ();

This would result in outputing only the variables that are either
public or referenced by public variables.  It is necesarry to compile
the functions to discover variables referenced by code so I guess flags
will still be wrong for debug info.
What precisely is preventing check_global_declarations being done

THanks for looking into that,
> +
>    check_global_declarations (vec, len);
>    free (vec);

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