public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Fix LTO_STREAMER_DEBUG build
@ 2016-09-29 15:14 Thomas Schwinge
  2016-09-29 15:38 ` Richard Biener
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Schwinge @ 2016-09-29 15:14 UTC (permalink / raw)
  To: Richard Biener, gcc-patches

Hi!

While working on something else, I found LTO_STREAMER_DEBUG broken.
Enabling (#define) gcc/lto-stream.h:LTO_STREAMER_DEBUG, some further
checking is done on the LTO streamer (writer/reader), and some additional
debugging hooks are provided.  In the end, I didn't use this facility for
my debugging, but here is anyway the patch to un-break it.  Not yet
thoroughly tested, will do that later -- OK for trunk then?

commit b70b2465f9c901ccf783049ab10dc896a5bb0f67
Author: Thomas Schwinge <thomas@codesourcery.com>
Date:   Thu Sep 29 14:30:11 2016 +0200

    Fix LTO_STREAMER_DEBUG build
---
 gcc/lto-streamer.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git gcc/lto-streamer.c gcc/lto-streamer.c
index bfde1fe..a44a916 100644
--- gcc/lto-streamer.c
+++ gcc/lto-streamer.c
@@ -267,23 +267,23 @@ struct tree_hash_entry
 
 struct tree_entry_hasher : nofree_ptr_hash <tree_hash_entry>
 {
-  static inline hashval_t hash (const value_type *);
-  static inline bool equal (const value_type *, const compare_type *);
+  static inline hashval_t hash (const tree_hash_entry *);
+  static inline bool equal (const tree_hash_entry *, const tree_hash_entry *);
 };
 
 inline hashval_t
-tree_entry_hasher::hash (const value_type *e)
+tree_entry_hasher::hash (const tree_hash_entry *e)
 {
   return htab_hash_pointer (e->key);
 }
 
 inline bool
-tree_entry_hasher::equal (const value_type *e1, const compare_type *e2)
+tree_entry_hasher::equal (const tree_hash_entry *e1, const tree_hash_entry *e2)
 {
   return (e1->key == e2->key);
 }
 
-static hash_table<tree_hash_entry> *tree_htab;
+static hash_table<tree_entry_hasher> *tree_htab;
 #endif
 
 /* Initialization common to the LTO reader and writer.  */
@@ -299,7 +299,7 @@ lto_streamer_init (void)
     streamer_check_handled_ts_structures ();
 
 #ifdef LTO_STREAMER_DEBUG
-  tree_htab = new hash_table<tree_hash_entry> (31);
+  tree_htab = new hash_table<tree_entry_hasher> (31);
 #endif
 }
 


Grüße
 Thomas

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

* Re: Fix LTO_STREAMER_DEBUG build
  2016-09-29 15:14 Fix LTO_STREAMER_DEBUG build Thomas Schwinge
@ 2016-09-29 15:38 ` Richard Biener
  2016-10-12 13:38   ` Thomas Schwinge
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Biener @ 2016-09-29 15:38 UTC (permalink / raw)
  To: Thomas Schwinge, gcc-patches

On September 29, 2016 4:54:36 PM GMT+02:00, Thomas Schwinge <thomas@codesourcery.com> wrote:
>Hi!
>
>While working on something else, I found LTO_STREAMER_DEBUG broken.
>Enabling (#define) gcc/lto-stream.h:LTO_STREAMER_DEBUG, some further
>checking is done on the LTO streamer (writer/reader), and some
>additional
>debugging hooks are provided.  In the end, I didn't use this facility
>for
>my debugging, but here is anyway the patch to un-break it.  Not yet
>thoroughly tested, will do that later -- OK for trunk then?

Works for me though I'd expect the checking code to be broken (I foubd it hardly useful)

Richard.

>commit b70b2465f9c901ccf783049ab10dc896a5bb0f67
>Author: Thomas Schwinge <thomas@codesourcery.com>
>Date:   Thu Sep 29 14:30:11 2016 +0200
>
>    Fix LTO_STREAMER_DEBUG build
>---
> gcc/lto-streamer.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
>diff --git gcc/lto-streamer.c gcc/lto-streamer.c
>index bfde1fe..a44a916 100644
>--- gcc/lto-streamer.c
>+++ gcc/lto-streamer.c
>@@ -267,23 +267,23 @@ struct tree_hash_entry
> 
> struct tree_entry_hasher : nofree_ptr_hash <tree_hash_entry>
> {
>-  static inline hashval_t hash (const value_type *);
>-  static inline bool equal (const value_type *, const compare_type *);
>+  static inline hashval_t hash (const tree_hash_entry *);
>+  static inline bool equal (const tree_hash_entry *, const
>tree_hash_entry *);
> };
> 
> inline hashval_t
>-tree_entry_hasher::hash (const value_type *e)
>+tree_entry_hasher::hash (const tree_hash_entry *e)
> {
>   return htab_hash_pointer (e->key);
> }
> 
> inline bool
>-tree_entry_hasher::equal (const value_type *e1, const compare_type
>*e2)
>+tree_entry_hasher::equal (const tree_hash_entry *e1, const
>tree_hash_entry *e2)
> {
>   return (e1->key == e2->key);
> }
> 
>-static hash_table<tree_hash_entry> *tree_htab;
>+static hash_table<tree_entry_hasher> *tree_htab;
> #endif
> 
> /* Initialization common to the LTO reader and writer.  */
>@@ -299,7 +299,7 @@ lto_streamer_init (void)
>     streamer_check_handled_ts_structures ();
> 
> #ifdef LTO_STREAMER_DEBUG
>-  tree_htab = new hash_table<tree_hash_entry> (31);
>+  tree_htab = new hash_table<tree_entry_hasher> (31);
> #endif
> }
> 
>
>
>Grüße
> Thomas


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

* Re: Fix LTO_STREAMER_DEBUG build
  2016-09-29 15:38 ` Richard Biener
@ 2016-10-12 13:38   ` Thomas Schwinge
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Schwinge @ 2016-10-12 13:38 UTC (permalink / raw)
  To: Richard Biener, gcc-patches; +Cc: Jakub Jelinek

Hi!

On Thu, 29 Sep 2016 17:29:29 +0200, Richard Biener <richard.guenther@gmail.com> wrote:
> On September 29, 2016 4:54:36 PM GMT+02:00, Thomas Schwinge <thomas@codesourcery.com> wrote:
> >While working on something else, I found LTO_STREAMER_DEBUG broken.
> >Enabling (#define) gcc/lto-stream.h:LTO_STREAMER_DEBUG, some further
> >checking is done on the LTO streamer (writer/reader), and some
> >additional
> >debugging hooks are provided.  In the end, I didn't use this facility
> >for
> >my debugging, but here is anyway the patch to un-break it.  Not yet
> >thoroughly tested, will do that later -- OK for trunk then?
> 
> Works for me though I'd expect the checking code to be broken (I foubd it hardly useful)

;-) Well, I just filed <https://gcc.gnu.org/PR77954> "LTO_STREAMER_DEBUG
ICE with OpenMP SIMD clones".

Without changes committed in r241046:

commit 2e5bb449b8f67130b235ea4e3643929041bb495e
Author: tschwinge <tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Wed Oct 12 13:18:36 2016 +0000

    Fix LTO_STREAMER_DEBUG build
    
    	gcc/
    	* lto-streamer.c: Fix LTO_STREAMER_DEBUG build.
    
    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@241046 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog      |  2 ++
 gcc/lto-streamer.c | 12 ++++++------
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git gcc/ChangeLog gcc/ChangeLog
index c66b7a7..e709adb 100644
--- gcc/ChangeLog
+++ gcc/ChangeLog
@@ -1,5 +1,7 @@
 2016-10-12  Thomas Schwinge  <thomas@codesourcery.com>
 
+	* lto-streamer.c: Fix LTO_STREAMER_DEBUG build.
+
 	* dwarf2out.c (dwarf2_lineno_debug_hooks): Use
 	dwarf2out_assembly_start.
 
diff --git gcc/lto-streamer.c gcc/lto-streamer.c
index bfde1fe..a44a916 100644
--- gcc/lto-streamer.c
+++ gcc/lto-streamer.c
@@ -267,23 +267,23 @@ struct tree_hash_entry
 
 struct tree_entry_hasher : nofree_ptr_hash <tree_hash_entry>
 {
-  static inline hashval_t hash (const value_type *);
-  static inline bool equal (const value_type *, const compare_type *);
+  static inline hashval_t hash (const tree_hash_entry *);
+  static inline bool equal (const tree_hash_entry *, const tree_hash_entry *);
 };
 
 inline hashval_t
-tree_entry_hasher::hash (const value_type *e)
+tree_entry_hasher::hash (const tree_hash_entry *e)
 {
   return htab_hash_pointer (e->key);
 }
 
 inline bool
-tree_entry_hasher::equal (const value_type *e1, const compare_type *e2)
+tree_entry_hasher::equal (const tree_hash_entry *e1, const tree_hash_entry *e2)
 {
   return (e1->key == e2->key);
 }
 
-static hash_table<tree_hash_entry> *tree_htab;
+static hash_table<tree_entry_hasher> *tree_htab;
 #endif
 
 /* Initialization common to the LTO reader and writer.  */
@@ -299,7 +299,7 @@ lto_streamer_init (void)
     streamer_check_handled_ts_structures ();
 
 #ifdef LTO_STREAMER_DEBUG
-  tree_htab = new hash_table<tree_hash_entry> (31);
+  tree_htab = new hash_table<tree_entry_hasher> (31);
 #endif
 }
 


Grüße
 Thomas

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

end of thread, other threads:[~2016-10-12 13:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-29 15:14 Fix LTO_STREAMER_DEBUG build Thomas Schwinge
2016-09-29 15:38 ` Richard Biener
2016-10-12 13:38   ` Thomas Schwinge

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).