public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Patch:  GGC-ify type hashtable
@ 2004-10-16 20:21 Dale Johannesen
  2004-10-16 20:26 ` Andrew Pinski
  2004-10-19 19:43 ` Richard Henderson
  0 siblings, 2 replies; 5+ messages in thread
From: Dale Johannesen @ 2004-10-16 20:21 UTC (permalink / raw)
  To: gcc-patches@gcc.gnu.org Patches; +Cc: Dale Johannesen

The hashtable for types in c_common_alias_set is not ggc'd, because I 
thought
type nodes would always be pointed to from somewhere else.  After our 
latest
merge it appears that this is no longer true (if it ever was), leading 
to an ICE
building SPEC with IMA.   I have no idea how to construct a small 
testcase.
The fix is obvious.  I am not planning to investigate how the type node 
became
otherwise unreferenced unless somebody thinks this really shouldn't 
happen.
Bootstrapped on Darwin.

2004-10-16  Dale Johannesen  <dalej@apple.com>

         * c-common.c (c_common_get_alias_set):  Use GGC for 
type_hash_table.

Index: c-common.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-common.c,v
retrieving revision 1.577
diff -u -d -b -w -p -c -3 -p -r1.577 c-common.c
cvs diff: conflicting specifications of output style
*** c-common.c  13 Oct 2004 23:31:19 -0000      1.577
--- c-common.c  16 Oct 2004 20:08:04 -0000
*************** c_type_hash (const void *p)
*** 2592,2597 ****
--- 2592,2599 ----
     return ((size << 24) | (i << shift));
   }

+ static GTY((param_is (union tree_node))) htab_t type_hash_table;
+
   /* Return the typed-based alias set for T, which may be an expression
      or a type.  Return -1 if we don't do anything special.  */

*************** c_common_get_alias_set (tree t)
*** 2600,2606 ****
   {
     tree u;
     PTR *slot;
-   static htab_t type_hash_table;

     /* Permit type-punning when accessing a union, provided the access
        is directly through the union.  For example, this code does not
--- 2602,2607 ----
*************** c_common_get_alias_set (tree t)
*** 2719,2725 ****
     /* Look up t in hash table.  Only one of the compatible types 
within each
        alias set is recorded in the table.  */
     if (!type_hash_table)
!     type_hash_table = htab_create (1021, c_type_hash,
             (htab_eq) lang_hooks.types_compatible_p,
             NULL);
     slot = htab_find_slot (type_hash_table, t, INSERT);
--- 2720,2726 ----
     /* Look up t in hash table.  Only one of the compatible types 
within each
        alias set is recorded in the table.  */
     if (!type_hash_table)
!     type_hash_table = htab_create_ggc (1021, c_type_hash,
             (htab_eq) lang_hooks.types_compatible_p,
             NULL);
     slot = htab_find_slot (type_hash_table, t, INSERT);

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Patch:  GGC-ify type hashtable
  2004-10-16 20:21 Patch: GGC-ify type hashtable Dale Johannesen
@ 2004-10-16 20:26 ` Andrew Pinski
  2004-10-16 20:50   ` Andrew Pinski
  2004-10-19 19:43 ` Richard Henderson
  1 sibling, 1 reply; 5+ messages in thread
From: Andrew Pinski @ 2004-10-16 20:26 UTC (permalink / raw)
  To: Dale Johannesen; +Cc: gcc-patches@gcc.gnu.org Patches


On Oct 16, 2004, at 4:14 PM, Dale Johannesen wrote:

> The hashtable for types in c_common_alias_set is not ggc'd, because I 
> thought
> type nodes would always be pointed to from somewhere else.  After our 
> latest
> merge it appears that this is no longer true (if it ever was), leading 
> to an ICE
> building SPEC with IMA.   I have no idea how to construct a small 
> testcase.
> The fix is obvious.  I am not planning to investigate how the type 
> node became
> otherwise unreferenced unless somebody thinks this really shouldn't 
> happen.
> Bootstrapped on Darwin.

I also see the same problem with --enable-intermodule and was trying to
figure out why, I found the patch which caused it, I think.

I also found a way to speed up comp_types for multiple files which I 
will
be submitting soon.

Thanks,
Andrew Pinski

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Patch:  GGC-ify type hashtable
  2004-10-16 20:26 ` Andrew Pinski
@ 2004-10-16 20:50   ` Andrew Pinski
  2004-10-16 20:55     ` Jan Hubicka
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Pinski @ 2004-10-16 20:50 UTC (permalink / raw)
  To: Andrew Pinski; +Cc: Dale Johannesen, gcc-patches@gcc.gnu.org Patches


On Oct 16, 2004, at 4:21 PM, Andrew Pinski wrote:

>
> On Oct 16, 2004, at 4:14 PM, Dale Johannesen wrote:
>
>> The hashtable for types in c_common_alias_set is not ggc'd, because I 
>> thought
>> type nodes would always be pointed to from somewhere else.  After our 
>> latest
>> merge it appears that this is no longer true (if it ever was), 
>> leading to an ICE
>> building SPEC with IMA.   I have no idea how to construct a small 
>> testcase.
>> The fix is obvious.  I am not planning to investigate how the type 
>> node became
>> otherwise unreferenced unless somebody thinks this really shouldn't 
>> happen.
>> Bootstrapped on Darwin.
>
> I also see the same problem with --enable-intermodule and was trying to
> figure out why, I found the patch which caused it, I think.
Forgot to say the patch would be:
http://gcc.gnu.org/ml/gcc-cvs/2004-09/msg00192.html

Which is connect to PR 17957 so maybe Jan can comment here.

Thanks,
Andrew Pinski

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Patch:  GGC-ify type hashtable
  2004-10-16 20:50   ` Andrew Pinski
@ 2004-10-16 20:55     ` Jan Hubicka
  0 siblings, 0 replies; 5+ messages in thread
From: Jan Hubicka @ 2004-10-16 20:55 UTC (permalink / raw)
  To: Andrew Pinski; +Cc: Dale Johannesen, gcc-patches@gcc.gnu.org Patches

> 
> On Oct 16, 2004, at 4:21 PM, Andrew Pinski wrote:
> 
> >
> >On Oct 16, 2004, at 4:14 PM, Dale Johannesen wrote:
> >
> >>The hashtable for types in c_common_alias_set is not ggc'd, because I 
> >>thought
> >>type nodes would always be pointed to from somewhere else.  After our 
> >>latest
> >>merge it appears that this is no longer true (if it ever was), 
> >>leading to an ICE
> >>building SPEC with IMA.   I have no idea how to construct a small 
> >>testcase.
> >>The fix is obvious.  I am not planning to investigate how the type 
> >>node became
> >>otherwise unreferenced unless somebody thinks this really shouldn't 
> >>happen.
> >>Bootstrapped on Darwin.
> >
> >I also see the same problem with --enable-intermodule and was trying to
> >figure out why, I found the patch which caused it, I think.
> Forgot to say the patch would be:
> http://gcc.gnu.org/ml/gcc-cvs/2004-09/msg00192.html
> 
> Which is connect to PR 17957 so maybe Jan can comment here.

Well, there is not much to comment.  We didn't release the bodies for a
while by mistake and GTYing the pointer we keep around looks like proper
fix.

Honza
> 
> Thanks,
> Andrew Pinski

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Patch:  GGC-ify type hashtable
  2004-10-16 20:21 Patch: GGC-ify type hashtable Dale Johannesen
  2004-10-16 20:26 ` Andrew Pinski
@ 2004-10-19 19:43 ` Richard Henderson
  1 sibling, 0 replies; 5+ messages in thread
From: Richard Henderson @ 2004-10-19 19:43 UTC (permalink / raw)
  To: Dale Johannesen; +Cc: gcc-patches@gcc.gnu.org Patches

On Sat, Oct 16, 2004 at 01:14:02PM -0700, Dale Johannesen wrote:
>         * c-common.c (c_common_get_alias_set):  Use GGC for 
> type_hash_table.

Ok.


r~

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-10-19 19:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-16 20:21 Patch: GGC-ify type hashtable Dale Johannesen
2004-10-16 20:26 ` Andrew Pinski
2004-10-16 20:50   ` Andrew Pinski
2004-10-16 20:55     ` Jan Hubicka
2004-10-19 19:43 ` Richard Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).