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: Fix the pch/inliner-4 failures


> On Monday 23 May 2005 14:36, Jan Hubicka wrote:
> > Hi,
> > I've bootstrapped/regtested i686-pc-gnu-linux and commited this as
> > obvious.  It fixes the PCH failures at least on ia64.  I would be
> > curious to hear if this still reproduce somewhere else or not.
> >
> > Honza
> >
> > 2005-05-23  Jan Hubicka  <jh@suse.cz>
> > 	* tree-flow.h (stmt_ann_d): Kill GTY ((skip)) mark on BB.
> 
> Care to explain why is this obvious?  IMVHO this is not obvious at all and
> something else is wrong somewhere.
> 
> First of all, wtf does PCH care about basic blocks?  Do we not write PCHs
> _before_ handing over things to the middle-end?  Do we now need this
> because we lower the function and construct the CFG before writing the PCH?

As we chatted about it with RTH on IRC, the problem is that PCH happens
in non-unit-at-a-time and since there are functions in header, they are
passed to backend and compiled before frontend decide to PCH.
I would preffer this not to happen for sure.  As I mentioned to Rth's
reply, we might consider making PCH unit-at-a-time only or drop
non-unit-at-a-time completely at last...
> 
> Second, the statement that this stmt_ann_d hangs from must be in a basic
> block that exists in the DECL_STRUCT_FUNCTION(...)->cfg->x_basic_block_info
> array of the function that the statement is in.  So this basic block that
> you now mark with the new GTY marker should have been marked from elsewhere
> when cfun->cfg is marked, or we should not be marking statement and its
> stmt_ann_d to begin with.

It is marked, but PCH also does relocating of the whole datastructure to
the new place in memory.  While doing so it rewrite all the non-skipped
pointers and if you skip some they end up pointing to nowhere.  And the
GTY marker looks like leftover from times we didn't garbagecollected
basic blocks anyway.

Honza
> 
> Frankly, I get the feeling your patch is not obvious but wrong, papering
> over another issue.
> 
> Gr.
> Steven
> 
> 
> 
> 
> > Index: tree-flow.h
> > ===================================================================
> > RCS file: /cvs/gcc/gcc/gcc/tree-flow.h,v
> > retrieving revision 2.109
> > diff -c -3 -p -r2.109 tree-flow.h
> > *** tree-flow.h	17 May 2005 20:28:22 -0000	2.109
> > --- tree-flow.h	23 May 2005 09:40:11 -0000
> > *************** struct stmt_ann_d GTY(())
> > *** 308,314 ****
> >     unsigned makes_clobbering_call : 1;
> >
> >     /* Basic block that contains this statement.  */
> > !   basic_block GTY ((skip (""))) bb;
> >
> >     /* Operand cache for stmt.  */
> >     struct stmt_operands_d GTY ((skip (""))) operands;
> > --- 308,314 ----
> >     unsigned makes_clobbering_call : 1;
> >
> >     /* Basic block that contains this statement.  */
> > !   basic_block bb;
> >
> >     /* Operand cache for stmt.  */
> >     struct stmt_operands_d GTY ((skip (""))) operands;


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