diff mbox

pch bug fix

Message ID 20140101185348.GN892@tucnak.redhat.com
State New
Headers show

Commit Message

Jakub Jelinek Jan. 1, 2014, 6:53 p.m. UTC
On Wed, Jan 01, 2014 at 08:46:31AM +0100, Jakub Jelinek wrote:
> Thanks for tracking this down, this sounds like PR59436.  How have you
> managed to track it down?  I also wonder why it doesn't seem to affect 4.8
> when it also has the same change.
> 
> Based on the comments in gengtype.c, I'd expect
>   unsigned char *GTY ((atomic, length ("sizeof (struct target_optabs)"))) optabs;
> to work (or, perhaps instead of sizeof directly call a function that is
> defined in optabs.c and returns that value, perhaps optabs.h isn't included
> where it should be), but unfortunately it seems to be rejected right now.
> 
> So, the question is how hard would it be to support that.

Without any gengtype.c changes, I wonder if just following change wouldn't
do it, gengtype considers only char and unsigned char pointers as strings
with the special strlen handling, all other scalar types are treated
differently it seems, and signed char aliases everything too.

Or s/signed char/void/ in the patch is perhaps even better.



	Jakub
diff mbox

Patch

--- gcc/tree-core.h.jj	2013-12-11 10:11:06.000000000 +0100
+++ gcc/tree-core.h	2014-01-01 19:42:15.319869786 +0100
@@ -1550,7 +1550,7 @@  struct GTY(()) tree_optimization_option
 
   /* Target optabs for this set of optimization options.  This is of
      type `struct target_optabs *'.  */
-  unsigned char *GTY ((atomic)) optabs;
+  signed char *GTY ((atomic)) optabs;
 
   /* The value of this_target_optabs against which the optabs above were
      generated.  */
--- gcc/optabs.c.jj	2013-12-10 12:43:21.000000000 +0100
+++ gcc/optabs.c	2014-01-01 19:43:04.093620067 +0100
@@ -6245,7 +6245,7 @@  init_tree_optimization_optabs (tree optn
 
   /* If the optabs changed, record it.  */
   if (memcmp (tmp_optabs, this_target_optabs, sizeof (struct target_optabs)))
-    TREE_OPTIMIZATION_OPTABS (optnode) = (unsigned char *) tmp_optabs;
+    TREE_OPTIMIZATION_OPTABS (optnode) = (signed char *) tmp_optabs;
   else
     {
       TREE_OPTIMIZATION_OPTABS (optnode) = NULL;