This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Add missing variable_size GTY annotations (was Re: on how to compile gcc-4.6 correctly?)
- From: Laurynas Biveinis <laurynas dot biveinis at gmail dot com>
- To: gcc-patches at gcc dot gnu dot org, "Dennis, CHENG Renquan" <crquan at fedoraproject dot org>
- Cc: Kai Ruottu <kai dot ruottu at wippies dot com>, gcc at gcc dot gnu dot org
- Date: Tue, 14 Sep 2010 16:17:43 +0300
- Subject: [PATCH] Add missing variable_size GTY annotations (was Re: on how to compile gcc-4.6 correctly?)
I have reproduced it and the patch below fixes the issue, sorry for
breaking things. Dennis, could you see if it works for you?
When gcc-core tarball is used without other frontends, gengtype does
not get to see that lang_type is in fact variable_size and when the
frontends are present, their variable_size annotations mask the fact
that c-lang.h does not have it. This is something that really should
be diagnosed by gengtype.
I will apply it to trunk later as obvious.
gcc/ChangeLog:
2010-09-14 Laurynas Biveinis <laurynas.biveinis@gmail.com>
* c-lang.h (struct lang_type): Add variable_size GTY option.
gcc/lto/ChangeLog:
2010-09-14 Laurynas Biveinis <laurynas.biveinis@gmail.com>
* lto-tree.h (struct lang_type): Add variable_size GTY option.
*** gcc-4.6-20100911/gcc/c-lang.h.original 2010-09-14
14:55:45.000000000 +0200
--- gcc-4.6-20100911/gcc/c-lang.h 2010-09-14 14:57:08.000000000 +0200
*************** along with GCC; see the file COPYING3.
*** 24,30 ****
#include "c-family/c-common.h"
#include "ggc.h"
! struct GTY(()) lang_type {
/* In a RECORD_TYPE, a sorted array of the fields of the type. */
struct sorted_fields_type * GTY ((reorder ("resort_sorted_fields"))) s;
/* In an ENUMERAL_TYPE, the min and max values. */
--- 24,30 ----
#include "c-family/c-common.h"
#include "ggc.h"
! struct GTY((variable_size)) lang_type {
/* In a RECORD_TYPE, a sorted array of the fields of the type. */
struct sorted_fields_type * GTY ((reorder ("resort_sorted_fields"))) s;
/* In an ENUMERAL_TYPE, the min and max values. */
*** gcc-4.6-20100911/gcc/lto/lto-tree.h.orig 2010-09-14
14:59:11.000000000 +0200
--- gcc-4.6-20100911/gcc/lto/lto-tree.h 2010-09-14 14:59:25.000000000 +0200
*************** struct GTY(()) lang_decl
*** 33,39 ****
int dummy; /* Added because ggc does not like empty structs. */
};
! struct GTY(()) lang_type
{
int dummy; /* Added because ggc does not like empty structs. */
};
--- 33,39 ----
int dummy; /* Added because ggc does not like empty structs. */
};
! struct GTY((variable_size)) lang_type
{
int dummy; /* Added because ggc does not like empty structs. */
};
--
Laurynas