This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: pch bug fix
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Mike Stump <mikestump at comcast dot net>
- Cc: "gcc-patches at gcc dot gnu dot org List" <gcc-patches at gcc dot gnu dot org>, Kenneth Zadeck <zadeck at naturalbridge dot com>
- Date: Wed, 1 Jan 2014 19:53:48 +0100
- Subject: Re: pch bug fix
- Authentication-results: sourceware.org; auth=none
- References: <F756187A-91EC-46CD-888A-EF3D923DA887 at comcast dot net> <20140101074631 dot GL892 at tucnak dot redhat dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
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.
--- 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;
Jakub