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: Pre-inline optimization, version 3


> Jan Hubicka <jh@suse.cz> writes:
> 
> > > raised STORAGE_ERROR : stack overflow (or erroneous memory access)
> > > make[3]: *** [ada/erroutc.o] Error 1
> > > 
> > > 
> > > Program received signal SIGSEGV, Segmentation fault.
> > Hi,
> > sorry for delays, I can't get to IA-64 machine right now (since I can't
> > get thru firewall), but the attached patch should plug one of obvious
> > places where we might leak dead edges like this.  I will test it on
> > IA-64 ASAP.
> 
> For what it's worth, I get a very similar error when doing an Ada
> bootstrap on i686-pc-linux-gnu.  Please make sure you add ada to
> --enable-languages when you test these big changes.

Thank you for a hint.  Before sending the request I verified that Ada
bootstrap works for me on x86-64 (well past the failure point failing
later for unrelated reason), but the problem ineed reproduce for me on
i686 machine.

The problem is more stubble - the reference to dead SSA name is caused
by Ada language specific part of declaration holding pointers to random
parts of GIMPLE statements.
It would be great if those pointers was cleared after gimplification by
Ada, but I am not familiar enough with that frontend to try that.

I am testing the attached patch. You are definitly right that the
original early optimization patch should've been tested with Ada.  The
frontend dependency didn't arrised to me.  At least I am re-testing with
Ada the early inlining/early optimization patch I intend to commit
today now.

Honza

	* tree-ssanames.c (release_dead_ssa_names): Do not ggc_free ssa names.

Index: tree-ssanames.c
===================================================================
*** tree-ssanames.c	(revision 120823)
--- tree-ssanames.c	(working copy)
*************** release_dead_ssa_names (void)
*** 325,331 ****
    for (t = FREE_SSANAMES (cfun); t; t = next)
      {
        next = TREE_CHAIN (t);
!       ggc_free (t);
        n++;
      }
    FREE_SSANAMES (cfun) = NULL;
--- 325,334 ----
    for (t = FREE_SSANAMES (cfun); t; t = next)
      {
        next = TREE_CHAIN (t);
!       /* We can't do ggc_free here: Ada uses DECL_RENAMED_OBJECT to point into
! 	 parts of existing statements and that might become dead and reffer to
! 	 dead SSA names.  */
!       memset (t, sizeof (t), 0);
        n++;
      }
    FREE_SSANAMES (cfun) = NULL;


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