21 GCC regressions, 0 new, with your patch on 2003-06-26T09:45:01Z.

Jan Hubicka jh@suse.cz
Fri Jun 27 10:44:00 GMT 2003


> 
> On Thursday, Jun 26, 2003, at 17:58 US/Eastern, Jan Hubicka wrote:
> 
> >>>Here is the diff with and without -funit-at-a-time on Darwin:
> >>
> >>The patch I commited for this yesterday didn't work for darwin?  It
> >>definitly fixed the problems on PPC Linux.
> >>Ugm, I will try again with crosscomplier :(
> >>Basically if there is object output that is not used by way visible to
> >>varpool it must by marked via varpool_mark_needed_node.  Do you have
> >>some knowledge how does the Darwin OBJC work and what makes it
> >>different?
> >
> >Hi,
> >the problem is that actually darwin uses special purpose sections 
> >instead of
> >global symbols.  varpool code then removes the variables emit into 
> >these
> >sections as dead.  The attached patch marks all declarations built by
> >objc-act.c that appears to be set used because it may not be used 
> >later (just
> >to avoid warning as comment in some cases says).  I am not 100% sure 
> >that they
> >are all needed, but they won't hurt and it is probably better to be 
> >safe then
> >sorry when I have zero chances to test it on darwin myself.
> >
> >Do you have access to darwin machine and can you test it by any chance?
> 
> 
> It still does not work all the way.
> There seems to be one more problem to fix because of the difference 
> between next-runtime and gnu-runtime in Darwin:
> 
> In handle_impent and handle_class_ref, it outputs some references using 
> ASM_DECLARE_CLASS_REFERENCE and it assumes that it is
> under the L_OBJC_CLASS_REFERENCES_0 label already but it is throwing it 
> some in the text section. Note this is all done in finish_objc.
> 
> I do not know how to fix this though.
This is bit unfortunate.  Making one variables to be output under
assumption that other variable has been just output is quite ugly.
Because it is done after unit-at-a-time code has finished the work and
I already do care to output all needed nodes, perhaps it is safest to
disable varpoolizing in this late stage of compilation.
Does the attached patch work for you?
It should render the previous patch unnecesary.

Honza

Index: toplev.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/toplev.c,v
retrieving revision 1.787
diff -c -3 -p -r1.787 toplev.c
*** toplev.c	25 Jun 2003 20:43:10 -0000	1.787
--- toplev.c	27 Jun 2003 10:43:16 -0000
*************** rest_of_decl_compilation (tree decl,
*** 2179,2186 ****
  	 is seen.  But at end of compilation, do output code for them.  */
        if (at_end || !DECL_DEFER_OUTPUT (decl))
  	{
! 	  if (flag_unit_at_a_time && TREE_CODE (decl) != FUNCTION_DECL
! 	      && top_level)
  	    cgraph_varpool_finalize_decl (decl);
  	  else
  	    assemble_variable (decl, top_level, at_end, 0);
--- 2179,2186 ----
  	 is seen.  But at end of compilation, do output code for them.  */
        if (at_end || !DECL_DEFER_OUTPUT (decl))
  	{
! 	  if (flag_unit_at_a_time && !cgraph_global_info_ready
! 	      && TREE_CODE (decl) != FUNCTION_DECL && top_level)
  	    cgraph_varpool_finalize_decl (decl);
  	  else
  	    assemble_variable (decl, top_level, at_end, 0);



More information about the Gcc-regression mailing list