public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* RFC - Refactor tree.h
@ 2013-08-09 22:36 Diego Novillo
  2013-08-10  0:17 ` Mike Stump
  0 siblings, 1 reply; 39+ messages in thread
From: Diego Novillo @ 2013-08-09 22:36 UTC (permalink / raw)
  To: Andrew Macleod, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 766 bytes --]

This patch is still WIP.  It builds stage1, but I'm getting ICEs
during stage 2.

The patch splits tree.h into three files:

- tree-core.h: All data structures, enums and typedefs from
  tree.h

- tree-api.h: All extern function definitions from tree.h

- tree-macros.h: All macro accessors, tree checks and other
  inline functions.

The intent is to ostracize tree-macros.h so that it can only be
included from tree.h.  The files tree-core.h and tree-api.h
should be usable from anywhere.  In particular, we are interested
in tree-core.h, which will be included by the gimple files to
define operand accessors.

Andrew, is this more or less what you had in mind?  I'm going to
be away for a couple of weeks.  I will pick it back up when I
return.

Thanks.  Diego.

[-- Attachment #2: 0001-Re-factor-tree.h.-Move-data-structures-enums-and-typ.patch.gz --]
[-- Type: application/octet-stream, Size: 122221 bytes --]

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

* Re: RFC - Refactor tree.h
  2013-08-09 22:36 RFC - Refactor tree.h Diego Novillo
@ 2013-08-10  0:17 ` Mike Stump
  2013-08-10 10:02   ` Richard Biener
  0 siblings, 1 reply; 39+ messages in thread
From: Mike Stump @ 2013-08-10  0:17 UTC (permalink / raw)
  To: Diego Novillo; +Cc: Andrew Macleod, gcc-patches

On Aug 9, 2013, at 3:36 PM, Diego Novillo <dnovillo@google.com> wrote:
> This patch is still WIP.  It builds stage1, but I'm getting ICEs
> during stage 2.
> 
> The patch splits tree.h into three files:
> 
> - tree-core.h: All data structures, enums and typedefs from
>  tree.h
> 
> - tree-api.h: All extern function definitions from tree.h
> 
> - tree-macros.h: All macro accessors, tree checks and other
>  inline functions.

I don't like this split.  You focus in on the details and sort code by detail.  I think this is wrong.  I want code sorted by the features and functions it provides, and all like this, go into explainable functional bins.  One day, a function might be implemented by a data structure, the next day, by a routine, or a macro, or an inline function, the form of it doesn't matter.

It is like sorting routines by the first character of the spelling of the name of the routine.  tree_to_int, goes into t.c, because tree starts with a t.  You rename the function, and suddenly it moves files?  Bad.

Examine double_int.  All macros for double int, go in double-int.h or double-int.c.  All function go in one or the other.  All routines goes in one or the other.  All double-int code goes into this bin.  What bin is it?  macros?  No, the bin is double-int.

Likewise vec.[ch].  You want tree.h smaller, pick the largest abstract group that is contained in that file, and remove it to it's own file.  For example, fold.  fold is fold, fold is special.  fold can be in fold.h.  If you examine the nature of the code in tree.h:

/* In fold-const.c */

/* Non-zero if we are folding constants inside an initializer; zero                            
   otherwise.  */
extern int folding_initializer;

This is a dead giveaway.  The second giveaway, fold-const.c exists.  That code isn't in tree.c.  Now, maybe you call it fold-const.h, maybe that's better, you get the idea.

Look for isolatable hunks that can exist in their own group of some sort.  Look for "/* In ", this is a better way to sort.

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

* Re: RFC - Refactor tree.h
  2013-08-10  0:17 ` Mike Stump
@ 2013-08-10 10:02   ` Richard Biener
  2013-08-10 19:03     ` Mike Stump
  2013-08-21 17:31     ` Andrew MacLeod
  0 siblings, 2 replies; 39+ messages in thread
From: Richard Biener @ 2013-08-10 10:02 UTC (permalink / raw)
  To: Mike Stump, Diego Novillo; +Cc: Andrew Macleod, gcc-patches

Mike Stump <mikestump@comcast.net> wrote:
>On Aug 9, 2013, at 3:36 PM, Diego Novillo <dnovillo@google.com> wrote:
>> This patch is still WIP.  It builds stage1, but I'm getting ICEs
>> during stage 2.
>> 
>> The patch splits tree.h into three files:
>> 
>> - tree-core.h: All data structures, enums and typedefs from
>>  tree.h
>> 
>> - tree-api.h: All extern function definitions from tree.h
>> 
>> - tree-macros.h: All macro accessors, tree checks and other
>>  inline functions.
>
>I don't like this split.  You focus in on the details and sort code by
>detail.  I think this is wrong.  I want code sorted by the features and
>functions it provides, and all like this, go into explainable
>functional bins.  One day, a function might be implemented by a data
>structure, the next day, by a routine, or a macro, or an inline
>function, the form of it doesn't matter.
>
>It is like sorting routines by the first character of the spelling of
>the name of the routine.  tree_to_int, goes into t.c, because tree
>starts with a t.  You rename the function, and suddenly it moves files?
> Bad.
>
>Examine double_int.  All macros for double int, go in double-int.h or
>double-int.c.  All function go in one or the other.  All routines goes
>in one or the other.  All double-int code goes into this bin.  What bin
>is it?  macros?  No, the bin is double-int.
>
>Likewise vec.[ch].  You want tree.h smaller, pick the largest abstract
>group that is contained in that file, and remove it to it's own file. 
>For example, fold.  fold is fold, fold is special.  fold can be in
>fold.h.  If you examine the nature of the code in tree.h:
>
>/* In fold-const.c */
>
>/* Non-zero if we are folding constants inside an initializer; zero    
>                       
>   otherwise.  */
>extern int folding_initializer;
>
>This is a dead giveaway.  The second giveaway, fold-const.c exists. 
>That code isn't in tree.c.  Now, maybe you call it fold-const.h, maybe
>that's better, you get the idea.
>
>Look for isolatable hunks that can exist in their own group of some
>sort.  Look for "/* In ", this is a better way to sort.

I mostly agree - tree-macros.h is a red herring. It should be tree-core.h and tree.h only. What does not belong there should go to other appropriate places, like fold-const.h for example.

Thanks,
Richard.

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

* Re: RFC - Refactor tree.h
  2013-08-10 10:02   ` Richard Biener
@ 2013-08-10 19:03     ` Mike Stump
  2013-08-11  7:59       ` Richard Biener
  2013-08-21 17:31     ` Andrew MacLeod
  1 sibling, 1 reply; 39+ messages in thread
From: Mike Stump @ 2013-08-10 19:03 UTC (permalink / raw)
  To: Richard Biener; +Cc: Diego Novillo, Andrew Macleod, gcc-patches

On Aug 10, 2013, at 3:03 AM, Richard Biener <richard.guenther@gmail.com> wrote:
> Mike Stump <mikestump@comcast.net> wrote:
>> On Aug 9, 2013, at 3:36 PM, Diego Novillo <dnovillo@google.com> wrote:
>>> This patch is still WIP.  It builds stage1, but I'm getting ICEs
>>> during stage 2.
>>> 
>>> The patch splits tree.h into three files:
>>> 
>>> - tree-core.h: All data structures, enums and typedefs from
>>> tree.h
>>> 
>>> - tree-api.h: All extern function definitions from tree.h
>>> 
>>> - tree-macros.h: All macro accessors, tree checks and other
>>> inline functions.
>> 
>> I don't like this split.  You focus in on the details and sort code by
>> detail.  I think this is wrong.

> I mostly agree - tree-macros.h is a red herring. It should be tree-core.h and tree.h only.

I disagree.  core isn't a concept that should be binned into.  control flow, call graph, register, arm, alias, allocation, attribute, builtin, type, eval, jit, symbol, file, floating point, pass, block, stack, constant, hash, map, range, memory, debug, dump, elf, dwarf, operator, value, vector, declarations, int, statements, object, storage, expressions, frame, error, values, mapping, the list is endless. core is like a bin for important, functions that begin with a, functions I wrote, big functions, functions implemented with templates, trivial functions, hard to grasp concepts, simple things, things added in the last year, old things, fun things, extra things, useful thing, unsorted things, often used things, and so on…  core goes in exactly the wrong long term direction.

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

* Re: RFC - Refactor tree.h
  2013-08-10 19:03     ` Mike Stump
@ 2013-08-11  7:59       ` Richard Biener
  2013-08-12 20:36         ` Mike Stump
  0 siblings, 1 reply; 39+ messages in thread
From: Richard Biener @ 2013-08-11  7:59 UTC (permalink / raw)
  To: Mike Stump; +Cc: Diego Novillo, Andrew Macleod, gcc-patches

Mike Stump <mikestump@comcast.net> wrote:
>On Aug 10, 2013, at 3:03 AM, Richard Biener
><richard.guenther@gmail.com> wrote:
>> Mike Stump <mikestump@comcast.net> wrote:
>>> On Aug 9, 2013, at 3:36 PM, Diego Novillo <dnovillo@google.com>
>wrote:
>>>> This patch is still WIP.  It builds stage1, but I'm getting ICEs
>>>> during stage 2.
>>>> 
>>>> The patch splits tree.h into three files:
>>>> 
>>>> - tree-core.h: All data structures, enums and typedefs from
>>>> tree.h
>>>> 
>>>> - tree-api.h: All extern function definitions from tree.h
>>>> 
>>>> - tree-macros.h: All macro accessors, tree checks and other
>>>> inline functions.
>>> 
>>> I don't like this split.  You focus in on the details and sort code
>by
>>> detail.  I think this is wrong.
>
>> I mostly agree - tree-macros.h is a red herring. It should be
>tree-core.h and tree.h only.
>
>I disagree.  core isn't a concept that should be binned into.  control
>flow, call graph, register, arm, alias, allocation, attribute, builtin,
>type, eval, jit, symbol, file, floating point, pass, block, stack,
>constant, hash, map, range, memory, debug, dump, elf, dwarf, operator,
>value, vector, declarations, int, statements, object, storage,
>expressions, frame, error, values, mapping, the list is endless. core
>is like a bin for important, functions that begin with a, functions I
>wrote, big functions, functions implemented with templates, trivial
>functions, hard to grasp concepts, simple things, things added in the
>last year, old things, fun things, extra things, useful thing, unsorted
>things, often used things, and so on…  core goes in exactly the wrong
>long term direction.

Fact is that we need to separate internal details of tree.h into sth shareable from exactly two places.  Tree-core.h and tree.h are both 'tree.h' in some way. Call it tree-internal.h or tree1.h.

The goal is to have two distinct and conflicting APIs to trees, one exposed from gimple.h and one from tree.h. And yes, that's a transitional thing - but possibly a very long living one...

Richard.


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

* Re: RFC - Refactor tree.h
  2013-08-11  7:59       ` Richard Biener
@ 2013-08-12 20:36         ` Mike Stump
  0 siblings, 0 replies; 39+ messages in thread
From: Mike Stump @ 2013-08-12 20:36 UTC (permalink / raw)
  To: Richard Biener; +Cc: Diego Novillo, Andrew Macleod, gcc-patches

On Aug 11, 2013, at 1:00 AM, Richard Biener <richard.guenther@gmail.com> wrote:
> Fact is that we need to separate internal details of tree.h into sth shareable from exactly two places.  Tree-core.h and tree.h are both 'tree.h' in some way. Call it tree-internal.h or tree1.h.

1 is also a bad category; internal or core is better.

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

* Re: RFC - Refactor tree.h
  2013-08-10 10:02   ` Richard Biener
  2013-08-10 19:03     ` Mike Stump
@ 2013-08-21 17:31     ` Andrew MacLeod
  2013-08-21 21:47       ` Mike Stump
  1 sibling, 1 reply; 39+ messages in thread
From: Andrew MacLeod @ 2013-08-21 17:31 UTC (permalink / raw)
  To: Richard Biener; +Cc: Mike Stump, Diego Novillo, gcc-patches

On 08/10/2013 06:03 AM, Richard Biener wrote:
> Mike Stump <mikestump@comcast.net> wrote:
>> On Aug 9, 2013, at 3:36 PM, Diego Novillo <dnovillo@google.com> wrote:
>>> This patch is still WIP.  It builds stage1, but I'm getting ICEs
>>> during stage 2.
>>>
>>> The patch splits tree.h into three files:
>>>
>>> - tree-core.h: All data structures, enums and typedefs from
>>>   tree.h
>>>
>>> - tree-api.h: All extern function definitions from tree.h
>>>
>>> - tree-macros.h: All macro accessors, tree checks and other
>>>   inline functions.
>> I don't like this split.  You focus in on the details and sort code by
>> detail.  I think this is wrong.  I want code sorted by the features and
>> functions it provides, and all like this, go into explainable
>> functional bins.  One day, a function might be implemented by a data
>> structure, the next day, by a routine, or a macro, or an inline
>> function, the form of it doesn't matter.
> I mostly agree - tree-macros.h is a red herring. It should be tree-core.h and tree.h only. What does not belong there should go to other appropriate places, like fold-const.h for example.
>

the reason for the tri-split is because many of the "appropriate" places 
for function prototypes don't exist yet...  they were thrown in tree.h 
or tree-flow.h because no one wanted to create a small header file as an 
appropriate place, or was too lazy to figure it out.

The idea here is to get all those into a file of their own so they can 
then be dealt with later, but not impact the code base much. They don't 
need any of the tree accessor macros, nor even the tree structural 
content, just the "struct tree *" from core-types. . This means the 
tree-api.h file can be included by tree.h for untouched files, and can 
also be included from gimple.h for those which have been converted and 
no longer include tree.h.    Leaving them in tree.h defeats the purpose 
of the split since tree.h would have to be included by files using 
gimple.h in order to see the prototypes.. and that would then bring in 
all the tree macros again.

So really, the content of tree-macro.h should be called tree.h, and that 
should include the tree-core.h file as well as the tree-api.h file.   
Then all existing files which include tree.h get exactly what they have 
today.

We are then left with this tree-api.h file which will be included from 2 
places.. tree.h and gimple.h.   As files are converted to the new gimple 
form, any functions which use to have 'tree' in the prototype are going 
to be converted to GimpleType or whatever, and the tree prototype(s) 
will be removed from tree-api.h.  At that point, the prototype(s) will 
be put in an appropriate header file, creating one if need be, and 
included as needed.

So that is my rationale for the 3 way split of tree.h I proposed to Diego.

We could do that tree-api work upfront.. everything that is in 
tree-api.h could be given a new home, which would require creating some 
more header files and changing the #include footprint in various files.  
I was just trying to minimize the turmoil in the 4.9 source base... :-)

Andrew


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

* Re: RFC - Refactor tree.h
  2013-08-21 17:31     ` Andrew MacLeod
@ 2013-08-21 21:47       ` Mike Stump
  2013-08-22 14:06         ` Andrew MacLeod
  0 siblings, 1 reply; 39+ messages in thread
From: Mike Stump @ 2013-08-21 21:47 UTC (permalink / raw)
  To: Andrew MacLeod; +Cc: Richard Biener, Diego Novillo, gcc-patches

On Aug 21, 2013, at 10:23 AM, Andrew MacLeod <amacleod@redhat.com> wrote:
> On 08/10/2013 06:03 AM, Richard Biener wrote:
>> Mike Stump <mikestump@comcast.net> wrote:
>>> On Aug 9, 2013, at 3:36 PM, Diego Novillo <dnovillo@google.com> wrote:
>>>> This patch is still WIP.  It builds stage1, but I'm getting ICEs
>>>> during stage 2.
>>>> 
>>>> The patch splits tree.h into three files:
>>>> 
>>>> - tree-core.h: All data structures, enums and typedefs from
>>>>  tree.h
>>>> 
>>>> - tree-api.h: All extern function definitions from tree.h
>>>> 
>>>> - tree-macros.h: All macro accessors, tree checks and other
>>>>  inline functions.
>>> I don't like this split.  You focus in on the details and sort code by
>>> detail.  I think this is wrong.  I want code sorted by the features and
>>> functions it provides, and all like this, go into explainable
>>> functional bins.  One day, a function might be implemented by a data
>>> structure, the next day, by a routine, or a macro, or an inline
>>> function, the form of it doesn't matter.
>> I mostly agree - tree-macros.h is a red herring. It should be tree-core.h and tree.h only. What does not belong there should go to other appropriate places, like fold-const.h for example.
>> 
> 
> the reason for the tri-split is because many of the "appropriate" places for function prototypes don't exist yet...  they were thrown in tree.h or tree-flow.h because no one wanted to create a small header file as an appropriate place, or was too lazy to figure it out.

Ok.  But creating a new bad place for them to live, just to eject them from tree.h, is wasteful.  Design a better spot that is good, then make it happen.  tree-api.h isn't good.  It is just another random stop-gap; let's live with the tree.h random stop-gap.  When you are done with stop gaps, then move them.

> The idea here is to get all those into a file of their own so they can then be dealt with later, but not impact the code base much. They don't need any of the tree accessor macros, nor even the tree structural content, just the "struct tree *" from core-types. . This means the tree-api.h file can be included by tree.h for untouched files, and can also be included from gimple.h for those which have been converted and no longer include tree.h.    Leaving them in tree.h defeats the purpose of the split since tree.h would have to be included by files using gimple.h in order to see the prototypes.. and that would then bring in all the tree macros again.

No.  tree-core.h has the api and the data structures.  gimple.h uses this, as it wants all in it.  gimple.h doesn't use tree.h, as it doesn't want the macro and any other content you want to exclude.  This is two use cases, so, two files.

> So really, the content of tree-macro.h should be called tree.h,

Yes.

> that should include the tree-core.h file as well as the tree-api.h file.

No…  I don't see a client for tree-api.  Logically, you can segregate them down at the bottom of tree-core.h.

> We are then left with this tree-api.h file which will be included from 2 places.. tree.h and gimple.h.   As files are converted to the new gimple form, any functions which use to have 'tree' in the prototype are going to be converted to GimpleType or whatever, and the tree prototype(s) will be removed from tree-api.h.  At that point, the prototype(s) will be put in an appropriate header file, creating one if need be, and included as needed.

One can move them from tree-core.h or to any other home as appropriate.

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

* Re: RFC - Refactor tree.h
  2013-08-21 21:47       ` Mike Stump
@ 2013-08-22 14:06         ` Andrew MacLeod
  2013-08-31  2:04           ` Diego Novillo
  0 siblings, 1 reply; 39+ messages in thread
From: Andrew MacLeod @ 2013-08-22 14:06 UTC (permalink / raw)
  To: Mike Stump; +Cc: Richard Biener, Diego Novillo, gcc-patches

On 08/21/2013 05:13 PM, Mike Stump wrote:
> O
>> that should include the tree-core.h file as well as the tree-api.h file.
> NoÂ…  I don't see a client for tree-api.  Logically, you can segregate them down at the bottom of tree-core.h.
>
>> We are then left with this tree-api.h file which will be included from 2 places.. tree.h and gimple.h.   As files are converted to the new gimple form, any functions which use to have 'tree' in the prototype are going to be converted to GimpleType or whatever, and the tree prototype(s) will be removed from tree-api.h.  At that point, the prototype(s) will be put in an appropriate header file, creating one if need be, and included as needed.
> One can move them from tree-core.h or to any other home as appropriate.
OK, I see what you are saying, and it makes sense.

I was thinking there would be other uses for the tree-api.h file and 
didn't want to pollute tree-core.h... for instance, the tree-builder 
inline functions are going to need to be accessible in files which have 
been converted as well, but I'll worry about that when I get to it... I 
will likely create gimple object routines to do the equivalent anyway.  
And I'll deal with anything else as it arises.

so we would have:
- tree-core.h which has the tree structure's first, then all the 
prototypes at the end of that file which would have been in 
tree-api.h    In theory, these eventually all find better homes.
- tree.h  which includes tree-core.h, then all the macros and such.

I can live with that, it enables what I need to do and has minimal impact.

Andrew

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

* Re: RFC - Refactor tree.h
  2013-08-22 14:06         ` Andrew MacLeod
@ 2013-08-31  2:04           ` Diego Novillo
  2013-09-02  9:41             ` Richard Biener
  2013-09-05  0:06             ` RFC - Refactor tree.h Mike Stump
  0 siblings, 2 replies; 39+ messages in thread
From: Diego Novillo @ 2013-08-31  2:04 UTC (permalink / raw)
  To: Andrew MacLeod; +Cc: Mike Stump, Richard Biener, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 782 bytes --]

Thanks for the suggestions.  I've incorporated them into the patch.
It now adds tree-core.h with all the structures, enums, typedefs and
some fundamental declarations from tree.h.  Everything else stays in
tree.h for now.

As we convert gimple files, we'll move declarations out of tree.h into
other headers and rewrite missing functions in the new gimple API.

This new patch bootstraps and tests fine on x86_64.

OK for trunk?

2013-08-30  Diego Novillo  <dnovillo@google.com>

* Makefile.in (TREE_CORE_H): Define.
(TREE_H): Use.
(GTFILES): Add tree-core.h.
* builtins.c (built_in_class_names): Use BUILT_IN_LAST to
size the array.
* tree-core.h: New file.
Move all data structures, enum, typedefs, global
declarations and constants from ...
* tree.h: ... here.


Thanks.  Diego.

[-- Attachment #2: 0001-Split-data-structures-out-of-tree.h.-Step-1-structur.patch --]
[-- Type: application/octet-stream, Size: 119342 bytes --]

2013-08-30  Diego Novillo  <dnovillo@google.com>

	* Makefile.in (TREE_CORE_H): Define.
	(TREE_H): Use.
	(GTFILES): Add tree-core.h.
	* builtins.c (built_in_class_names): Use BUILT_IN_LAST to
	size the array.
	* tree-core.h: New file.
	Move all data structures, enum, typedefs, global
	declarations and constants from ...
	* tree.h: ... here.

From 4e48d6054064703e30a86ed90c74b38509e41583 Mon Sep 17 00:00:00 2001
From: Diego Novillo <dnovillo@google.com>
Date: Fri, 30 Aug 2013 11:42:18 -0400
Subject: [PATCH] Split data structures out of tree.h.  Step 1: structures,
 enum and typedefs.

---
 gcc/Makefile.in |   11 +-
 gcc/builtins.c  |    2 +-
 gcc/tree-core.h | 1688 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 gcc/tree.h      | 1702 +------------------------------------------------------
 4 files changed, 1698 insertions(+), 1705 deletions(-)
 create mode 100644 gcc/tree-core.h

diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 7396313..4f1164f 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -872,11 +872,13 @@ BUILTINS_DEF = builtins.def sync-builtins.def omp-builtins.def \
 	gtm-builtins.def sanitizer.def cilkplus.def
 INTERNAL_FN_DEF = internal-fn.def
 INTERNAL_FN_H = internal-fn.h $(INTERNAL_FN_DEF)
-TREE_H = coretypes.h tree.h all-tree.def tree.def c-family/c-common.def \
-	$(lang_tree_files) $(MACHMODE_H) tree-check.h $(BUILTINS_DEF) \
-	$(INPUT_H) statistics.h $(VEC_H) treestruct.def $(HASHTAB_H) \
+TREE_CORE_H = tree-core.h coretypes.h all-tree.def tree.def \
+	c-family/c-common.def $(lang_tree_files) $(MACHMODE_H) \
+	$(BUILTINS_DEF) $(INPUT_H) statistics.h \
+	$(VEC_H) treestruct.def $(HASHTAB_H) \
 	double-int.h alias.h $(SYMTAB_H) $(FLAGS_H) \
 	$(REAL_H) $(FIXED_VALUE_H)
+TREE_H = tree.h $(TREE_CORE_H)  tree-check.h
 REGSET_H = regset.h $(BITMAP_H) hard-reg-set.h
 BASIC_BLOCK_H = basic-block.h $(PREDICT_H) $(VEC_H) $(FUNCTION_H) \
 	cfg-flags.def cfghooks.h
@@ -3789,7 +3791,8 @@ GTFILES = $(CPP_ID_DATA_H) $(srcdir)/input.h $(srcdir)/coretypes.h \
   $(host_xm_file_list) \
   $(tm_file_list) $(HASHTAB_H) $(SPLAY_TREE_H) $(srcdir)/bitmap.h \
   $(srcdir)/alias.h $(srcdir)/coverage.c $(srcdir)/rtl.h \
-  $(srcdir)/optabs.h $(srcdir)/tree.h $(srcdir)/libfuncs.h $(SYMTAB_H) \
+  $(srcdir)/optabs.h $(srcdir)/tree.h $(srcdir)/tree-core.h \
+  $(srcdir)/libfuncs.h $(SYMTAB_H) \
   $(srcdir)/real.h $(srcdir)/function.h $(srcdir)/insn-addr.h $(srcdir)/hwint.h \
   $(srcdir)/fixed-value.h \
   $(srcdir)/output.h $(srcdir)/cfgloop.h \
diff --git a/gcc/builtins.c b/gcc/builtins.c
index 92aec31..6d7b99f 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -62,7 +62,7 @@ struct target_builtins *this_target_builtins = &default_target_builtins;
 #endif
 
 /* Define the names of the builtin function types and codes.  */
-const char *const built_in_class_names[4]
+const char *const built_in_class_names[BUILT_IN_LAST]
   = {"NOT_BUILT_IN", "BUILT_IN_FRONTEND", "BUILT_IN_MD", "BUILT_IN_NORMAL"};
 
 #define DEF_BUILTIN(X, N, C, T, LT, B, F, NA, AT, IM, COND) #X,
diff --git a/gcc/tree-core.h b/gcc/tree-core.h
new file mode 100644
index 0000000..57d5e9c
--- /dev/null
+++ b/gcc/tree-core.h
@@ -0,0 +1,1688 @@
+/* Core data structures for the 'tree' type.
+   Copyright (C) 1989-2013 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3.  If not see
+<http://www.gnu.org/licenses/>.  */
+
+#ifndef GCC_TREE_CORE_H
+#define GCC_TREE_CORE_H
+
+#include "hashtab.h"
+#include "machmode.h"
+#include "input.h"
+#include "statistics.h"
+#include "vec.h"
+#include "double-int.h"
+#include "real.h"
+#include "fixed-value.h"
+#include "alias.h"
+#include "flags.h"
+#include "symtab.h"
+
+/* This file contains all the data structures that define the 'tree' type.
+   There are no accessor macros nor functions in this file. Only the
+   basic data structures, extern declarations and type definitions.  */
+
+/*---------------------------------------------------------------------------
+   Forward type declarations.  Mostly to avoid including unnecessary headers
+---------------------------------------------------------------------------*/
+struct function;
+struct real_value;
+struct fixed_value;
+struct ptr_info_def;
+struct die_struct;
+struct pointer_set_t;
+
+
+/*---------------------------------------------------------------------------
+                              #defined constants
+---------------------------------------------------------------------------*/
+/* Nonzero if this is a call to a function whose return value depends
+   solely on its arguments, has no side effects, and does not read
+   global memory.  This corresponds to TREE_READONLY for function
+   decls.  */
+#define ECF_CONST		  (1 << 0)
+
+/* Nonzero if this is a call to "pure" function (like const function,
+   but may read memory.  This corresponds to DECL_PURE_P for function
+   decls.  */
+#define ECF_PURE		  (1 << 1)
+
+/* Nonzero if this is ECF_CONST or ECF_PURE but cannot be proven to no
+   infinite loop.  This corresponds to DECL_LOOPING_CONST_OR_PURE_P
+   for function decls.*/
+#define ECF_LOOPING_CONST_OR_PURE (1 << 2)
+
+/* Nonzero if this call will never return.  */
+#define ECF_NORETURN		  (1 << 3)
+
+/* Nonzero if this is a call to malloc or a related function.  */
+#define ECF_MALLOC		  (1 << 4)
+
+/* Nonzero if it is plausible that this is a call to alloca.  */
+#define ECF_MAY_BE_ALLOCA	  (1 << 5)
+
+/* Nonzero if this is a call to a function that won't throw an exception.  */
+#define ECF_NOTHROW		  (1 << 6)
+
+/* Nonzero if this is a call to setjmp or a related function.  */
+#define ECF_RETURNS_TWICE	  (1 << 7)
+
+/* Nonzero if this call replaces the current stack frame.  */
+#define ECF_SIBCALL		  (1 << 8)
+
+/* Function does not read or write memory (but may have side effects, so
+   it does not necessarily fit ECF_CONST).  */
+#define ECF_NOVOPS		  (1 << 9)
+
+/* The function does not lead to calls within current function unit.  */
+#define ECF_LEAF		  (1 << 10)
+
+/* Nonzero if this call does not affect transactions.  */
+#define ECF_TM_PURE		  (1 << 11)
+
+/* Nonzero if this call is into the transaction runtime library.  */
+#define ECF_TM_BUILTIN		  (1 << 12)
+
+/* Call argument flags.  */
+/* Nonzero if the argument is not dereferenced recursively, thus only
+   directly reachable memory is read or written.  */
+#define EAF_DIRECT		(1 << 0)
+
+/* Nonzero if memory reached by the argument is not clobbered.  */
+#define EAF_NOCLOBBER		(1 << 1)
+
+/* Nonzero if the argument does not escape.  */
+#define EAF_NOESCAPE		(1 << 2)
+
+/* Nonzero if the argument is not used by the function.  */
+#define EAF_UNUSED		(1 << 3)
+
+/* Call return flags.  */
+/* Mask for the argument number that is returned.  Lower two bits of
+   the return flags, encodes argument slots zero to three.  */
+#define ERF_RETURN_ARG_MASK	(3)
+
+/* Nonzero if the return value is equal to the argument number
+   flags & ERF_RETURN_ARG_MASK.  */
+#define ERF_RETURNS_ARG		(1 << 2)
+
+/* Nonzero if the return value does not alias with anything.  Functions
+   with the malloc attribute have this set on their return value.  */
+#define ERF_NOALIAS		(1 << 3)
+
+
+/*---------------------------------------------------------------------------
+                                  Enumerations
+---------------------------------------------------------------------------*/
+/* Codes of tree nodes.  */
+#define DEFTREECODE(SYM, STRING, TYPE, NARGS)   SYM,
+#define END_OF_BASE_TREE_CODES LAST_AND_UNUSED_TREE_CODE,
+
+enum tree_code {
+#include "all-tree.def"
+MAX_TREE_CODES
+};
+
+#undef DEFTREECODE
+#undef END_OF_BASE_TREE_CODES
+
+/* Number of language-independent tree codes.  */
+#define NUM_TREE_CODES \
+  ((int) LAST_AND_UNUSED_TREE_CODE)
+
+#define CODE_CONTAINS_STRUCT(CODE, STRUCT) \
+  (tree_contains_struct[(CODE)][(STRUCT)])
+
+
+/* Classify which part of the compiler has defined a given builtin function.
+   Note that we assume below that this is no more than two bits.  */
+enum built_in_class {
+  NOT_BUILT_IN = 0,
+  BUILT_IN_FRONTEND,
+  BUILT_IN_MD,
+  BUILT_IN_NORMAL
+};
+
+/* Last marker used for LTO stremaing of built_in_class.  We can not add it
+   to the enum since we need the enumb to fit in 2 bits.  */
+#define BUILT_IN_LAST (BUILT_IN_NORMAL + 1)
+
+/* Codes that identify the various built in functions
+   so that expand_call can identify them quickly.  */
+#define DEF_BUILTIN(ENUM, N, C, T, LT, B, F, NA, AT, IM, COND) ENUM,
+enum built_in_function {
+#include "builtins.def"
+
+  /* Complex division routines in libgcc.  These are done via builtins
+     because emit_library_call_value can't handle complex values.  */
+  BUILT_IN_COMPLEX_MUL_MIN,
+  BUILT_IN_COMPLEX_MUL_MAX
+    = BUILT_IN_COMPLEX_MUL_MIN
+      + MAX_MODE_COMPLEX_FLOAT
+      - MIN_MODE_COMPLEX_FLOAT,
+
+  BUILT_IN_COMPLEX_DIV_MIN,
+  BUILT_IN_COMPLEX_DIV_MAX
+    = BUILT_IN_COMPLEX_DIV_MIN
+      + MAX_MODE_COMPLEX_FLOAT
+      - MIN_MODE_COMPLEX_FLOAT,
+
+  /* Upper bound on non-language-specific builtins.  */
+  END_BUILTINS
+};
+#undef DEF_BUILTIN
+
+/* Tree code classes.  Each tree_code has an associated code class
+   represented by a TREE_CODE_CLASS.  */
+enum tree_code_class {
+  tcc_exceptional, /* An exceptional code (fits no category).  */
+  tcc_constant,    /* A constant.  */
+  /* Order of tcc_type and tcc_declaration is important.  */
+  tcc_type,        /* A type object code.  */
+  tcc_declaration, /* A declaration (also serving as variable refs).  */
+  tcc_reference,   /* A reference to storage.  */
+  tcc_comparison,  /* A comparison expression.  */
+  tcc_unary,       /* A unary arithmetic expression.  */
+  tcc_binary,      /* A binary arithmetic expression.  */
+  tcc_statement,   /* A statement expression, which have side effects
+		      but usually no interesting value.  */
+  tcc_vl_exp,      /* A function call or other expression with a
+		      variable-length operand vector.  */
+  tcc_expression   /* Any other expression.  */
+};
+
+/* OMP_CLAUSE codes.  Do not reorder, as this is used to index into
+   the tables omp_clause_num_ops and omp_clause_code_name.  */
+enum omp_clause_code {
+  /* Clause zero is special-cased inside the parser
+     (c_parser_omp_variable_list).  */
+  OMP_CLAUSE_ERROR = 0,
+
+  /* OpenMP clause: private (variable_list).  */
+  OMP_CLAUSE_PRIVATE,
+
+  /* OpenMP clause: shared (variable_list).  */
+  OMP_CLAUSE_SHARED,
+
+  /* OpenMP clause: firstprivate (variable_list).  */
+  OMP_CLAUSE_FIRSTPRIVATE,
+
+  /* OpenMP clause: lastprivate (variable_list).  */
+  OMP_CLAUSE_LASTPRIVATE,
+
+  /* OpenMP clause: reduction (operator:variable_list).
+     OMP_CLAUSE_REDUCTION_CODE: The tree_code of the operator.
+     Operand 1: OMP_CLAUSE_REDUCTION_INIT: Stmt-list to initialize the var.
+     Operand 2: OMP_CLAUSE_REDUCTION_MERGE: Stmt-list to merge private var
+                into the shared one.
+     Operand 3: OMP_CLAUSE_REDUCTION_PLACEHOLDER: A dummy VAR_DECL
+                placeholder used in OMP_CLAUSE_REDUCTION_{INIT,MERGE}.  */
+  OMP_CLAUSE_REDUCTION,
+
+  /* OpenMP clause: copyin (variable_list).  */
+  OMP_CLAUSE_COPYIN,
+
+  /* OpenMP clause: copyprivate (variable_list).  */
+  OMP_CLAUSE_COPYPRIVATE,
+
+  /* OpenMP clause: linear (variable-list[:linear-step]).  */
+  OMP_CLAUSE_LINEAR,
+
+  /* OpenMP clause: uniform (argument-list).  */
+  OMP_CLAUSE_UNIFORM,
+
+  /* OpenMP clause: if (scalar-expression).  */
+  OMP_CLAUSE_IF,
+
+  /* OpenMP clause: num_threads (integer-expression).  */
+  OMP_CLAUSE_NUM_THREADS,
+
+  /* OpenMP clause: schedule.  */
+  OMP_CLAUSE_SCHEDULE,
+
+  /* OpenMP clause: nowait.  */
+  OMP_CLAUSE_NOWAIT,
+
+  /* OpenMP clause: ordered.  */
+  OMP_CLAUSE_ORDERED,
+
+  /* OpenMP clause: default.  */
+  OMP_CLAUSE_DEFAULT,
+
+  /* OpenMP clause: collapse (constant-integer-expression).  */
+  OMP_CLAUSE_COLLAPSE,
+
+  /* OpenMP clause: untied.  */
+  OMP_CLAUSE_UNTIED,
+
+  /* OpenMP clause: final (scalar-expression).  */
+  OMP_CLAUSE_FINAL,
+
+  /* OpenMP clause: mergeable.  */
+  OMP_CLAUSE_MERGEABLE,
+
+  /* OpenMP clause: safelen (constant-integer-expression).  */
+  OMP_CLAUSE_SAFELEN,
+
+  /* Internally used only clause, holding SIMD uid.  */
+  OMP_CLAUSE__SIMDUID_
+};
+
+#undef DEFTREESTRUCT
+#define DEFTREESTRUCT(ENUM, NAME) ENUM,
+enum tree_node_structure_enum {
+#include "treestruct.def"
+  LAST_TS_ENUM
+};
+#undef DEFTREESTRUCT
+
+enum omp_clause_schedule_kind {
+  OMP_CLAUSE_SCHEDULE_STATIC,
+  OMP_CLAUSE_SCHEDULE_DYNAMIC,
+  OMP_CLAUSE_SCHEDULE_GUIDED,
+  OMP_CLAUSE_SCHEDULE_AUTO,
+  OMP_CLAUSE_SCHEDULE_RUNTIME
+};
+
+enum omp_clause_default_kind {
+  OMP_CLAUSE_DEFAULT_UNSPECIFIED,
+  OMP_CLAUSE_DEFAULT_SHARED,
+  OMP_CLAUSE_DEFAULT_NONE,
+  OMP_CLAUSE_DEFAULT_PRIVATE,
+  OMP_CLAUSE_DEFAULT_FIRSTPRIVATE
+};
+
+/* There is a TYPE_QUAL value for each type qualifier.  They can be
+   combined by bitwise-or to form the complete set of qualifiers for a
+   type.  */
+enum cv_qualifier {
+  TYPE_UNQUALIFIED   = 0x0,
+  TYPE_QUAL_CONST    = 0x1,
+  TYPE_QUAL_VOLATILE = 0x2,
+  TYPE_QUAL_RESTRICT = 0x4
+};
+
+/* Enumerate visibility settings.  */
+#ifndef SYMBOL_VISIBILITY_DEFINED
+#define SYMBOL_VISIBILITY_DEFINED
+enum symbol_visibility {
+  VISIBILITY_DEFAULT,
+  VISIBILITY_PROTECTED,
+  VISIBILITY_HIDDEN,
+  VISIBILITY_INTERNAL
+};
+#endif  // SYMBOL_VISIBILITY_DEFINED
+
+/* Standard named or nameless data types of the C compiler.  */
+enum tree_index {
+  TI_ERROR_MARK,
+  TI_INTQI_TYPE,
+  TI_INTHI_TYPE,
+  TI_INTSI_TYPE,
+  TI_INTDI_TYPE,
+  TI_INTTI_TYPE,
+
+  TI_UINTQI_TYPE,
+  TI_UINTHI_TYPE,
+  TI_UINTSI_TYPE,
+  TI_UINTDI_TYPE,
+  TI_UINTTI_TYPE,
+
+  TI_UINT16_TYPE,
+  TI_UINT32_TYPE,
+  TI_UINT64_TYPE,
+
+  TI_INTEGER_ZERO,
+  TI_INTEGER_ONE,
+  TI_INTEGER_THREE,
+  TI_INTEGER_MINUS_ONE,
+  TI_NULL_POINTER,
+
+  TI_SIZE_ZERO,
+  TI_SIZE_ONE,
+
+  TI_BITSIZE_ZERO,
+  TI_BITSIZE_ONE,
+  TI_BITSIZE_UNIT,
+
+  TI_PUBLIC,
+  TI_PROTECTED,
+  TI_PRIVATE,
+
+  TI_BOOLEAN_FALSE,
+  TI_BOOLEAN_TRUE,
+
+  TI_COMPLEX_INTEGER_TYPE,
+  TI_COMPLEX_FLOAT_TYPE,
+  TI_COMPLEX_DOUBLE_TYPE,
+  TI_COMPLEX_LONG_DOUBLE_TYPE,
+
+  TI_FLOAT_TYPE,
+  TI_DOUBLE_TYPE,
+  TI_LONG_DOUBLE_TYPE,
+
+  TI_FLOAT_PTR_TYPE,
+  TI_DOUBLE_PTR_TYPE,
+  TI_LONG_DOUBLE_PTR_TYPE,
+  TI_INTEGER_PTR_TYPE,
+
+  TI_VOID_TYPE,
+  TI_PTR_TYPE,
+  TI_CONST_PTR_TYPE,
+  TI_SIZE_TYPE,
+  TI_PID_TYPE,
+  TI_PTRDIFF_TYPE,
+  TI_VA_LIST_TYPE,
+  TI_VA_LIST_GPR_COUNTER_FIELD,
+  TI_VA_LIST_FPR_COUNTER_FIELD,
+  TI_BOOLEAN_TYPE,
+  TI_FILEPTR_TYPE,
+  TI_POINTER_SIZED_TYPE,
+
+  TI_DFLOAT32_TYPE,
+  TI_DFLOAT64_TYPE,
+  TI_DFLOAT128_TYPE,
+  TI_DFLOAT32_PTR_TYPE,
+  TI_DFLOAT64_PTR_TYPE,
+  TI_DFLOAT128_PTR_TYPE,
+
+  TI_VOID_LIST_NODE,
+
+  TI_MAIN_IDENTIFIER,
+
+  TI_SAT_SFRACT_TYPE,
+  TI_SAT_FRACT_TYPE,
+  TI_SAT_LFRACT_TYPE,
+  TI_SAT_LLFRACT_TYPE,
+  TI_SAT_USFRACT_TYPE,
+  TI_SAT_UFRACT_TYPE,
+  TI_SAT_ULFRACT_TYPE,
+  TI_SAT_ULLFRACT_TYPE,
+  TI_SFRACT_TYPE,
+  TI_FRACT_TYPE,
+  TI_LFRACT_TYPE,
+  TI_LLFRACT_TYPE,
+  TI_USFRACT_TYPE,
+  TI_UFRACT_TYPE,
+  TI_ULFRACT_TYPE,
+  TI_ULLFRACT_TYPE,
+  TI_SAT_SACCUM_TYPE,
+  TI_SAT_ACCUM_TYPE,
+  TI_SAT_LACCUM_TYPE,
+  TI_SAT_LLACCUM_TYPE,
+  TI_SAT_USACCUM_TYPE,
+  TI_SAT_UACCUM_TYPE,
+  TI_SAT_ULACCUM_TYPE,
+  TI_SAT_ULLACCUM_TYPE,
+  TI_SACCUM_TYPE,
+  TI_ACCUM_TYPE,
+  TI_LACCUM_TYPE,
+  TI_LLACCUM_TYPE,
+  TI_USACCUM_TYPE,
+  TI_UACCUM_TYPE,
+  TI_ULACCUM_TYPE,
+  TI_ULLACCUM_TYPE,
+  TI_QQ_TYPE,
+  TI_HQ_TYPE,
+  TI_SQ_TYPE,
+  TI_DQ_TYPE,
+  TI_TQ_TYPE,
+  TI_UQQ_TYPE,
+  TI_UHQ_TYPE,
+  TI_USQ_TYPE,
+  TI_UDQ_TYPE,
+  TI_UTQ_TYPE,
+  TI_SAT_QQ_TYPE,
+  TI_SAT_HQ_TYPE,
+  TI_SAT_SQ_TYPE,
+  TI_SAT_DQ_TYPE,
+  TI_SAT_TQ_TYPE,
+  TI_SAT_UQQ_TYPE,
+  TI_SAT_UHQ_TYPE,
+  TI_SAT_USQ_TYPE,
+  TI_SAT_UDQ_TYPE,
+  TI_SAT_UTQ_TYPE,
+  TI_HA_TYPE,
+  TI_SA_TYPE,
+  TI_DA_TYPE,
+  TI_TA_TYPE,
+  TI_UHA_TYPE,
+  TI_USA_TYPE,
+  TI_UDA_TYPE,
+  TI_UTA_TYPE,
+  TI_SAT_HA_TYPE,
+  TI_SAT_SA_TYPE,
+  TI_SAT_DA_TYPE,
+  TI_SAT_TA_TYPE,
+  TI_SAT_UHA_TYPE,
+  TI_SAT_USA_TYPE,
+  TI_SAT_UDA_TYPE,
+  TI_SAT_UTA_TYPE,
+
+  TI_OPTIMIZATION_DEFAULT,
+  TI_OPTIMIZATION_CURRENT,
+  TI_TARGET_OPTION_DEFAULT,
+  TI_TARGET_OPTION_CURRENT,
+  TI_CURRENT_TARGET_PRAGMA,
+  TI_CURRENT_OPTIMIZE_PRAGMA,
+
+  TI_MAX
+};
+
+/* An enumeration of the standard C integer types.  These must be
+   ordered so that shorter types appear before longer ones, and so
+   that signed types appear before unsigned ones, for the correct
+   functioning of interpret_integer() in c-lex.c.  */
+enum integer_type_kind {
+  itk_char,
+  itk_signed_char,
+  itk_unsigned_char,
+  itk_short,
+  itk_unsigned_short,
+  itk_int,
+  itk_unsigned_int,
+  itk_long,
+  itk_unsigned_long,
+  itk_long_long,
+  itk_unsigned_long_long,
+  itk_int128,
+  itk_unsigned_int128,
+  itk_none
+};
+
+/* A pointer-to-function member type looks like:
+
+     struct {
+       __P __pfn;
+       ptrdiff_t __delta;
+     };
+
+   If __pfn is NULL, it is a NULL pointer-to-member-function.
+
+   (Because the vtable is always the first thing in the object, we
+   don't need its offset.)  If the function is virtual, then PFN is
+   one plus twice the index into the vtable; otherwise, it is just a
+   pointer to the function.
+
+   Unfortunately, using the lowest bit of PFN doesn't work in
+   architectures that don't impose alignment requirements on function
+   addresses, or that use the lowest bit to tell one ISA from another,
+   for example.  For such architectures, we use the lowest bit of
+   DELTA instead of the lowest bit of the PFN, and DELTA will be
+   multiplied by 2.  */
+enum ptrmemfunc_vbit_where_t {
+  ptrmemfunc_vbit_in_pfn,
+  ptrmemfunc_vbit_in_delta
+};
+
+/* Flags that may be passed in the third argument of decl_attributes, and
+   to handler functions for attributes.  */
+enum attribute_flags {
+  /* The type passed in is the type of a DECL, and any attributes that
+     should be passed in again to be applied to the DECL rather than the
+     type should be returned.  */
+  ATTR_FLAG_DECL_NEXT = 1,
+  /* The type passed in is a function return type, and any attributes that
+     should be passed in again to be applied to the function type rather
+     than the return type should be returned.  */
+  ATTR_FLAG_FUNCTION_NEXT = 2,
+  /* The type passed in is an array element type, and any attributes that
+     should be passed in again to be applied to the array type rather
+     than the element type should be returned.  */
+  ATTR_FLAG_ARRAY_NEXT = 4,
+  /* The type passed in is a structure, union or enumeration type being
+     created, and should be modified in place.  */
+  ATTR_FLAG_TYPE_IN_PLACE = 8,
+  /* The attributes are being applied by default to a library function whose
+     name indicates known behavior, and should be silently ignored if they
+     are not in fact compatible with the function type.  */
+  ATTR_FLAG_BUILT_IN = 16,
+  /* A given attribute has been parsed as a C++-11 attribute.  */
+  ATTR_FLAG_CXX11 = 32
+};
+
+/* Types used to represent sizes.  */
+enum size_type_kind {
+  stk_sizetype,		/* Normal representation of sizes in bytes.  */
+  stk_ssizetype,	/* Signed representation of sizes in bytes.  */
+  stk_bitsizetype,	/* Normal representation of sizes in bits.  */
+  stk_sbitsizetype,	/* Signed representation of sizes in bits.  */
+  stk_type_kind_last
+};
+
+enum operand_equal_flag {
+  OEP_ONLY_CONST = 1,
+  OEP_PURE_SAME = 2,
+  OEP_CONSTANT_ADDRESS_OF = 4
+};
+
+/* Enum and arrays used for tree allocation stats.
+   Keep in sync with tree.c:tree_node_kind_names.  */
+enum tree_node_kind {
+  d_kind,
+  t_kind,
+  b_kind,
+  s_kind,
+  r_kind,
+  e_kind,
+  c_kind,
+  id_kind,
+  vec_kind,
+  binfo_kind,
+  ssa_name_kind,
+  constr_kind,
+  x_kind,
+  lang_decl,
+  lang_type,
+  omp_clause_kind,
+  all_kinds
+};
+
+
+/*---------------------------------------------------------------------------
+                                Type definitions
+---------------------------------------------------------------------------*/
+/* When processing aliases at the symbol table level, we need the
+   declaration of target. For this reason we need to queue aliases and
+   process them after all declarations has been produced.  */
+typedef struct GTY(()) alias_pair {
+  tree decl;
+  tree target;
+} alias_pair;
+
+/* An initialization priority.  */
+typedef unsigned short priority_type;
+
+/* The type of a callback function for walking over tree structure.  */
+typedef tree (*walk_tree_fn) (tree *, int *, void *);
+
+/* The type of a callback function that represents a custom walk_tree.  */
+typedef tree (*walk_tree_lh) (tree *, int *, tree (*) (tree *, int *, void *),
+			      void *, struct pointer_set_t*);
+
+
+/*---------------------------------------------------------------------------
+                              Main data structures
+---------------------------------------------------------------------------*/
+/* A tree node can represent a data type, a variable, an expression
+   or a statement.  Each node has a TREE_CODE which says what kind of
+   thing it represents.  Some common codes are:
+   INTEGER_TYPE -- represents a type of integers.
+   ARRAY_TYPE -- represents a type of pointer.
+   VAR_DECL -- represents a declared variable.
+   INTEGER_CST -- represents a constant integer value.
+   PLUS_EXPR -- represents a sum (an expression).
+
+   As for the contents of a tree node: there are some fields
+   that all nodes share.  Each TREE_CODE has various special-purpose
+   fields as well.  The fields of a node are never accessed directly,
+   always through accessor macros.  */
+
+/* Every kind of tree node starts with this structure,
+   so all nodes have these fields.
+
+   See the accessor macros, defined below, for documentation of the
+   fields, and the table below which connects the fields and the
+   accessor macros.  */
+
+struct GTY(()) tree_base {
+  ENUM_BITFIELD(tree_code) code : 16;
+
+  unsigned side_effects_flag : 1;
+  unsigned constant_flag : 1;
+  unsigned addressable_flag : 1;
+  unsigned volatile_flag : 1;
+  unsigned readonly_flag : 1;
+  unsigned asm_written_flag: 1;
+  unsigned nowarning_flag : 1;
+  unsigned visited : 1;
+
+  unsigned used_flag : 1;
+  unsigned nothrow_flag : 1;
+  unsigned static_flag : 1;
+  unsigned public_flag : 1;
+  unsigned private_flag : 1;
+  unsigned protected_flag : 1;
+  unsigned deprecated_flag : 1;
+  unsigned default_def_flag : 1;
+
+  union {
+    /* The bits in the following structure should only be used with
+       accessor macros that constrain inputs with tree checking.  */
+    struct {
+      unsigned lang_flag_0 : 1;
+      unsigned lang_flag_1 : 1;
+      unsigned lang_flag_2 : 1;
+      unsigned lang_flag_3 : 1;
+      unsigned lang_flag_4 : 1;
+      unsigned lang_flag_5 : 1;
+      unsigned lang_flag_6 : 1;
+      unsigned saturating_flag : 1;
+
+      unsigned unsigned_flag : 1;
+      unsigned packed_flag : 1;
+      unsigned user_align : 1;
+      unsigned nameless_flag : 1;
+      unsigned spare0 : 4;
+
+      unsigned spare1 : 8;
+
+      /* This field is only used with TREE_TYPE nodes; the only reason it is
+	 present in tree_base instead of tree_type is to save space.  The size
+	 of the field must be large enough to hold addr_space_t values.  */
+      unsigned address_space : 8;
+    } bits;
+    /* The following fields are present in tree_base to save space.  The
+       nodes using them do not require any of the flags above and so can
+       make better use of the 4-byte sized word.  */
+    /* VEC length.  This field is only used with TREE_VEC.  */
+    int length;
+    /* SSA version number.  This field is only used with SSA_NAME.  */
+    unsigned int version;
+  } GTY((skip(""))) u;
+};
+
+/* The following table lists the uses of each of the above flags and
+   for which types of nodes they are defined.
+
+   addressable_flag:
+
+       TREE_ADDRESSABLE in
+           VAR_DECL, PARM_DECL, RESULT_DECL, FUNCTION_DECL, LABEL_DECL
+           SSA_NAME
+           all types
+           CONSTRUCTOR, IDENTIFIER_NODE
+           STMT_EXPR
+
+       CALL_EXPR_TAILCALL in
+           CALL_EXPR
+
+       CASE_LOW_SEEN in
+           CASE_LABEL_EXPR
+
+       PREDICT_EXPR_OUTCOME in
+	   PREDICT_EXPR
+
+   static_flag:
+
+       TREE_STATIC in
+           VAR_DECL, FUNCTION_DECL
+           CONSTRUCTOR
+
+       TREE_NO_TRAMPOLINE in
+           ADDR_EXPR
+
+       BINFO_VIRTUAL_P in
+           TREE_BINFO
+
+       TREE_SYMBOL_REFERENCED in
+           IDENTIFIER_NODE
+
+       CLEANUP_EH_ONLY in
+           TARGET_EXPR, WITH_CLEANUP_EXPR
+
+       TRY_CATCH_IS_CLEANUP in
+           TRY_CATCH_EXPR
+
+       ASM_INPUT_P in
+           ASM_EXPR
+
+       TYPE_REF_CAN_ALIAS_ALL in
+           POINTER_TYPE, REFERENCE_TYPE
+
+       CASE_HIGH_SEEN in
+           CASE_LABEL_EXPR
+
+       ENUM_IS_SCOPED in
+	   ENUMERAL_TYPE
+
+       TRANSACTION_EXPR_OUTER in
+	   TRANSACTION_EXPR
+
+   public_flag:
+
+       TREE_OVERFLOW in
+           INTEGER_CST, REAL_CST, COMPLEX_CST, VECTOR_CST
+
+       TREE_PUBLIC in
+           VAR_DECL, FUNCTION_DECL
+           IDENTIFIER_NODE
+
+       ASM_VOLATILE_P in
+           ASM_EXPR
+
+       CALL_EXPR_VA_ARG_PACK in
+           CALL_EXPR
+
+       TYPE_CACHED_VALUES_P in
+           all types
+
+       SAVE_EXPR_RESOLVED_P in
+           SAVE_EXPR
+
+       OMP_CLAUSE_LASTPRIVATE_FIRSTPRIVATE in
+           OMP_CLAUSE_LASTPRIVATE
+
+       OMP_CLAUSE_PRIVATE_DEBUG in
+           OMP_CLAUSE_PRIVATE
+
+       TRANSACTION_EXPR_RELAXED in
+	   TRANSACTION_EXPR
+
+   private_flag:
+
+       TREE_PRIVATE in
+           all decls
+
+       CALL_EXPR_RETURN_SLOT_OPT in
+           CALL_EXPR
+
+       OMP_SECTION_LAST in
+           OMP_SECTION
+
+       OMP_PARALLEL_COMBINED in
+           OMP_PARALLEL
+
+       OMP_CLAUSE_PRIVATE_OUTER_REF in
+	   OMP_CLAUSE_PRIVATE
+
+       TYPE_REF_IS_RVALUE in
+	   REFERENCE_TYPE
+
+       ENUM_IS_OPAQUE in
+	   ENUMERAL_TYPE
+
+   protected_flag:
+
+       TREE_PROTECTED in
+           BLOCK
+           all decls
+
+       CALL_FROM_THUNK_P and
+       CALL_ALLOCA_FOR_VAR_P in
+           CALL_EXPR
+
+   side_effects_flag:
+
+       TREE_SIDE_EFFECTS in
+           all expressions
+           all decls
+           all constants
+
+       FORCED_LABEL in
+           LABEL_DECL
+
+   volatile_flag:
+
+       TREE_THIS_VOLATILE in
+           all expressions
+           all decls
+
+       TYPE_VOLATILE in
+           all types
+
+   readonly_flag:
+
+       TREE_READONLY in
+           all expressions
+           all decls
+
+       TYPE_READONLY in
+           all types
+
+   constant_flag:
+
+       TREE_CONSTANT in
+           all expressions
+           all decls
+           all constants
+
+       TYPE_SIZES_GIMPLIFIED in
+           all types
+
+   unsigned_flag:
+
+       TYPE_UNSIGNED in
+           all types
+
+       DECL_UNSIGNED in
+           all decls
+
+   asm_written_flag:
+
+       TREE_ASM_WRITTEN in
+           VAR_DECL, FUNCTION_DECL, TYPE_DECL
+           RECORD_TYPE, UNION_TYPE, QUAL_UNION_TYPE
+           BLOCK, STRING_CST
+
+       SSA_NAME_OCCURS_IN_ABNORMAL_PHI in
+           SSA_NAME
+
+   used_flag:
+
+       TREE_USED in
+           all expressions
+           all decls
+           IDENTIFIER_NODE
+
+   nothrow_flag:
+
+       TREE_NOTHROW in
+           CALL_EXPR
+           FUNCTION_DECL
+
+       TYPE_ALIGN_OK in
+           all types
+
+       TREE_THIS_NOTRAP in
+          INDIRECT_REF, MEM_REF, TARGET_MEM_REF, ARRAY_REF, ARRAY_RANGE_REF
+
+       SSA_NAME_IN_FREELIST in
+          SSA_NAME
+
+   deprecated_flag:
+
+       TREE_DEPRECATED in
+           all decls
+	   all types
+
+       IDENTIFIER_TRANSPARENT_ALIAS in
+           IDENTIFIER_NODE
+
+   visited:
+
+       TREE_VISITED in
+           all trees (used liberally by many passes)
+
+   saturating_flag:
+
+       TYPE_SATURATING in
+           all types
+
+       VAR_DECL_IS_VIRTUAL_OPERAND in
+	   VAR_DECL
+
+   nowarning_flag:
+
+       TREE_NO_WARNING in
+           all expressions
+           all decls
+
+       TYPE_ARTIFICIAL in
+           all types
+
+   default_def_flag:
+
+       TYPE_VECTOR_OPAQUE in
+	   VECTOR_TYPE
+
+       SSA_NAME_IS_DEFAULT_DEF in
+           SSA_NAME
+
+       DECL_NONLOCAL_FRAME in
+	   VAR_DECL
+*/
+
+struct GTY(()) tree_typed {
+  struct tree_base base;
+  tree type;
+};
+
+struct GTY(()) tree_common {
+  struct tree_typed typed;
+  tree chain;
+};
+
+struct GTY(()) tree_int_cst {
+  struct tree_typed typed;
+  double_int int_cst;
+};
+
+
+struct GTY(()) tree_real_cst {
+  struct tree_typed typed;
+  struct real_value * real_cst_ptr;
+};
+
+struct GTY(()) tree_fixed_cst {
+  struct tree_typed typed;
+  struct fixed_value * fixed_cst_ptr;
+};
+
+struct GTY(()) tree_string {
+  struct tree_typed typed;
+  int length;
+  char str[1];
+};
+
+struct GTY(()) tree_complex {
+  struct tree_typed typed;
+  tree real;
+  tree imag;
+};
+
+struct GTY(()) tree_vector {
+  struct tree_typed typed;
+  tree GTY ((length ("TYPE_VECTOR_SUBPARTS (TREE_TYPE ((tree)&%h))"))) elts[1];
+};
+
+struct GTY(()) tree_identifier {
+  struct tree_common common;
+  struct ht_identifier id;
+};
+
+struct GTY(()) tree_list {
+  struct tree_common common;
+  tree purpose;
+  tree value;
+};
+
+struct GTY(()) tree_vec {
+  struct tree_common common;
+  tree GTY ((length ("TREE_VEC_LENGTH ((tree)&%h)"))) a[1];
+};
+
+/* A single element of a CONSTRUCTOR. VALUE holds the actual value of the
+   element. INDEX can optionally design the position of VALUE: in arrays,
+   it is the index where VALUE has to be placed; in structures, it is the
+   FIELD_DECL of the member.  */
+typedef struct GTY(()) constructor_elt_d {
+  tree index;
+  tree value;
+} constructor_elt;
+
+struct GTY(()) tree_constructor {
+  struct tree_typed typed;
+  vec<constructor_elt, va_gc> *elts;
+};
+
+struct GTY(()) tree_exp {
+  struct tree_typed typed;
+  location_t locus;
+  tree GTY ((special ("tree_exp"),
+	     desc ("TREE_CODE ((tree) &%0)")))
+    operands[1];
+};
+
+/* Immediate use linking structure.  This structure is used for maintaining
+   a doubly linked list of uses of an SSA_NAME.  */
+typedef struct GTY(()) ssa_use_operand_d {
+  struct ssa_use_operand_d* GTY((skip(""))) prev;
+  struct ssa_use_operand_d* GTY((skip(""))) next;
+  /* Immediate uses for a given SSA name are maintained as a cyclic
+     list.  To recognize the root of this list, the location field
+     needs to point to the original SSA name.  Since statements and
+     SSA names are of different data types, we need this union.  See
+     the explanation in struct immediate_use_iterator_d.  */
+  union { gimple stmt; tree ssa_name; } GTY((skip(""))) loc;
+  tree *GTY((skip(""))) use;
+} ssa_use_operand_t;
+
+struct GTY(()) tree_ssa_name {
+  struct tree_typed typed;
+
+  /* _DECL wrapped by this SSA name.  */
+  tree var;
+
+  /* Statement that defines this SSA name.  */
+  gimple def_stmt;
+
+  /* Pointer attributes used for alias analysis.  */
+  struct ptr_info_def *ptr_info;
+
+  /* Immediate uses list for this SSA_NAME.  */
+  struct ssa_use_operand_d imm_uses;
+};
+
+struct GTY(()) phi_arg_d {
+  /* imm_use MUST be the first element in struct because we do some
+     pointer arithmetic with it.  See phi_arg_index_from_use.  */
+  struct ssa_use_operand_d imm_use;
+  tree def;
+  location_t locus;
+};
+
+struct GTY(()) tree_omp_clause {
+  struct tree_common common;
+  location_t locus;
+  enum omp_clause_code code;
+  union omp_clause_subcode {
+    enum omp_clause_default_kind  default_kind;
+    enum omp_clause_schedule_kind schedule_kind;
+    enum tree_code                reduction_code;
+  } GTY ((skip)) subcode;
+
+  /* The gimplification of OMP_CLAUSE_REDUCTION_{INIT,MERGE} for omp-low's
+     usage.  */
+  gimple_seq gimple_reduction_init;
+  gimple_seq gimple_reduction_merge;
+
+  tree GTY ((length ("omp_clause_num_ops[OMP_CLAUSE_CODE ((tree)&%h)]")))
+    ops[1];
+};
+
+struct GTY(()) tree_block {
+  struct tree_base base;
+  tree chain;
+
+  unsigned abstract_flag : 1;
+  unsigned block_num : 31;
+
+  location_t locus;
+
+  tree vars;
+  vec<tree, va_gc> *nonlocalized_vars;
+
+  tree subblocks;
+  tree supercontext;
+  tree abstract_origin;
+  tree fragment_origin;
+  tree fragment_chain;
+};
+
+struct GTY(()) tree_type_common {
+  struct tree_common common;
+  tree size;
+  tree size_unit;
+  tree attributes;
+  unsigned int uid;
+
+  unsigned int precision : 10;
+  unsigned no_force_blk_flag : 1;
+  unsigned needs_constructing_flag : 1;
+  unsigned transparent_aggr_flag : 1;
+  unsigned restrict_flag : 1;
+  unsigned contains_placeholder_bits : 2;
+
+  ENUM_BITFIELD(machine_mode) mode : 8;
+
+  unsigned string_flag : 1;
+  unsigned lang_flag_0 : 1;
+  unsigned lang_flag_1 : 1;
+  unsigned lang_flag_2 : 1;
+  unsigned lang_flag_3 : 1;
+  unsigned lang_flag_4 : 1;
+  unsigned lang_flag_5 : 1;
+  unsigned lang_flag_6 : 1;
+
+  unsigned int align;
+  alias_set_type alias_set;
+  tree pointer_to;
+  tree reference_to;
+  union tree_type_symtab {
+    int GTY ((tag ("TYPE_SYMTAB_IS_ADDRESS"))) address;
+    const char * GTY ((tag ("TYPE_SYMTAB_IS_POINTER"))) pointer;
+    struct die_struct * GTY ((tag ("TYPE_SYMTAB_IS_DIE"))) die;
+  } GTY ((desc ("debug_hooks->tree_type_symtab_field"))) symtab;
+  tree name;
+  tree next_variant;
+  tree main_variant;
+  tree context;
+  tree canonical;
+};
+
+struct GTY(()) tree_type_with_lang_specific {
+  struct tree_type_common common;
+  /* Points to a structure whose details depend on the language in use.  */
+  struct lang_type *lang_specific;
+};
+
+struct GTY(()) tree_type_non_common {
+  struct tree_type_with_lang_specific with_lang_specific;
+  tree values;
+  tree minval;
+  tree maxval;
+  tree binfo;
+};
+
+struct GTY (()) tree_binfo {
+  struct tree_common common;
+
+  tree offset;
+  tree vtable;
+  tree virtuals;
+  tree vptr_field;
+  vec<tree, va_gc> *base_accesses;
+  tree inheritance;
+
+  tree vtt_subvtt;
+  tree vtt_vptr;
+
+  vec<tree, va_gc> base_binfos;
+};
+
+struct GTY(()) tree_decl_minimal {
+  struct tree_common common;
+  location_t locus;
+  unsigned int uid;
+  tree name;
+  tree context;
+};
+
+struct GTY(()) tree_decl_common {
+  struct tree_decl_minimal common;
+  tree size;
+
+  ENUM_BITFIELD(machine_mode) mode : 8;
+
+  unsigned nonlocal_flag : 1;
+  unsigned virtual_flag : 1;
+  unsigned ignored_flag : 1;
+  unsigned abstract_flag : 1;
+  unsigned artificial_flag : 1;
+  unsigned preserve_flag: 1;
+  unsigned debug_expr_is_from : 1;
+
+  unsigned lang_flag_0 : 1;
+  unsigned lang_flag_1 : 1;
+  unsigned lang_flag_2 : 1;
+  unsigned lang_flag_3 : 1;
+  unsigned lang_flag_4 : 1;
+  unsigned lang_flag_5 : 1;
+  unsigned lang_flag_6 : 1;
+  unsigned lang_flag_7 : 1;
+  unsigned lang_flag_8 : 1;
+
+  /* In LABEL_DECL, this is DECL_ERROR_ISSUED.
+     In VAR_DECL and PARM_DECL, this is DECL_REGISTER.  */
+  unsigned decl_flag_0 : 1;
+  /* In FIELD_DECL, this is DECL_BIT_FIELD
+     In VAR_DECL and FUNCTION_DECL, this is DECL_EXTERNAL.
+     In TYPE_DECL, this is TYPE_DECL_SUPPRESS_DEBUG.  */
+  unsigned decl_flag_1 : 1;
+  /* In FIELD_DECL, this is DECL_NONADDRESSABLE_P
+     In VAR_DECL, PARM_DECL and RESULT_DECL, this is
+     DECL_HAS_VALUE_EXPR_P.  */
+  unsigned decl_flag_2 : 1;
+  /* 1 bit unused.  */
+  unsigned decl_flag_3 : 1;
+  /* Logically, these two would go in a theoretical base shared by var and
+     parm decl. */
+  unsigned gimple_reg_flag : 1;
+  /* In VAR_DECL, PARM_DECL and RESULT_DECL, this is DECL_BY_REFERENCE.  */
+  unsigned decl_by_reference_flag : 1;
+  /* In a VAR_DECL and PARM_DECL, this is DECL_READ_P.  */
+  unsigned decl_read_flag : 1;
+  /* In a VAR_DECL or RESULT_DECL, this is DECL_NONSHAREABLE.  */
+  unsigned decl_nonshareable_flag : 1;
+
+  /* DECL_OFFSET_ALIGN, used only for FIELD_DECLs.  */
+  unsigned int off_align : 8;
+
+  /* 24 bits unused.  */
+
+  /* DECL_ALIGN.  It should have the same size as TYPE_ALIGN.  */
+  unsigned int align;
+
+  /* UID for points-to sets, stable over copying from inlining.  */
+  unsigned int pt_uid;
+
+  tree size_unit;
+  tree initial;
+  tree attributes;
+  tree abstract_origin;
+
+  /* Points to a structure whose details depend on the language in use.  */
+  struct lang_decl *lang_specific;
+};
+
+struct GTY(()) tree_decl_with_rtl {
+  struct tree_decl_common common;
+  rtx rtl;
+};
+
+struct GTY(()) tree_field_decl {
+  struct tree_decl_common common;
+
+  tree offset;
+  tree bit_field_type;
+  tree qualifier;
+  tree bit_offset;
+  tree fcontext;
+};
+
+struct GTY(()) tree_label_decl {
+  struct tree_decl_with_rtl common;
+  int label_decl_uid;
+  int eh_landing_pad_nr;
+};
+
+struct GTY(()) tree_result_decl {
+  struct tree_decl_with_rtl common;
+};
+
+struct GTY(()) tree_const_decl {
+  struct tree_decl_common common;
+};
+
+struct GTY(()) tree_parm_decl {
+  struct tree_decl_with_rtl common;
+  rtx incoming_rtl;
+};
+
+struct GTY(()) tree_decl_with_vis {
+ struct tree_decl_with_rtl common;
+ tree assembler_name;
+ tree section_name;
+ tree comdat_group;
+
+ /* Belong to VAR_DECL exclusively.  */
+ unsigned defer_output : 1;
+ unsigned hard_register : 1;
+ unsigned common_flag : 1;
+ unsigned in_text_section : 1;
+ unsigned in_constant_pool : 1;
+ unsigned dllimport_flag : 1;
+ /* Don't belong to VAR_DECL exclusively.  */
+ unsigned weak_flag : 1;
+ /* When SECTION_NAME is implied by -ffunction-section.  */
+ unsigned implicit_section_name_p : 1;
+
+ unsigned seen_in_bind_expr : 1;
+ unsigned comdat_flag : 1;
+ ENUM_BITFIELD(symbol_visibility) visibility : 2;
+ unsigned visibility_specified : 1;
+ /* Belongs to VAR_DECL exclusively.  */
+ ENUM_BITFIELD(tls_model) tls_model : 3;
+
+ /* Belong to FUNCTION_DECL exclusively.  */
+ unsigned init_priority_p : 1;
+ /* Used by C++ only.  Might become a generic decl flag.  */
+ unsigned shadowed_for_var_p : 1;
+ /* Belong to FUNCTION_DECL exclusively.  */
+ unsigned cxx_constructor : 1;
+ /* Belong to FUNCTION_DECL exclusively.  */
+ unsigned cxx_destructor : 1;
+ /* Belong to FUNCTION_DECL exclusively.  */
+ unsigned final : 1;
+ /* 11 unused bits. */
+};
+
+struct GTY(()) tree_var_decl {
+  struct tree_decl_with_vis common;
+};
+
+struct GTY(()) tree_decl_non_common {
+  struct tree_decl_with_vis common;
+  /* C++ uses this in namespaces.  */
+  tree saved_tree;
+  /* C++ uses this in templates.  */
+  tree arguments;
+  /* Almost all FE's use this.  */
+  tree result;
+  /* C++ uses this in namespaces and function_decls.  */
+  tree vindex;
+};
+
+struct GTY(()) tree_function_decl {
+  struct tree_decl_non_common common;
+
+  struct function *f;
+
+  /* The personality function. Used for stack unwinding. */
+  tree personality;
+
+  /* Function specific options that are used by this function.  */
+  tree function_specific_target;	/* target options */
+  tree function_specific_optimization;	/* optimization options */
+
+  /* In a FUNCTION_DECL for which DECL_BUILT_IN holds, this is
+     DECL_FUNCTION_CODE.  Otherwise unused.
+     ???  The bitfield needs to be able to hold all target function
+	  codes as well.  */
+  ENUM_BITFIELD(built_in_function) function_code : 11;
+  ENUM_BITFIELD(built_in_class) built_in_class : 2;
+
+  unsigned static_ctor_flag : 1;
+  unsigned static_dtor_flag : 1;
+  unsigned uninlinable : 1;
+
+  unsigned possibly_inlined : 1;
+  unsigned novops_flag : 1;
+  unsigned returns_twice_flag : 1;
+  unsigned malloc_flag : 1;
+  unsigned operator_new_flag : 1;
+  unsigned declared_inline_flag : 1;
+  unsigned regdecl_flag : 1;
+  unsigned no_inline_warning_flag : 1;
+
+  unsigned no_instrument_function_entry_exit : 1;
+  unsigned no_limit_stack : 1;
+  unsigned disregard_inline_limits : 1;
+  unsigned pure_flag : 1;
+  unsigned looping_const_or_pure_flag : 1;
+  unsigned has_debug_args_flag : 1;
+  unsigned tm_clone_flag : 1;
+  unsigned versioned_function : 1;
+  /* No bits left.  */
+};
+
+struct GTY(()) tree_translation_unit_decl {
+  struct tree_decl_common common;
+  /* Source language of this translation unit.  Used for DWARF output.  */
+  const char * GTY((skip(""))) language;
+  /* TODO: Non-optimization used to build this translation unit.  */
+  /* TODO: Root of a partial DWARF tree for global types and decls.  */
+};
+
+struct GTY(()) tree_type_decl {
+  struct tree_decl_non_common common;
+
+};
+
+struct GTY ((chain_next ("%h.next"), chain_prev ("%h.prev"))) tree_statement_list_node
+ {
+  struct tree_statement_list_node *prev;
+  struct tree_statement_list_node *next;
+  tree stmt;
+};
+
+struct GTY(()) tree_statement_list
+ {
+  struct tree_typed typed;
+  struct tree_statement_list_node *head;
+  struct tree_statement_list_node *tail;
+};
+
+struct GTY(()) tree_optimization_option {
+  struct tree_common common;
+
+  /* The optimization options used by the user.  */
+  struct cl_optimization opts;
+
+  /* Target optabs for this set of optimization options.  This is of
+     type `struct target_optabs *'.  */
+  unsigned char *GTY ((atomic)) optabs;
+
+  /* The value of this_target_optabs against which the optabs above were
+     generated.  */
+  struct target_optabs *GTY ((skip)) base_optabs;
+};
+
+struct GTY(()) tree_target_option {
+  struct tree_common common;
+
+  /* The optimization options used by the user.  */
+  struct cl_target_option opts;
+};
+
+/* Define the overall contents of a tree node.
+   It may be any of the structures declared above
+   for various types of node.  */
+union GTY ((ptr_alias (union lang_tree_node),
+	    desc ("tree_node_structure (&%h)"), variable_size)) tree_node {
+  struct tree_base GTY ((tag ("TS_BASE"))) base;
+  struct tree_typed GTY ((tag ("TS_TYPED"))) typed;
+  struct tree_common GTY ((tag ("TS_COMMON"))) common;
+  struct tree_int_cst GTY ((tag ("TS_INT_CST"))) int_cst;
+  struct tree_real_cst GTY ((tag ("TS_REAL_CST"))) real_cst;
+  struct tree_fixed_cst GTY ((tag ("TS_FIXED_CST"))) fixed_cst;
+  struct tree_vector GTY ((tag ("TS_VECTOR"))) vector;
+  struct tree_string GTY ((tag ("TS_STRING"))) string;
+  struct tree_complex GTY ((tag ("TS_COMPLEX"))) complex;
+  struct tree_identifier GTY ((tag ("TS_IDENTIFIER"))) identifier;
+  struct tree_decl_minimal GTY((tag ("TS_DECL_MINIMAL"))) decl_minimal;
+  struct tree_decl_common GTY ((tag ("TS_DECL_COMMON"))) decl_common;
+  struct tree_decl_with_rtl GTY ((tag ("TS_DECL_WRTL"))) decl_with_rtl;
+  struct tree_decl_non_common  GTY ((tag ("TS_DECL_NON_COMMON")))
+    decl_non_common;
+  struct tree_parm_decl  GTY  ((tag ("TS_PARM_DECL"))) parm_decl;
+  struct tree_decl_with_vis GTY ((tag ("TS_DECL_WITH_VIS"))) decl_with_vis;
+  struct tree_var_decl GTY ((tag ("TS_VAR_DECL"))) var_decl;
+  struct tree_field_decl GTY ((tag ("TS_FIELD_DECL"))) field_decl;
+  struct tree_label_decl GTY ((tag ("TS_LABEL_DECL"))) label_decl;
+  struct tree_result_decl GTY ((tag ("TS_RESULT_DECL"))) result_decl;
+  struct tree_const_decl GTY ((tag ("TS_CONST_DECL"))) const_decl;
+  struct tree_type_decl GTY ((tag ("TS_TYPE_DECL"))) type_decl;
+  struct tree_function_decl GTY ((tag ("TS_FUNCTION_DECL"))) function_decl;
+  struct tree_translation_unit_decl GTY ((tag ("TS_TRANSLATION_UNIT_DECL")))
+    translation_unit_decl;
+  struct tree_type_common GTY ((tag ("TS_TYPE_COMMON"))) type_common;
+  struct tree_type_with_lang_specific GTY ((tag ("TS_TYPE_WITH_LANG_SPECIFIC")))
+    type_with_lang_specific;
+  struct tree_type_non_common GTY ((tag ("TS_TYPE_NON_COMMON")))
+    type_non_common;
+  struct tree_list GTY ((tag ("TS_LIST"))) list;
+  struct tree_vec GTY ((tag ("TS_VEC"))) vec;
+  struct tree_exp GTY ((tag ("TS_EXP"))) exp;
+  struct tree_ssa_name GTY ((tag ("TS_SSA_NAME"))) ssa_name;
+  struct tree_block GTY ((tag ("TS_BLOCK"))) block;
+  struct tree_binfo GTY ((tag ("TS_BINFO"))) binfo;
+  struct tree_statement_list GTY ((tag ("TS_STATEMENT_LIST"))) stmt_list;
+  struct tree_constructor GTY ((tag ("TS_CONSTRUCTOR"))) constructor;
+  struct tree_omp_clause GTY ((tag ("TS_OMP_CLAUSE"))) omp_clause;
+  struct tree_optimization_option GTY ((tag ("TS_OPTIMIZATION"))) optimization;
+  struct tree_target_option GTY ((tag ("TS_TARGET_OPTION"))) target_option;
+};
+
+/* Structure describing an attribute and a function to handle it.  */
+struct attribute_spec {
+  /* The name of the attribute (without any leading or trailing __),
+     or NULL to mark the end of a table of attributes.  */
+  const char *name;
+  /* The minimum length of the list of arguments of the attribute.  */
+  int min_length;
+  /* The maximum length of the list of arguments of the attribute
+     (-1 for no maximum).  */
+  int max_length;
+  /* Whether this attribute requires a DECL.  If it does, it will be passed
+     from types of DECLs, function return types and array element types to
+     the DECLs, function types and array types respectively; but when
+     applied to a type in any other circumstances, it will be ignored with
+     a warning.  (If greater control is desired for a given attribute,
+     this should be false, and the flags argument to the handler may be
+     used to gain greater control in that case.)  */
+  bool decl_required;
+  /* Whether this attribute requires a type.  If it does, it will be passed
+     from a DECL to the type of that DECL.  */
+  bool type_required;
+  /* Whether this attribute requires a function (or method) type.  If it does,
+     it will be passed from a function pointer type to the target type,
+     and from a function return type (which is not itself a function
+     pointer type) to the function type.  */
+  bool function_type_required;
+  /* Function to handle this attribute.  NODE points to the node to which
+     the attribute is to be applied.  If a DECL, it should be modified in
+     place; if a TYPE, a copy should be created.  NAME is the name of the
+     attribute (possibly with leading or trailing __).  ARGS is the TREE_LIST
+     of the arguments (which may be NULL).  FLAGS gives further information
+     about the context of the attribute.  Afterwards, the attributes will
+     be added to the DECL_ATTRIBUTES or TYPE_ATTRIBUTES, as appropriate,
+     unless *NO_ADD_ATTRS is set to true (which should be done on error,
+     as well as in any other cases when the attributes should not be added
+     to the DECL or TYPE).  Depending on FLAGS, any attributes to be
+     applied to another type or DECL later may be returned;
+     otherwise the return value should be NULL_TREE.  This pointer may be
+     NULL if no special handling is required beyond the checks implied
+     by the rest of this structure.  */
+  tree (*handler) (tree *node, tree name, tree args,
+		   int flags, bool *no_add_attrs);
+  /* Specifies if attribute affects type's identity.  */
+  bool affects_type_identity;
+};
+
+/* These functions allow a front-end to perform a manual layout of a
+   RECORD_TYPE.  (For instance, if the placement of subsequent fields
+   depends on the placement of fields so far.)  Begin by calling
+   start_record_layout.  Then, call place_field for each of the
+   fields.  Then, call finish_record_layout.  See layout_type for the
+   default way in which these functions are used.  */
+typedef struct record_layout_info_s {
+  /* The RECORD_TYPE that we are laying out.  */
+  tree t;
+  /* The offset into the record so far, in bytes, not including bits in
+     BITPOS.  */
+  tree offset;
+  /* The last known alignment of SIZE.  */
+  unsigned int offset_align;
+  /* The bit position within the last OFFSET_ALIGN bits, in bits.  */
+  tree bitpos;
+  /* The alignment of the record so far, in bits.  */
+  unsigned int record_align;
+  /* The alignment of the record so far, ignoring #pragma pack and
+     __attribute__ ((packed)), in bits.  */
+  unsigned int unpacked_align;
+  /* The previous field laid out.  */
+  tree prev_field;
+  /* The static variables (i.e., class variables, as opposed to
+     instance variables) encountered in T.  */
+  vec<tree, va_gc> *pending_statics;
+  /* Bits remaining in the current alignment group */
+  int remaining_in_alignment;
+  /* True if we've seen a packed field that didn't have normal
+     alignment anyway.  */
+  int packed_maybe_necessary;
+} *record_layout_info;
+
+/* Iterator for going through the function arguments.  */
+struct function_args_iterator {
+  tree next;			/* TREE_LIST pointing to the next argument */
+};
+
+/* Structures to map from a tree to another tree.  */
+struct GTY(()) tree_map_base {
+  tree from;
+};
+
+struct GTY(()) tree_map {
+  struct tree_map_base base;
+  unsigned int hash;
+  tree to;
+};
+
+/* Map from a decl tree to another tree.  */
+struct GTY(()) tree_decl_map {
+  struct tree_map_base base;
+  tree to;
+};
+
+/* Map from a tree to an int.  */
+struct GTY(()) tree_int_map {
+  struct tree_map_base base;
+  unsigned int to;
+};
+
+/* Map from a tree to initialization/finalization priorities.  */
+struct GTY(()) tree_priority_map {
+  struct tree_map_base base;
+  priority_type init;
+  priority_type fini;
+};
+
+/* Map from a decl tree to a tree vector.  */
+struct GTY(()) tree_vec_map {
+  struct tree_map_base base;
+  vec<tree, va_gc> *to;
+};
+
+/* Abstract iterators for CALL_EXPRs.  These static inline definitions
+   have to go towards the end of tree.h so that union tree_node is fully
+   defined by this point.  */
+
+/* Structure containing iterator state.  */
+struct call_expr_arg_iterator {
+  tree t;	/* the call_expr */
+  int n;	/* argument count */
+  int i;	/* next argument index */
+};
+
+struct const_call_expr_arg_iterator {
+  const_tree t;	/* the call_expr */
+  int n;	/* argument count */
+  int i;	/* next argument index */
+};
+
+/* The builtin_info structure holds the FUNCTION_DECL of the standard builtin
+   function, and a flag that says if the function is available implicitly, or
+   whether the user has to code explicit calls to __builtin_<xxx>.  */
+struct GTY(()) builtin_info_type {
+  tree decl[(int)END_BUILTINS];
+  bool implicit_p[(int)END_BUILTINS];
+};
+
+
+/*---------------------------------------------------------------------------
+                                Global variables
+---------------------------------------------------------------------------*/
+/* Matrix describing the structures contained in a given tree code.  */
+extern unsigned char tree_contains_struct[MAX_TREE_CODES][64];
+
+/* Class of tree given its code.  */
+extern const enum tree_code_class tree_code_type[];
+
+/* Each tree code class has an associated string representation.
+   These must correspond to the tree_code_class entries.  */
+extern const char *const tree_code_class_strings[];
+
+/* Number of argument-words in each kind of tree-node.  */
+extern const unsigned char tree_code_length[];
+
+/* Names of tree components.  */
+extern const char *const tree_code_name[];
+
+/* Vector of all alias pairs for global symbols.  */
+extern GTY(()) vec<alias_pair, va_gc> *alias_pairs;
+
+/* Names of all the built_in classes.  */
+extern const char *const built_in_class_names[BUILT_IN_LAST];
+
+/* Names of all the built_in functions.  */
+extern const char * built_in_names[(int) END_BUILTINS];
+
+/* Number of operands and names for each OMP_CLAUSE node.  */
+extern unsigned const char omp_clause_num_ops[];
+extern const char * const omp_clause_code_name[];
+
+/* A vector of all translation-units.  */
+extern GTY (()) vec<tree, va_gc> *all_translation_units;
+
+/* Vector of standard trees used by the C compiler.  */
+extern GTY(()) tree global_trees[TI_MAX];
+
+/* The standard C integer types.  Use integer_type_kind to index into
+   this array.  */
+extern GTY(()) tree integer_types[itk_none];
+
+/* Types used to represent sizes.  */
+extern GTY(()) tree sizetype_tab[(int) stk_type_kind_last];
+
+/* Arrays for keeping track of tree node statistics.  */
+extern int tree_node_counts[];
+extern int tree_node_sizes[];
+
+/* True if we are in gimple form and the actions of the folders need to
+   be restricted.  False if we are not in gimple form and folding is not
+   restricted to creating gimple expressions.  */
+extern bool in_gimple_form;
+
+/* Functional interface to the builtin functions.  */
+extern GTY(()) builtin_info_type builtin_info;
+
+/* If nonzero, an upper limit on alignment of structure fields, in bits,  */
+extern unsigned int maximum_field_alignment;
+
+/* Nonzero means lvalues are limited to those valid in pedantic ANSI C.
+   Zero means allow extended lvalues.  */
+extern int pedantic_lvalues;
+
+/* Points to the FUNCTION_DECL of the function whose body we are reading.  */
+extern GTY(()) tree current_function_decl;
+
+/* Nonzero means a FUNC_BEGIN label was emitted.  */
+extern GTY(()) const char * current_function_func_begin_label;
+
+#endif  // GCC_TREE_CORE_H
diff --git a/gcc/tree.h b/gcc/tree.h
index 83edaba..718d8f4 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -20,32 +20,7 @@ along with GCC; see the file COPYING3.  If not see
 #ifndef GCC_TREE_H
 #define GCC_TREE_H
 
-#include "hashtab.h"
-#include "machmode.h"
-#include "input.h"
-#include "statistics.h"
-#include "vec.h"
-#include "double-int.h"
-#include "real.h"
-#include "fixed-value.h"
-#include "alias.h"
-#include "flags.h"
-
-/* Codes of tree nodes */
-
-#define DEFTREECODE(SYM, STRING, TYPE, NARGS)   SYM,
-#define END_OF_BASE_TREE_CODES LAST_AND_UNUSED_TREE_CODE,
-
-enum tree_code {
-#include "all-tree.def"
-MAX_TREE_CODES
-};
-
-#undef DEFTREECODE
-#undef END_OF_BASE_TREE_CODES
-
-extern unsigned char tree_contains_struct[MAX_TREE_CODES][64];
-#define CODE_CONTAINS_STRUCT(CODE, STRUCT) (tree_contains_struct[(CODE)][(STRUCT)])
+#include "tree-core.h"
 
 /* Macros for initializing `tree_contains_struct'.  */
 #define MARK_TS_BASE(C)					\
@@ -107,42 +82,12 @@ extern unsigned char tree_contains_struct[MAX_TREE_CODES][64];
     tree_contains_struct[C][TS_DECL_NON_COMMON] = 1;	\
   } while (0)
 
-/* Number of language-independent tree codes.  */
-#define NUM_TREE_CODES ((int) LAST_AND_UNUSED_TREE_CODE)
-
-/* Tree code classes.  */
-
-/* Each tree_code has an associated code class represented by a
-   TREE_CODE_CLASS.  */
-
-enum tree_code_class {
-  tcc_exceptional, /* An exceptional code (fits no category).  */
-  tcc_constant,    /* A constant.  */
-  /* Order of tcc_type and tcc_declaration is important.  */
-  tcc_type,        /* A type object code.  */
-  tcc_declaration, /* A declaration (also serving as variable refs).  */
-  tcc_reference,   /* A reference to storage.  */
-  tcc_comparison,  /* A comparison expression.  */
-  tcc_unary,       /* A unary arithmetic expression.  */
-  tcc_binary,      /* A binary arithmetic expression.  */
-  tcc_statement,   /* A statement expression, which have side effects
-		      but usually no interesting value.  */
-  tcc_vl_exp,      /* A function call or other expression with a
-		      variable-length operand vector.  */
-  tcc_expression   /* Any other expression.  */
-};
-
-/* Each tree code class has an associated string representation.
-   These must correspond to the tree_code_class entries.  */
-
-extern const char *const tree_code_class_strings[];
 
 /* Returns the string representing CLASS.  */
 
 #define TREE_CODE_CLASS_STRING(CLASS)\
         tree_code_class_strings[(int) (CLASS)]
 
-extern const enum tree_code_class tree_code_type[];
 #define TREE_CODE_CLASS(CODE)	tree_code_type[(int) (CODE)]
 
 /* Nonzero if CODE represents an exceptional code.  */
@@ -231,76 +176,8 @@ extern const enum tree_code_class tree_code_type[];
 
 #define EXPR_P(NODE) IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (TREE_CODE (NODE)))
 
-/* Number of argument-words in each kind of tree-node.  */
-
-extern const unsigned char tree_code_length[];
 #define TREE_CODE_LENGTH(CODE)	tree_code_length[(int) (CODE)]
 
-/* Names of tree components.  */
-
-extern const char *const tree_code_name[];
-
-/* When procesing aliases on symtab level, we need the declaration of target.
-   For this reason we need to queue aliases and process them after all declarations
-   has been produced.  */
-
-typedef struct GTY(()) alias_pair
-{
-  tree decl;
-  tree target;  
-} alias_pair;
-
-/* Define gc'd vector type.  */
-
-extern GTY(()) vec<alias_pair, va_gc> *alias_pairs;
-
-\f
-/* Classify which part of the compiler has defined a given builtin function.
-   Note that we assume below that this is no more than two bits.  */
-enum built_in_class
-{
-  NOT_BUILT_IN = 0,
-  BUILT_IN_FRONTEND,
-  BUILT_IN_MD,
-  BUILT_IN_NORMAL
-};
-
-/* Last marker used for LTO stremaing of built_in_class.  We can not add it
-   to the enum since we need the enumb to fit in 2 bits.  */
-#define BUILT_IN_LAST (BUILT_IN_NORMAL + 1)
-
-/* Names for the above.  */
-extern const char *const built_in_class_names[4];
-
-/* Codes that identify the various built in functions
-   so that expand_call can identify them quickly.  */
-
-#define DEF_BUILTIN(ENUM, N, C, T, LT, B, F, NA, AT, IM, COND) ENUM,
-enum built_in_function
-{
-#include "builtins.def"
-
-  /* Complex division routines in libgcc.  These are done via builtins
-     because emit_library_call_value can't handle complex values.  */
-  BUILT_IN_COMPLEX_MUL_MIN,
-  BUILT_IN_COMPLEX_MUL_MAX
-    = BUILT_IN_COMPLEX_MUL_MIN
-      + MAX_MODE_COMPLEX_FLOAT
-      - MIN_MODE_COMPLEX_FLOAT,
-
-  BUILT_IN_COMPLEX_DIV_MIN,
-  BUILT_IN_COMPLEX_DIV_MAX
-    = BUILT_IN_COMPLEX_DIV_MIN
-      + MAX_MODE_COMPLEX_FLOAT
-      - MIN_MODE_COMPLEX_FLOAT,
-
-  /* Upper bound on non-language-specific builtins.  */
-  END_BUILTINS
-};
-#undef DEF_BUILTIN
-
-/* Names for the above.  */
-extern const char * built_in_names[(int) END_BUILTINS];
 
 /* Helper macros for math builtins.  */
 
@@ -323,438 +200,6 @@ extern const char * built_in_names[(int) END_BUILTINS];
 #define CASE_FLT_FN(FN) case FN: case FN##F: case FN##L
 #define CASE_FLT_FN_REENT(FN) case FN##_R: case FN##F_R: case FN##L_R
 #define CASE_INT_FN(FN) case FN: case FN##L: case FN##LL: case FN##IMAX
-\f
-/* In an OMP_CLAUSE node.  */
-
-/* Number of operands and names for each clause.  */
-extern unsigned const char omp_clause_num_ops[];
-extern const char * const omp_clause_code_name[];
-
-/* Clause codes.  Do not reorder, as this is used to index into the tables
-   omp_clause_num_ops and omp_clause_code_name.  */
-enum omp_clause_code
-{
-  /* Clause zero is special-cased inside the parser
-     (c_parser_omp_variable_list).  */
-  OMP_CLAUSE_ERROR = 0,
-
-  /* OpenMP clause: private (variable_list).  */
-  OMP_CLAUSE_PRIVATE,
-
-  /* OpenMP clause: shared (variable_list).  */
-  OMP_CLAUSE_SHARED,
-
-  /* OpenMP clause: firstprivate (variable_list).  */
-  OMP_CLAUSE_FIRSTPRIVATE,
-
-  /* OpenMP clause: lastprivate (variable_list).  */
-  OMP_CLAUSE_LASTPRIVATE,
-
-  /* OpenMP clause: reduction (operator:variable_list).
-     OMP_CLAUSE_REDUCTION_CODE: The tree_code of the operator.
-     Operand 1: OMP_CLAUSE_REDUCTION_INIT: Stmt-list to initialize the var.
-     Operand 2: OMP_CLAUSE_REDUCTION_MERGE: Stmt-list to merge private var
-                into the shared one.
-     Operand 3: OMP_CLAUSE_REDUCTION_PLACEHOLDER: A dummy VAR_DECL
-                placeholder used in OMP_CLAUSE_REDUCTION_{INIT,MERGE}.  */
-  OMP_CLAUSE_REDUCTION,
-
-  /* OpenMP clause: copyin (variable_list).  */
-  OMP_CLAUSE_COPYIN,
-
-  /* OpenMP clause: copyprivate (variable_list).  */
-  OMP_CLAUSE_COPYPRIVATE,
-
-  /* OpenMP clause: linear (variable-list[:linear-step]).  */
-  OMP_CLAUSE_LINEAR,
-
-  /* OpenMP clause: uniform (argument-list).  */
-  OMP_CLAUSE_UNIFORM,
-
-  /* OpenMP clause: if (scalar-expression).  */
-  OMP_CLAUSE_IF,
-
-  /* OpenMP clause: num_threads (integer-expression).  */
-  OMP_CLAUSE_NUM_THREADS,
-
-  /* OpenMP clause: schedule.  */
-  OMP_CLAUSE_SCHEDULE,
-
-  /* OpenMP clause: nowait.  */
-  OMP_CLAUSE_NOWAIT,
-
-  /* OpenMP clause: ordered.  */
-  OMP_CLAUSE_ORDERED,
-
-  /* OpenMP clause: default.  */
-  OMP_CLAUSE_DEFAULT,
-
-  /* OpenMP clause: collapse (constant-integer-expression).  */
-  OMP_CLAUSE_COLLAPSE,
-
-  /* OpenMP clause: untied.  */
-  OMP_CLAUSE_UNTIED,
-
-  /* OpenMP clause: final (scalar-expression).  */
-  OMP_CLAUSE_FINAL,
-
-  /* OpenMP clause: mergeable.  */
-  OMP_CLAUSE_MERGEABLE,
-
-  /* OpenMP clause: safelen (constant-integer-expression).  */
-  OMP_CLAUSE_SAFELEN,
-
-  /* Internally used only clause, holding SIMD uid.  */
-  OMP_CLAUSE__SIMDUID_
-};
-\f
-/* The definition of tree nodes fills the next several pages.  */
-
-/* A tree node can represent a data type, a variable, an expression
-   or a statement.  Each node has a TREE_CODE which says what kind of
-   thing it represents.  Some common codes are:
-   INTEGER_TYPE -- represents a type of integers.
-   ARRAY_TYPE -- represents a type of pointer.
-   VAR_DECL -- represents a declared variable.
-   INTEGER_CST -- represents a constant integer value.
-   PLUS_EXPR -- represents a sum (an expression).
-
-   As for the contents of a tree node: there are some fields
-   that all nodes share.  Each TREE_CODE has various special-purpose
-   fields as well.  The fields of a node are never accessed directly,
-   always through accessor macros.  */
-
-/* Every kind of tree node starts with this structure,
-   so all nodes have these fields.
-
-   See the accessor macros, defined below, for documentation of the
-   fields, and the table below which connects the fields and the
-   accessor macros.  */
-
-struct GTY(()) tree_base {
-  ENUM_BITFIELD(tree_code) code : 16;
-
-  unsigned side_effects_flag : 1;
-  unsigned constant_flag : 1;
-  unsigned addressable_flag : 1;
-  unsigned volatile_flag : 1;
-  unsigned readonly_flag : 1;
-  unsigned asm_written_flag: 1;
-  unsigned nowarning_flag : 1;
-  unsigned visited : 1;
-
-  unsigned used_flag : 1;
-  unsigned nothrow_flag : 1;
-  unsigned static_flag : 1;
-  unsigned public_flag : 1;
-  unsigned private_flag : 1;
-  unsigned protected_flag : 1;
-  unsigned deprecated_flag : 1;
-  unsigned default_def_flag : 1;
-
-  union {
-    /* The bits in the following structure should only be used with
-       accessor macros that constrain inputs with tree checking.  */
-    struct {
-      unsigned lang_flag_0 : 1;
-      unsigned lang_flag_1 : 1;
-      unsigned lang_flag_2 : 1;
-      unsigned lang_flag_3 : 1;
-      unsigned lang_flag_4 : 1;
-      unsigned lang_flag_5 : 1;
-      unsigned lang_flag_6 : 1;
-      unsigned saturating_flag : 1;
-
-      unsigned unsigned_flag : 1;
-      unsigned packed_flag : 1;
-      unsigned user_align : 1;
-      unsigned nameless_flag : 1;
-      unsigned spare0 : 4;
-
-      unsigned spare1 : 8;
-
-      /* This field is only used with TREE_TYPE nodes; the only reason it is
-	 present in tree_base instead of tree_type is to save space.  The size
-	 of the field must be large enough to hold addr_space_t values.  */
-      unsigned address_space : 8;
-    } bits;
-    /* The following fields are present in tree_base to save space.  The
-       nodes using them do not require any of the flags above and so can
-       make better use of the 4-byte sized word.  */
-    /* VEC length.  This field is only used with TREE_VEC.  */
-    int length;
-    /* SSA version number.  This field is only used with SSA_NAME.  */
-    unsigned int version;
-  } GTY((skip(""))) u;
-};
-
-/* The following table lists the uses of each of the above flags and
-   for which types of nodes they are defined.
-
-   addressable_flag:
-
-       TREE_ADDRESSABLE in
-           VAR_DECL, PARM_DECL, RESULT_DECL, FUNCTION_DECL, LABEL_DECL
-           SSA_NAME
-           all types
-           CONSTRUCTOR, IDENTIFIER_NODE
-           STMT_EXPR
-
-       CALL_EXPR_TAILCALL in
-           CALL_EXPR
-
-       CASE_LOW_SEEN in
-           CASE_LABEL_EXPR
-
-       PREDICT_EXPR_OUTCOME in
-	   PREDICT_EXPR
-
-   static_flag:
-
-       TREE_STATIC in
-           VAR_DECL, FUNCTION_DECL
-           CONSTRUCTOR
-
-       TREE_NO_TRAMPOLINE in
-           ADDR_EXPR
-
-       BINFO_VIRTUAL_P in
-           TREE_BINFO
-
-       TREE_SYMBOL_REFERENCED in
-           IDENTIFIER_NODE
-
-       CLEANUP_EH_ONLY in
-           TARGET_EXPR, WITH_CLEANUP_EXPR
-
-       TRY_CATCH_IS_CLEANUP in
-           TRY_CATCH_EXPR
-
-       ASM_INPUT_P in
-           ASM_EXPR
-
-       TYPE_REF_CAN_ALIAS_ALL in
-           POINTER_TYPE, REFERENCE_TYPE
-
-       CASE_HIGH_SEEN in
-           CASE_LABEL_EXPR
-
-       ENUM_IS_SCOPED in
-	   ENUMERAL_TYPE
-
-       TRANSACTION_EXPR_OUTER in
-	   TRANSACTION_EXPR
-
-   public_flag:
-
-       TREE_OVERFLOW in
-           INTEGER_CST, REAL_CST, COMPLEX_CST, VECTOR_CST
-
-       TREE_PUBLIC in
-           VAR_DECL, FUNCTION_DECL
-           IDENTIFIER_NODE
-
-       ASM_VOLATILE_P in
-           ASM_EXPR
-
-       CALL_EXPR_VA_ARG_PACK in
-           CALL_EXPR
-
-       TYPE_CACHED_VALUES_P in
-           all types
-
-       SAVE_EXPR_RESOLVED_P in
-           SAVE_EXPR
-
-       OMP_CLAUSE_LASTPRIVATE_FIRSTPRIVATE in
-           OMP_CLAUSE_LASTPRIVATE
-
-       OMP_CLAUSE_PRIVATE_DEBUG in
-           OMP_CLAUSE_PRIVATE
-
-       OMP_CLAUSE_LINEAR_NO_COPYIN in
-	   OMP_CLAUSE_LINEAR
-
-       TRANSACTION_EXPR_RELAXED in
-	   TRANSACTION_EXPR
-
-   private_flag:
-
-       TREE_PRIVATE in
-           all decls
-
-       CALL_EXPR_RETURN_SLOT_OPT in
-           CALL_EXPR
-
-       OMP_SECTION_LAST in
-           OMP_SECTION
-
-       OMP_PARALLEL_COMBINED in
-           OMP_PARALLEL
-
-       OMP_CLAUSE_PRIVATE_OUTER_REF in
-	   OMP_CLAUSE_PRIVATE
-
-       OMP_CLAUSE_LINEAR_NO_COPYOUT in
-	   OMP_CLAUSE_LINEAR
-
-       TYPE_REF_IS_RVALUE in
-	   REFERENCE_TYPE
-
-       ENUM_IS_OPAQUE in
-	   ENUMERAL_TYPE
-
-   protected_flag:
-
-       TREE_PROTECTED in
-           BLOCK
-           all decls
-
-       CALL_FROM_THUNK_P and
-       CALL_ALLOCA_FOR_VAR_P in
-           CALL_EXPR
-
-   side_effects_flag:
-
-       TREE_SIDE_EFFECTS in
-           all expressions
-           all decls
-           all constants
-
-       FORCED_LABEL in
-           LABEL_DECL
-
-   volatile_flag:
-
-       TREE_THIS_VOLATILE in
-           all expressions
-           all decls
-
-       TYPE_VOLATILE in
-           all types
-
-   readonly_flag:
-
-       TREE_READONLY in
-           all expressions
-           all decls
-
-       TYPE_READONLY in
-           all types
-
-   constant_flag:
-
-       TREE_CONSTANT in
-           all expressions
-           all decls
-           all constants
-
-       TYPE_SIZES_GIMPLIFIED in
-           all types
-
-   unsigned_flag:
-
-       TYPE_UNSIGNED in
-           all types
-
-       DECL_UNSIGNED in
-           all decls
-
-   asm_written_flag:
-
-       TREE_ASM_WRITTEN in
-           VAR_DECL, FUNCTION_DECL, TYPE_DECL
-           RECORD_TYPE, UNION_TYPE, QUAL_UNION_TYPE
-           BLOCK, STRING_CST
-
-       SSA_NAME_OCCURS_IN_ABNORMAL_PHI in
-           SSA_NAME
-
-   used_flag:
-
-       TREE_USED in
-           all expressions
-           all decls
-           IDENTIFIER_NODE
-
-   nothrow_flag:
-
-       TREE_NOTHROW in
-           CALL_EXPR
-           FUNCTION_DECL
-
-       TYPE_ALIGN_OK in
-           all types
-
-       TREE_THIS_NOTRAP in
-          INDIRECT_REF, MEM_REF, TARGET_MEM_REF, ARRAY_REF, ARRAY_RANGE_REF
-
-       SSA_NAME_IN_FREELIST in
-          SSA_NAME
-
-   deprecated_flag:
-
-       TREE_DEPRECATED in
-           all decls
-	   all types
-
-       IDENTIFIER_TRANSPARENT_ALIAS in
-           IDENTIFIER_NODE
-
-   visited:
-
-       TREE_VISITED in
-           all trees (used liberally by many passes)
-
-   saturating_flag:
-
-       TYPE_SATURATING in
-           all types
-
-       VAR_DECL_IS_VIRTUAL_OPERAND in
-	   VAR_DECL
-
-   nowarning_flag:
-
-       TREE_NO_WARNING in
-           all expressions
-           all decls
-
-       TYPE_ARTIFICIAL in
-           all types
-
-   default_def_flag:
-
-       TYPE_VECTOR_OPAQUE in
-	   VECTOR_TYPE
-
-       SSA_NAME_IS_DEFAULT_DEF in
-           SSA_NAME
-
-       DECL_NONLOCAL_FRAME in
-	   VAR_DECL
-
-       TYPE_FINAL_P in
-	   RECORD_TYPE, UNION_TYPE and QUAL_UNION_TYPE
-*/
-
-struct GTY(()) tree_typed {
-  struct tree_base base;
-  tree type;
-};
-
-struct GTY(()) tree_common {
-  struct tree_typed typed;
-  tree chain;
-};
-
-#undef DEFTREESTRUCT
-#define DEFTREESTRUCT(ENUM, NAME) ENUM,
-enum tree_node_structure_enum {
-#include "treestruct.def"
-  LAST_TS_ENUM
-};
-#undef DEFTREESTRUCT
 
 /* Define accessors for the fields that all tree nodes have
    (though some fields are not used for all kinds of nodes).  */
@@ -1439,70 +884,28 @@ extern void omp_clause_range_check_failed (const_tree, const char *, int,
 	== (unsigned HOST_WIDE_INT) TREE_INT_CST_HIGH (B))	\
        && TREE_INT_CST_LOW (A) < TREE_INT_CST_LOW (B)))
 
-struct GTY(()) tree_int_cst {
-  struct tree_typed typed;
-  double_int int_cst;
-};
-
-/* In a REAL_CST node.  struct real_value is an opaque entity, with
-   manipulators defined in real.h.  We don't want tree.h depending on
-   real.h and transitively on tm.h.  */
-struct real_value;
-
 #define TREE_REAL_CST_PTR(NODE) (REAL_CST_CHECK (NODE)->real_cst.real_cst_ptr)
 #define TREE_REAL_CST(NODE) (*TREE_REAL_CST_PTR (NODE))
 
-struct GTY(()) tree_real_cst {
-  struct tree_typed typed;
-  struct real_value * real_cst_ptr;
-};
-
-/* In a FIXED_CST node.  */
-struct fixed_value;
-
 #define TREE_FIXED_CST_PTR(NODE) \
   (FIXED_CST_CHECK (NODE)->fixed_cst.fixed_cst_ptr)
 #define TREE_FIXED_CST(NODE) (*TREE_FIXED_CST_PTR (NODE))
 
-struct GTY(()) tree_fixed_cst {
-  struct tree_typed typed;
-  struct fixed_value * fixed_cst_ptr;
-};
-
 /* In a STRING_CST */
 /* In C terms, this is sizeof, not strlen.  */
 #define TREE_STRING_LENGTH(NODE) (STRING_CST_CHECK (NODE)->string.length)
 #define TREE_STRING_POINTER(NODE) \
   ((const char *)(STRING_CST_CHECK (NODE)->string.str))
 
-struct GTY(()) tree_string {
-  struct tree_typed typed;
-  int length;
-  char str[1];
-};
-
 /* In a COMPLEX_CST node.  */
 #define TREE_REALPART(NODE) (COMPLEX_CST_CHECK (NODE)->complex.real)
 #define TREE_IMAGPART(NODE) (COMPLEX_CST_CHECK (NODE)->complex.imag)
 
-struct GTY(()) tree_complex {
-  struct tree_typed typed;
-  tree real;
-  tree imag;
-};
-
 /* In a VECTOR_CST node.  */
 #define VECTOR_CST_NELTS(NODE) (TYPE_VECTOR_SUBPARTS (TREE_TYPE (NODE)))
 #define VECTOR_CST_ELTS(NODE) (VECTOR_CST_CHECK (NODE)->vector.elts)
 #define VECTOR_CST_ELT(NODE,IDX) (VECTOR_CST_CHECK (NODE)->vector.elts[IDX])
 
-struct GTY(()) tree_vector {
-  struct tree_typed typed;
-  tree GTY ((length ("TYPE_VECTOR_SUBPARTS (TREE_TYPE ((tree)&%h))"))) elts[1];
-};
-\f
-#include "symtab.h"
-
 /* Define fields and accessors for some special-purpose tree nodes.  */
 
 #define IDENTIFIER_LENGTH(NODE) \
@@ -1519,21 +922,10 @@ struct GTY(()) tree_vector {
   ((tree) ((char *) (NODE) - sizeof (struct tree_common)))
 #define GCC_IDENT_TO_HT_IDENT(NODE) (&((struct tree_identifier *) (NODE))->id)
 
-struct GTY(()) tree_identifier {
-  struct tree_common common;
-  struct ht_identifier id;
-};
-
 /* In a TREE_LIST node.  */
 #define TREE_PURPOSE(NODE) (TREE_LIST_CHECK (NODE)->list.purpose)
 #define TREE_VALUE(NODE) (TREE_LIST_CHECK (NODE)->list.value)
 
-struct GTY(()) tree_list {
-  struct tree_common common;
-  tree purpose;
-  tree value;
-};
-
 /* In a TREE_VEC node.  */
 #define TREE_VEC_LENGTH(NODE) (TREE_VEC_CHECK (NODE)->base.u.length)
 #define TREE_VEC_END(NODE) \
@@ -1541,11 +933,6 @@ struct GTY(()) tree_list {
 
 #define TREE_VEC_ELT(NODE,I) TREE_VEC_ELT_CHECK (NODE, I)
 
-struct GTY(()) tree_vec {
-  struct tree_common common;
-  tree GTY ((length ("TREE_VEC_LENGTH ((tree)&%h)"))) a[1];
-};
-
 /* In a CONSTRUCTOR node.  */
 #define CONSTRUCTOR_ELTS(NODE) (CONSTRUCTOR_CHECK (NODE)->constructor.elts)
 #define CONSTRUCTOR_ELT(NODE,IDX) \
@@ -1594,21 +981,6 @@ struct GTY(()) tree_vec {
 #define TREE_CLOBBER_P(NODE) \
   (TREE_CODE (NODE) == CONSTRUCTOR && TREE_THIS_VOLATILE (NODE))
 
-/* A single element of a CONSTRUCTOR. VALUE holds the actual value of the
-   element. INDEX can optionally design the position of VALUE: in arrays,
-   it is the index where VALUE has to be placed; in structures, it is the
-   FIELD_DECL of the member.  */
-typedef struct GTY(()) constructor_elt_d {
-  tree index;
-  tree value;
-} constructor_elt;
-
-
-struct GTY(()) tree_constructor {
-  struct tree_typed typed;
-  vec<constructor_elt, va_gc> *elts;
-};
-
 /* Define fields and accessors for some nodes that represent expressions.  */
 
 /* Nonzero if NODE is an empty statement (NOP_EXPR <0>).  */
@@ -1907,38 +1279,12 @@ extern void protected_set_expr_location (tree, location_t);
 #define OMP_CLAUSE__SIMDUID__DECL(NODE) \
   OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE__SIMDUID_), 0)
 
-enum omp_clause_schedule_kind
-{
-  OMP_CLAUSE_SCHEDULE_STATIC,
-  OMP_CLAUSE_SCHEDULE_DYNAMIC,
-  OMP_CLAUSE_SCHEDULE_GUIDED,
-  OMP_CLAUSE_SCHEDULE_AUTO,
-  OMP_CLAUSE_SCHEDULE_RUNTIME
-};
-
 #define OMP_CLAUSE_SCHEDULE_KIND(NODE) \
   (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_SCHEDULE)->omp_clause.subcode.schedule_kind)
 
-enum omp_clause_default_kind
-{
-  OMP_CLAUSE_DEFAULT_UNSPECIFIED,
-  OMP_CLAUSE_DEFAULT_SHARED,
-  OMP_CLAUSE_DEFAULT_NONE,
-  OMP_CLAUSE_DEFAULT_PRIVATE,
-  OMP_CLAUSE_DEFAULT_FIRSTPRIVATE
-};
-
 #define OMP_CLAUSE_DEFAULT_KIND(NODE) \
   (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_DEFAULT)->omp_clause.subcode.default_kind)
 
-struct GTY(()) tree_exp {
-  struct tree_typed typed;
-  location_t locus;
-  tree GTY ((special ("tree_exp"),
-	     desc ("TREE_CODE ((tree) &%0)")))
-    operands[1];
-};
-\f
 /* SSA_NAME accessors.  */
 
 /* Returns the IDENTIFIER_NODE giving the SSA name a name or NULL_TREE
@@ -1992,51 +1338,9 @@ struct GTY(()) tree_exp {
 #define SSA_NAME_PTR_INFO(N) \
     SSA_NAME_CHECK (N)->ssa_name.ptr_info
 
-/* Defined in tree-flow.h.  */
-struct ptr_info_def;
-
-/* Immediate use linking structure.  This structure is used for maintaining
-   a doubly linked list of uses of an SSA_NAME.  */
-typedef struct GTY(()) ssa_use_operand_d {
-  struct ssa_use_operand_d* GTY((skip(""))) prev;
-  struct ssa_use_operand_d* GTY((skip(""))) next;
-  /* Immediate uses for a given SSA name are maintained as a cyclic
-     list.  To recognize the root of this list, the location field
-     needs to point to the original SSA name.  Since statements and
-     SSA names are of different data types, we need this union.  See
-     the explanation in struct immediate_use_iterator_d.  */
-  union { gimple stmt; tree ssa_name; } GTY((skip(""))) loc;
-  tree *GTY((skip(""))) use;
-} ssa_use_operand_t;
-
 /* Return the immediate_use information for an SSA_NAME. */
 #define SSA_NAME_IMM_USE_NODE(NODE) SSA_NAME_CHECK (NODE)->ssa_name.imm_uses
 
-struct GTY(()) tree_ssa_name {
-  struct tree_typed typed;
-
-  /* _DECL wrapped by this SSA name.  */
-  tree var;
-
-  /* Statement that defines this SSA name.  */
-  gimple def_stmt;
-
-  /* Pointer attributes used for alias analysis.  */
-  struct ptr_info_def *ptr_info;
-
-  /* Immediate uses list for this SSA_NAME.  */
-  struct ssa_use_operand_d imm_uses;
-};
-\f
-struct GTY(()) phi_arg_d {
-  /* imm_use MUST be the first element in struct because we do some
-     pointer arithmetic with it.  See phi_arg_index_from_use.  */
-  struct ssa_use_operand_d imm_use;
-  tree def;
-  location_t locus;
-};
-
-\f
 #define OMP_CLAUSE_CODE(NODE)					\
 	(OMP_CLAUSE_CHECK (NODE))->omp_clause.code
 
@@ -2049,25 +1353,6 @@ struct GTY(()) phi_arg_d {
 #define OMP_CLAUSE_OPERAND(NODE, I)				\
 	OMP_CLAUSE_ELT_CHECK (NODE, I)
 
-struct GTY(()) tree_omp_clause {
-  struct tree_common common;
-  location_t locus;
-  enum omp_clause_code code;
-  union omp_clause_subcode {
-    enum omp_clause_default_kind  default_kind;
-    enum omp_clause_schedule_kind schedule_kind;
-    enum tree_code                reduction_code;
-  } GTY ((skip)) subcode;
-
-  /* The gimplification of OMP_CLAUSE_REDUCTION_{INIT,MERGE} for omp-low's
-     usage.  */
-  gimple_seq gimple_reduction_init;
-  gimple_seq gimple_reduction_merge;
-
-  tree GTY ((length ("omp_clause_num_ops[OMP_CLAUSE_CODE ((tree)&%h)]"))) ops[1];
-};
-\f
-
 /* In a BLOCK node.  */
 #define BLOCK_VARS(NODE) (BLOCK_CHECK (NODE)->block.vars)
 #define BLOCK_NONLOCALIZED_VARS(NODE) \
@@ -2120,25 +1405,6 @@ struct GTY(()) tree_omp_clause {
 
 #define BLOCK_SOURCE_LOCATION(NODE) (BLOCK_CHECK (NODE)->block.locus)
 
-struct GTY(()) tree_block {
-  struct tree_base base;
-  tree chain;
-
-  unsigned abstract_flag : 1;
-  unsigned block_num : 31;
-
-  location_t locus;
-
-  tree vars;
-  vec<tree, va_gc> *nonlocalized_vars;
-
-  tree subblocks;
-  tree supercontext;
-  tree abstract_origin;
-  tree fragment_origin;
-  tree fragment_chain;
-};
-\f
 /* Define fields and accessors for nodes representing data types.  */
 
 /* See tree.def for documentation of the use of these fields.
@@ -2258,17 +1524,6 @@ extern enum machine_mode vector_type_mode (const_tree);
 /* The address space the type is in.  */
 #define TYPE_ADDR_SPACE(NODE) (TYPE_CHECK (NODE)->base.u.bits.address_space)
 
-/* There is a TYPE_QUAL value for each type qualifier.  They can be
-   combined by bitwise-or to form the complete set of qualifiers for a
-   type.  */
-enum cv_qualifier
-  {
-    TYPE_UNQUALIFIED   = 0x0,
-    TYPE_QUAL_CONST    = 0x1,
-    TYPE_QUAL_VOLATILE = 0x2,
-    TYPE_QUAL_RESTRICT = 0x4
-  };
-
 /* Encode/decode the named memory support as part of the qualifier.  If more
    than 8 qualifiers are added, these macros need to be adjusted.  */
 #define ENCODE_QUAL_ADDR_SPACE(NUM) ((NUM & 0xFF) << 8)
@@ -2388,58 +1643,9 @@ enum cv_qualifier
 #define TYPE_SYMTAB_IS_POINTER (1)
 #define TYPE_SYMTAB_IS_DIE (2)
 
-struct die_struct;
-
-struct GTY(()) tree_type_common {
-  struct tree_common common;
-  tree size;
-  tree size_unit;
-  tree attributes;
-  unsigned int uid;
-
-  unsigned int precision : 10;
-  unsigned no_force_blk_flag : 1;
-  unsigned needs_constructing_flag : 1;
-  unsigned transparent_aggr_flag : 1;
-  unsigned restrict_flag : 1;
-  unsigned contains_placeholder_bits : 2;
-
-  ENUM_BITFIELD(machine_mode) mode : 8;
-
-  unsigned string_flag : 1;
-  unsigned lang_flag_0 : 1;
-  unsigned lang_flag_1 : 1;
-  unsigned lang_flag_2 : 1;
-  unsigned lang_flag_3 : 1;
-  unsigned lang_flag_4 : 1;
-  unsigned lang_flag_5 : 1;
-  unsigned lang_flag_6 : 1;
-
-  unsigned int align;
-  alias_set_type alias_set;
-  tree pointer_to;
-  tree reference_to;
-  union tree_type_symtab {
-    int GTY ((tag ("TYPE_SYMTAB_IS_ADDRESS"))) address;
-    const char * GTY ((tag ("TYPE_SYMTAB_IS_POINTER"))) pointer;
-    struct die_struct * GTY ((tag ("TYPE_SYMTAB_IS_DIE"))) die;
-  } GTY ((desc ("debug_hooks->tree_type_symtab_field"))) symtab;
-  tree name;
-  tree next_variant;
-  tree main_variant;
-  tree context;
-  tree canonical;
-};
-
 #define TYPE_LANG_SPECIFIC(NODE) \
   (TYPE_CHECK (NODE)->type_with_lang_specific.lang_specific)
 
-struct GTY(()) tree_type_with_lang_specific {
-  struct tree_type_common common;
-  /* Points to a structure whose details depend on the language in use.  */
-  struct lang_type *lang_specific;
-};
-
 #define TYPE_VALUES(NODE) (ENUMERAL_TYPE_CHECK (NODE)->type_non_common.values)
 #define TYPE_DOMAIN(NODE) (ARRAY_TYPE_CHECK (NODE)->type_non_common.values)
 #define TYPE_FIELDS(NODE) \
@@ -2482,14 +1688,6 @@ struct GTY(()) tree_type_with_lang_specific {
 #define TYPE_LANG_SLOT_1(NODE) \
   (NOT_RECORD_OR_UNION_CHECK(NODE)->type_non_common.binfo)
 
-struct GTY(()) tree_type_non_common {
-  struct tree_type_with_lang_specific with_lang_specific;
-  tree values;
-  tree minval;
-  tree maxval;
-  tree binfo;
-};
-\f
 /* Define accessor macros for information about type inheritance
    and basetypes.
 
@@ -2593,23 +1791,7 @@ struct GTY(()) tree_type_non_common {
 #define BINFO_INHERITANCE_CHAIN(NODE) \
 	(TREE_BINFO_CHECK(NODE)->binfo.inheritance)
 
-struct GTY (()) tree_binfo {
-  struct tree_common common;
 
-  tree offset;
-  tree vtable;
-  tree virtuals;
-  tree vptr_field;
-  vec<tree, va_gc> *base_accesses;
-  tree inheritance;
-
-  tree vtt_subvtt;
-  tree vtt_vptr;
-
-  vec<tree, va_gc> base_binfos;
-};
-
-\f
 /* Define fields and accessors for nodes representing declared names.  */
 
 /* Nonzero if DECL represents an SSA name or a variable that can possibly
@@ -2621,21 +1803,6 @@ struct GTY (()) tree_binfo {
 	 || TREE_CODE (DECL) == SSA_NAME)
 
 
-
-/* Enumerate visibility settings.  */
-#ifndef SYMBOL_VISIBILITY_DEFINED
-#define SYMBOL_VISIBILITY_DEFINED
-enum symbol_visibility
-{
-  VISIBILITY_DEFAULT,
-  VISIBILITY_PROTECTED,
-  VISIBILITY_HIDDEN,
-  VISIBILITY_INTERNAL
-};
-#endif
-
-struct function;
-
 #define DECL_CHAIN(NODE) (TREE_CHAIN (DECL_MINIMAL_CHECK (NODE)))
 
 /* This is the name of the object as written by the user.
@@ -2690,15 +1857,6 @@ struct function;
 /* If nonzero, decl's name shouldn't be emitted into debug info.  */
 #define DECL_NAMELESS(NODE) (DECL_MINIMAL_CHECK (NODE)->base.u.bits.nameless_flag)
 
-struct GTY(()) tree_decl_minimal {
-  struct tree_common common;
-  location_t locus;
-  unsigned int uid;
-  tree name;
-  tree context;
-};
-
-
 /* For any sort of a ..._DECL node, this points to the original (abstract)
    decl node which this decl is an inlined/cloned instance of, or else it
    is NULL indicating that this decl is not an instance of some other decl.
@@ -2856,72 +2014,6 @@ struct GTY(()) tree_decl_minimal {
 #define DECL_GIMPLE_REG_P(DECL) \
   DECL_COMMON_CHECK (DECL)->decl_common.gimple_reg_flag
 
-struct GTY(()) tree_decl_common {
-  struct tree_decl_minimal common;
-  tree size;
-
-  ENUM_BITFIELD(machine_mode) mode : 8;
-
-  unsigned nonlocal_flag : 1;
-  unsigned virtual_flag : 1;
-  unsigned ignored_flag : 1;
-  unsigned abstract_flag : 1;
-  unsigned artificial_flag : 1;
-  unsigned preserve_flag: 1;
-  unsigned debug_expr_is_from : 1;
-
-  unsigned lang_flag_0 : 1;
-  unsigned lang_flag_1 : 1;
-  unsigned lang_flag_2 : 1;
-  unsigned lang_flag_3 : 1;
-  unsigned lang_flag_4 : 1;
-  unsigned lang_flag_5 : 1;
-  unsigned lang_flag_6 : 1;
-  unsigned lang_flag_7 : 1;
-  unsigned lang_flag_8 : 1;
-
-  /* In VAR_DECL and PARM_DECL, this is DECL_REGISTER.  */
-  unsigned decl_flag_0 : 1;
-  /* In FIELD_DECL, this is DECL_BIT_FIELD
-     In VAR_DECL and FUNCTION_DECL, this is DECL_EXTERNAL.
-     In TYPE_DECL, this is TYPE_DECL_SUPPRESS_DEBUG.  */
-  unsigned decl_flag_1 : 1;
-  /* In FIELD_DECL, this is DECL_NONADDRESSABLE_P
-     In VAR_DECL, PARM_DECL and RESULT_DECL, this is
-     DECL_HAS_VALUE_EXPR_P.  */
-  unsigned decl_flag_2 : 1;
-  /* 1 bit unused.  */
-  unsigned decl_flag_3 : 1;
-  /* Logically, these two would go in a theoretical base shared by var and
-     parm decl. */
-  unsigned gimple_reg_flag : 1;
-  /* In VAR_DECL, PARM_DECL and RESULT_DECL, this is DECL_BY_REFERENCE.  */
-  unsigned decl_by_reference_flag : 1;
-  /* In a VAR_DECL and PARM_DECL, this is DECL_READ_P.  */
-  unsigned decl_read_flag : 1;
-  /* In a VAR_DECL or RESULT_DECL, this is DECL_NONSHAREABLE.  */
-  unsigned decl_nonshareable_flag : 1;
-
-  /* DECL_OFFSET_ALIGN, used only for FIELD_DECLs.  */
-  unsigned int off_align : 8;
-
-  /* 24 bits unused.  */
-
-  /* DECL_ALIGN.  It should have the same size as TYPE_ALIGN.  */
-  unsigned int align;
-
-  /* UID for points-to sets, stable over copying from inlining.  */
-  unsigned int pt_uid;
-
-  tree size_unit;
-  tree initial;
-  tree attributes;
-  tree abstract_origin;
-
-  /* Points to a structure whose details depend on the language in use.  */
-  struct lang_decl *lang_specific;
-};
-
 extern tree decl_value_expr_lookup (tree);
 extern void decl_value_expr_insert (tree, tree);
 
@@ -2978,11 +2070,6 @@ extern void decl_value_expr_insert (tree, tree);
 /* In VAR_DECL and PARM_DECL nodes, nonzero means declared `register'.  */
 #define DECL_REGISTER(NODE) (DECL_WRTL_CHECK (NODE)->decl_common.decl_flag_0)
 
-struct GTY(()) tree_decl_with_rtl {
-  struct tree_decl_common common;
-  rtx rtl;
-};
-
 /* In a FIELD_DECL, this is the field position, counting in bytes, of the
    DECL_OFFSET_ALIGN-bit-sized word containing the bit closest to the beginning
    of the structure.  */
@@ -3051,16 +2138,6 @@ struct GTY(()) tree_decl_with_rtl {
 #define DECL_NONADDRESSABLE_P(NODE) \
   (FIELD_DECL_CHECK (NODE)->decl_common.decl_flag_2)
 
-struct GTY(()) tree_field_decl {
-  struct tree_decl_common common;
-
-  tree offset;
-  tree bit_field_type;
-  tree qualifier;
-  tree bit_offset;
-  tree fcontext;
-};
-
 /* A numeric unique identifier for a LABEL_DECL.  The UID allocation is
    dense, unique within any one function, and may be used to index arrays.
    If the value is -1, then no UID has been assigned.  */
@@ -3072,20 +2149,6 @@ struct GTY(()) tree_field_decl {
 #define EH_LANDING_PAD_NR(NODE) \
   (LABEL_DECL_CHECK (NODE)->label_decl.eh_landing_pad_nr)
 
-struct GTY(()) tree_label_decl {
-  struct tree_decl_with_rtl common;
-  int label_decl_uid;
-  int eh_landing_pad_nr;
-};
-
-struct GTY(()) tree_result_decl {
-  struct tree_decl_with_rtl common;
-};
-
-struct GTY(()) tree_const_decl {
-  struct tree_decl_common common;
-};
-
 /* For a PARM_DECL, records the data type used to pass the argument,
    which may be different from the type seen in the program.  */
 #define DECL_ARG_TYPE(NODE) (PARM_DECL_CHECK (NODE)->decl_common.initial)
@@ -3095,12 +2158,6 @@ struct GTY(()) tree_const_decl {
 #define DECL_INCOMING_RTL(NODE) \
   (PARM_DECL_CHECK (NODE)->parm_decl.incoming_rtl)
 
-struct GTY(()) tree_parm_decl {
-  struct tree_decl_with_rtl common;
-  rtx incoming_rtl;
-};
-
-
 /* Nonzero for a given ..._DECL node means that no warnings should be
    generated just because this node is unused.  */
 #define DECL_IN_SYSTEM_HEADER(NODE) \
@@ -3233,46 +2290,9 @@ struct GTY(()) tree_parm_decl {
 #define DECL_HAS_IMPLICIT_SECTION_NAME_P(NODE) \
   (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.implicit_section_name_p)
 
-struct GTY(()) tree_decl_with_vis {
- struct tree_decl_with_rtl common;
- tree assembler_name;
- tree section_name;
- tree comdat_group;
-
- /* Belong to VAR_DECL exclusively.  */
- unsigned defer_output : 1;
- unsigned hard_register : 1;
- unsigned common_flag : 1;
- unsigned in_text_section : 1;
- unsigned in_constant_pool : 1;
- unsigned dllimport_flag : 1;
- /* Don't belong to VAR_DECL exclusively.  */
- unsigned weak_flag : 1;
- /* When SECTION_NAME is implied by -ffunction-section.  */
- unsigned implicit_section_name_p : 1;
-
- unsigned seen_in_bind_expr : 1;
- unsigned comdat_flag : 1;
- ENUM_BITFIELD(symbol_visibility) visibility : 2;
- unsigned visibility_specified : 1;
- /* Belongs to VAR_DECL exclusively.  */
- ENUM_BITFIELD(tls_model) tls_model : 3;
-
- /* Belong to FUNCTION_DECL exclusively.  */
- unsigned init_priority_p : 1;
- /* Used by C++ only.  Might become a generic decl flag.  */
- unsigned shadowed_for_var_p : 1;
- /* Belong to FUNCTION_DECL exclusively.  */
- unsigned cxx_constructor : 1;
- /* Belong to FUNCTION_DECL exclusively.  */
- unsigned cxx_destructor : 1;
- /* Belong to FUNCTION_DECL exclusively.  */
- unsigned final : 1;
- /* 11 unused bits. */
-};
-
 extern tree decl_debug_expr_lookup (tree);
 extern void decl_debug_expr_insert (tree, tree);
+
 /* For VAR_DECL, this is set to an expression that it was split from.  */
 #define DECL_HAS_DEBUG_EXPR_P(NODE) \
   (VAR_DECL_CHECK (NODE)->decl_common.debug_expr_is_from)
@@ -3282,9 +2302,6 @@ extern void decl_debug_expr_insert (tree, tree);
 #define SET_DECL_DEBUG_EXPR(NODE, VAL) \
   (decl_debug_expr_insert (VAR_DECL_CHECK (NODE), VAL))
 
-/* An initialization priority.  */
-typedef unsigned short priority_type;
-
 extern priority_type decl_init_priority_lookup (tree);
 extern priority_type decl_fini_priority_lookup (tree);
 extern void decl_init_priority_insert (tree, priority_type);
@@ -3324,11 +2341,6 @@ extern void decl_fini_priority_insert (tree, priority_type);
 #define DECL_NONLOCAL_FRAME(NODE)  \
   (VAR_DECL_CHECK (NODE)->base.default_def_flag)
 
-struct GTY(()) tree_var_decl {
-  struct tree_decl_with_vis common;
-};
-
-
 /* This field is used to reference anything in decl.result and is meant only
    for use by the garbage collector.  */
 #define DECL_RESULT_FLD(NODE) \
@@ -3345,19 +2357,6 @@ struct GTY(()) tree_var_decl {
 #define DECL_VINDEX(NODE) \
   (DECL_NON_COMMON_CHECK (NODE)->decl_non_common.vindex)
 
-struct GTY(())
- tree_decl_non_common {
-  struct tree_decl_with_vis common;
-  /* C++ uses this in namespaces.  */
-  tree saved_tree;
-  /* C++ uses this in templates.  */
-  tree arguments;
-  /* Almost all FE's use this.  */
-  tree result;
-  /* C++ uses this in namespaces and function_decls.  */
-  tree vindex;
-};
-
 /* In FUNCTION_DECL, holds the decl for the return value.  */
 #define DECL_RESULT(NODE) (FUNCTION_DECL_CHECK (NODE)->decl_non_common.result)
 
@@ -3540,66 +2539,12 @@ extern vec<tree, va_gc> **decl_debug_args_insert (tree);
    FUNCTION_DECL from non_common, or inherit non_common from FUNCTION_DECL,
    which seemed a bit strange.  */
 
-struct GTY(()) tree_function_decl {
-  struct tree_decl_non_common common;
-
-  struct function *f;
-
-  /* The personality function. Used for stack unwinding. */
-  tree personality;
-
-  /* Function specific options that are used by this function.  */
-  tree function_specific_target;	/* target options */
-  tree function_specific_optimization;	/* optimization options */
-
-  /* In a FUNCTION_DECL for which DECL_BUILT_IN holds, this is
-     DECL_FUNCTION_CODE.  Otherwise unused.
-     ???  The bitfield needs to be able to hold all target function
-	  codes as well.  */
-  ENUM_BITFIELD(built_in_function) function_code : 11;
-  ENUM_BITFIELD(built_in_class) built_in_class : 2;
-
-  unsigned static_ctor_flag : 1;
-  unsigned static_dtor_flag : 1;
-  unsigned uninlinable : 1;
-
-  unsigned possibly_inlined : 1;
-  unsigned novops_flag : 1;
-  unsigned returns_twice_flag : 1;
-  unsigned malloc_flag : 1;
-  unsigned operator_new_flag : 1;
-  unsigned declared_inline_flag : 1;
-  unsigned regdecl_flag : 1;
-  unsigned no_inline_warning_flag : 1;
-
-  unsigned no_instrument_function_entry_exit : 1;
-  unsigned no_limit_stack : 1;
-  unsigned disregard_inline_limits : 1;
-  unsigned pure_flag : 1;
-  unsigned looping_const_or_pure_flag : 1;
-  unsigned has_debug_args_flag : 1;
-  unsigned tm_clone_flag : 1;
-  unsigned versioned_function : 1;
-  /* No bits left.  */
-};
-
 /* The source language of the translation-unit.  */
 #define TRANSLATION_UNIT_LANGUAGE(NODE) \
   (TRANSLATION_UNIT_DECL_CHECK (NODE)->translation_unit_decl.language)
 
 /* TRANSLATION_UNIT_DECL inherits from DECL_MINIMAL.  */
 
-struct GTY(()) tree_translation_unit_decl {
-  struct tree_decl_common common;
-  /* Source language of this translation unit.  Used for DWARF output.  */
-  const char * GTY((skip(""))) language;
-  /* TODO: Non-optimization used to build this translation unit.  */
-  /* TODO: Root of a partial DWARF tree for global types and decls.  */
-};
-
-/* A vector of all translation-units.  */
-extern GTY (()) vec<tree, va_gc> *all_translation_units;
-
 /* For a TYPE_DECL, holds the "original" type.  (TREE_TYPE has the copy.) */
 #define DECL_ORIGINAL_TYPE(NODE) \
   (TYPE_DECL_CHECK (NODE)->decl_non_common.result)
@@ -3615,11 +2560,6 @@ extern GTY (()) vec<tree, va_gc> *all_translation_units;
 #define IMPORTED_DECL_ASSOCIATED_DECL(NODE) \
 (DECL_INITIAL (IMPORTED_DECL_CHECK (NODE)))
 
-struct GTY(()) tree_type_decl {
-  struct tree_decl_non_common common;
-
-};
-\f
 /* A STATEMENT_LIST chains statements together in GENERIC and GIMPLE.
    To reduce overhead, the nodes containing the statements are not trees.
    This avoids the overhead of tree_common on all linked list elements.
@@ -3631,38 +2571,6 @@ struct GTY(()) tree_type_decl {
 #define STATEMENT_LIST_TAIL(NODE) \
   (STATEMENT_LIST_CHECK (NODE)->stmt_list.tail)
 
-struct GTY ((chain_next ("%h.next"), chain_prev ("%h.prev"))) tree_statement_list_node
- {
-  struct tree_statement_list_node *prev;
-  struct tree_statement_list_node *next;
-  tree stmt;
-};
-
-struct GTY(()) tree_statement_list
- {
-  struct tree_typed typed;
-  struct tree_statement_list_node *head;
-  struct tree_statement_list_node *tail;
-};
-
-
-/* Optimization options used by a function.  */
-
-struct GTY(()) tree_optimization_option {
-  struct tree_common common;
-
-  /* The optimization options used by the user.  */
-  struct cl_optimization opts;
-
-  /* Target optabs for this set of optimization options.  This is of
-     type `struct target_optabs *'.  */
-  unsigned char *GTY ((atomic)) optabs;
-
-  /* The value of this_target_optabs against which the optabs above were
-     generated.  */
-  struct target_optabs *GTY ((skip)) base_optabs;
-};
-
 #define TREE_OPTIMIZATION(NODE) \
   (&OPTIMIZATION_NODE_CHECK (NODE)->optimization.opts)
 
@@ -3677,71 +2585,12 @@ extern tree build_optimization_node (void);
 
 extern void init_tree_optimization_optabs (tree);
 
-/* Target options used by a function.  */
-
-struct GTY(()) tree_target_option {
-  struct tree_common common;
-
-  /* The optimization options used by the user.  */
-  struct cl_target_option opts;
-};
-
 #define TREE_TARGET_OPTION(NODE) \
   (&TARGET_OPTION_NODE_CHECK (NODE)->target_option.opts)
 
 /* Return a tree node that encapsulates the current target options.  */
 extern tree build_target_option_node (void);
 
-\f
-/* Define the overall contents of a tree node.
-   It may be any of the structures declared above
-   for various types of node.  */
-
-union GTY ((ptr_alias (union lang_tree_node),
-	    desc ("tree_node_structure (&%h)"), variable_size)) tree_node {
-  struct tree_base GTY ((tag ("TS_BASE"))) base;
-  struct tree_typed GTY ((tag ("TS_TYPED"))) typed;
-  struct tree_common GTY ((tag ("TS_COMMON"))) common;
-  struct tree_int_cst GTY ((tag ("TS_INT_CST"))) int_cst;
-  struct tree_real_cst GTY ((tag ("TS_REAL_CST"))) real_cst;
-  struct tree_fixed_cst GTY ((tag ("TS_FIXED_CST"))) fixed_cst;
-  struct tree_vector GTY ((tag ("TS_VECTOR"))) vector;
-  struct tree_string GTY ((tag ("TS_STRING"))) string;
-  struct tree_complex GTY ((tag ("TS_COMPLEX"))) complex;
-  struct tree_identifier GTY ((tag ("TS_IDENTIFIER"))) identifier;
-  struct tree_decl_minimal GTY((tag ("TS_DECL_MINIMAL"))) decl_minimal;
-  struct tree_decl_common GTY ((tag ("TS_DECL_COMMON"))) decl_common;
-  struct tree_decl_with_rtl GTY ((tag ("TS_DECL_WRTL"))) decl_with_rtl;
-  struct tree_decl_non_common  GTY ((tag ("TS_DECL_NON_COMMON"))) decl_non_common;
-  struct tree_parm_decl  GTY  ((tag ("TS_PARM_DECL"))) parm_decl;
-  struct tree_decl_with_vis GTY ((tag ("TS_DECL_WITH_VIS"))) decl_with_vis;
-  struct tree_var_decl GTY ((tag ("TS_VAR_DECL"))) var_decl;
-  struct tree_field_decl GTY ((tag ("TS_FIELD_DECL"))) field_decl;
-  struct tree_label_decl GTY ((tag ("TS_LABEL_DECL"))) label_decl;
-  struct tree_result_decl GTY ((tag ("TS_RESULT_DECL"))) result_decl;
-  struct tree_const_decl GTY ((tag ("TS_CONST_DECL"))) const_decl;
-  struct tree_type_decl GTY ((tag ("TS_TYPE_DECL"))) type_decl;
-  struct tree_function_decl GTY ((tag ("TS_FUNCTION_DECL"))) function_decl;
-  struct tree_translation_unit_decl GTY ((tag ("TS_TRANSLATION_UNIT_DECL")))
-    translation_unit_decl;
-  struct tree_type_common GTY ((tag ("TS_TYPE_COMMON"))) type_common;
-  struct tree_type_with_lang_specific GTY ((tag ("TS_TYPE_WITH_LANG_SPECIFIC")))
-    type_with_lang_specific;
-  struct tree_type_non_common GTY ((tag ("TS_TYPE_NON_COMMON")))
-    type_non_common;
-  struct tree_list GTY ((tag ("TS_LIST"))) list;
-  struct tree_vec GTY ((tag ("TS_VEC"))) vec;
-  struct tree_exp GTY ((tag ("TS_EXP"))) exp;
-  struct tree_ssa_name GTY ((tag ("TS_SSA_NAME"))) ssa_name;
-  struct tree_block GTY ((tag ("TS_BLOCK"))) block;
-  struct tree_binfo GTY ((tag ("TS_BINFO"))) binfo;
-  struct tree_statement_list GTY ((tag ("TS_STATEMENT_LIST"))) stmt_list;
-  struct tree_constructor GTY ((tag ("TS_CONSTRUCTOR"))) constructor;
-  struct tree_omp_clause GTY ((tag ("TS_OMP_CLAUSE"))) omp_clause;
-  struct tree_optimization_option GTY ((tag ("TS_OPTIMIZATION"))) optimization;
-  struct tree_target_option GTY ((tag ("TS_TARGET_OPTION"))) target_option;
-};
-
 #if defined ENABLE_TREE_CHECKING && (GCC_VERSION >= 2007)
 
 inline tree
@@ -4221,167 +3070,6 @@ tree_operand_check_code (const_tree __t, enum tree_code __code, int __i,
 
 #endif
 
-\f
-/* Standard named or nameless data types of the C compiler.  */
-
-enum tree_index
-{
-  TI_ERROR_MARK,
-  TI_INTQI_TYPE,
-  TI_INTHI_TYPE,
-  TI_INTSI_TYPE,
-  TI_INTDI_TYPE,
-  TI_INTTI_TYPE,
-
-  TI_UINTQI_TYPE,
-  TI_UINTHI_TYPE,
-  TI_UINTSI_TYPE,
-  TI_UINTDI_TYPE,
-  TI_UINTTI_TYPE,
-
-  TI_UINT16_TYPE,
-  TI_UINT32_TYPE,
-  TI_UINT64_TYPE,
-
-  TI_INTEGER_ZERO,
-  TI_INTEGER_ONE,
-  TI_INTEGER_THREE,
-  TI_INTEGER_MINUS_ONE,
-  TI_NULL_POINTER,
-
-  TI_SIZE_ZERO,
-  TI_SIZE_ONE,
-
-  TI_BITSIZE_ZERO,
-  TI_BITSIZE_ONE,
-  TI_BITSIZE_UNIT,
-
-  TI_PUBLIC,
-  TI_PROTECTED,
-  TI_PRIVATE,
-
-  TI_BOOLEAN_FALSE,
-  TI_BOOLEAN_TRUE,
-
-  TI_COMPLEX_INTEGER_TYPE,
-  TI_COMPLEX_FLOAT_TYPE,
-  TI_COMPLEX_DOUBLE_TYPE,
-  TI_COMPLEX_LONG_DOUBLE_TYPE,
-
-  TI_FLOAT_TYPE,
-  TI_DOUBLE_TYPE,
-  TI_LONG_DOUBLE_TYPE,
-
-  TI_FLOAT_PTR_TYPE,
-  TI_DOUBLE_PTR_TYPE,
-  TI_LONG_DOUBLE_PTR_TYPE,
-  TI_INTEGER_PTR_TYPE,
-
-  TI_VOID_TYPE,
-  TI_PTR_TYPE,
-  TI_CONST_PTR_TYPE,
-  TI_SIZE_TYPE,
-  TI_PID_TYPE,
-  TI_PTRDIFF_TYPE,
-  TI_VA_LIST_TYPE,
-  TI_VA_LIST_GPR_COUNTER_FIELD,
-  TI_VA_LIST_FPR_COUNTER_FIELD,
-  TI_BOOLEAN_TYPE,
-  TI_FILEPTR_TYPE,
-  TI_POINTER_SIZED_TYPE,
-
-  TI_DFLOAT32_TYPE,
-  TI_DFLOAT64_TYPE,
-  TI_DFLOAT128_TYPE,
-  TI_DFLOAT32_PTR_TYPE,
-  TI_DFLOAT64_PTR_TYPE,
-  TI_DFLOAT128_PTR_TYPE,
-
-  TI_VOID_LIST_NODE,
-
-  TI_MAIN_IDENTIFIER,
-
-  TI_SAT_SFRACT_TYPE,
-  TI_SAT_FRACT_TYPE,
-  TI_SAT_LFRACT_TYPE,
-  TI_SAT_LLFRACT_TYPE,
-  TI_SAT_USFRACT_TYPE,
-  TI_SAT_UFRACT_TYPE,
-  TI_SAT_ULFRACT_TYPE,
-  TI_SAT_ULLFRACT_TYPE,
-  TI_SFRACT_TYPE,
-  TI_FRACT_TYPE,
-  TI_LFRACT_TYPE,
-  TI_LLFRACT_TYPE,
-  TI_USFRACT_TYPE,
-  TI_UFRACT_TYPE,
-  TI_ULFRACT_TYPE,
-  TI_ULLFRACT_TYPE,
-  TI_SAT_SACCUM_TYPE,
-  TI_SAT_ACCUM_TYPE,
-  TI_SAT_LACCUM_TYPE,
-  TI_SAT_LLACCUM_TYPE,
-  TI_SAT_USACCUM_TYPE,
-  TI_SAT_UACCUM_TYPE,
-  TI_SAT_ULACCUM_TYPE,
-  TI_SAT_ULLACCUM_TYPE,
-  TI_SACCUM_TYPE,
-  TI_ACCUM_TYPE,
-  TI_LACCUM_TYPE,
-  TI_LLACCUM_TYPE,
-  TI_USACCUM_TYPE,
-  TI_UACCUM_TYPE,
-  TI_ULACCUM_TYPE,
-  TI_ULLACCUM_TYPE,
-  TI_QQ_TYPE,
-  TI_HQ_TYPE,
-  TI_SQ_TYPE,
-  TI_DQ_TYPE,
-  TI_TQ_TYPE,
-  TI_UQQ_TYPE,
-  TI_UHQ_TYPE,
-  TI_USQ_TYPE,
-  TI_UDQ_TYPE,
-  TI_UTQ_TYPE,
-  TI_SAT_QQ_TYPE,
-  TI_SAT_HQ_TYPE,
-  TI_SAT_SQ_TYPE,
-  TI_SAT_DQ_TYPE,
-  TI_SAT_TQ_TYPE,
-  TI_SAT_UQQ_TYPE,
-  TI_SAT_UHQ_TYPE,
-  TI_SAT_USQ_TYPE,
-  TI_SAT_UDQ_TYPE,
-  TI_SAT_UTQ_TYPE,
-  TI_HA_TYPE,
-  TI_SA_TYPE,
-  TI_DA_TYPE,
-  TI_TA_TYPE,
-  TI_UHA_TYPE,
-  TI_USA_TYPE,
-  TI_UDA_TYPE,
-  TI_UTA_TYPE,
-  TI_SAT_HA_TYPE,
-  TI_SAT_SA_TYPE,
-  TI_SAT_DA_TYPE,
-  TI_SAT_TA_TYPE,
-  TI_SAT_UHA_TYPE,
-  TI_SAT_USA_TYPE,
-  TI_SAT_UDA_TYPE,
-  TI_SAT_UTA_TYPE,
-
-  TI_OPTIMIZATION_DEFAULT,
-  TI_OPTIMIZATION_CURRENT,
-  TI_TARGET_OPTION_DEFAULT,
-  TI_TARGET_OPTION_CURRENT,
-  TI_CURRENT_TARGET_PRAGMA,
-  TI_CURRENT_OPTIMIZE_PRAGMA,
-
-  TI_MAX
-};
-
-extern GTY(()) tree global_trees[TI_MAX];
-
 #define error_mark_node			global_trees[TI_ERROR_MARK]
 
 #define intQI_type_node			global_trees[TI_INTQI_TYPE]
@@ -4562,34 +3250,6 @@ extern GTY(()) tree global_trees[TI_MAX];
 #define current_target_pragma		global_trees[TI_CURRENT_TARGET_PRAGMA]
 #define current_optimize_pragma		global_trees[TI_CURRENT_OPTIMIZE_PRAGMA]
 
-/* An enumeration of the standard C integer types.  These must be
-   ordered so that shorter types appear before longer ones, and so
-   that signed types appear before unsigned ones, for the correct
-   functioning of interpret_integer() in c-lex.c.  */
-enum integer_type_kind
-{
-  itk_char,
-  itk_signed_char,
-  itk_unsigned_char,
-  itk_short,
-  itk_unsigned_short,
-  itk_int,
-  itk_unsigned_int,
-  itk_long,
-  itk_unsigned_long,
-  itk_long_long,
-  itk_unsigned_long_long,
-  itk_int128,
-  itk_unsigned_int128,
-  itk_none
-};
-
-typedef enum integer_type_kind integer_type_kind;
-
-/* The standard C integer types.  Use integer_type_kind to index into
-   this array.  */
-extern GTY(()) tree integer_types[itk_none];
-
 #define char_type_node			integer_types[itk_char]
 #define signed_char_type_node		integer_types[itk_signed_char]
 #define unsigned_char_type_node		integer_types[itk_unsigned_char]
@@ -4603,34 +3263,7 @@ extern GTY(()) tree integer_types[itk_none];
 #define long_long_unsigned_type_node	integer_types[itk_unsigned_long_long]
 #define int128_integer_type_node	integer_types[itk_int128]
 #define int128_unsigned_type_node	integer_types[itk_unsigned_int128]
-\f
-/* A pointer-to-function member type looks like:
-
-     struct {
-       __P __pfn;
-       ptrdiff_t __delta;
-     };
 
-   If __pfn is NULL, it is a NULL pointer-to-member-function.
-
-   (Because the vtable is always the first thing in the object, we
-   don't need its offset.)  If the function is virtual, then PFN is
-   one plus twice the index into the vtable; otherwise, it is just a
-   pointer to the function.
-
-   Unfortunately, using the lowest bit of PFN doesn't work in
-   architectures that don't impose alignment requirements on function
-   addresses, or that use the lowest bit to tell one ISA from another,
-   for example.  For such architectures, we use the lowest bit of
-   DELTA instead of the lowest bit of the PFN, and DELTA will be
-   multiplied by 2.  */
-
-enum ptrmemfunc_vbit_where_t
-{
-  ptrmemfunc_vbit_in_pfn,
-  ptrmemfunc_vbit_in_delta
-};
-\f
 #define NULL_TREE (tree) NULL
 
 /* True if NODE is an erroneous expression.  */
@@ -4987,82 +3620,7 @@ extern tree build_type_attribute_qual_variant (tree, tree, int);
    warning to be generated).  */
 extern int comp_type_attributes (const_tree, const_tree);
 
-/* Structure describing an attribute and a function to handle it.  */
-struct attribute_spec
-{
-  /* The name of the attribute (without any leading or trailing __),
-     or NULL to mark the end of a table of attributes.  */
-  const char *name;
-  /* The minimum length of the list of arguments of the attribute.  */
-  int min_length;
-  /* The maximum length of the list of arguments of the attribute
-     (-1 for no maximum).  */
-  int max_length;
-  /* Whether this attribute requires a DECL.  If it does, it will be passed
-     from types of DECLs, function return types and array element types to
-     the DECLs, function types and array types respectively; but when
-     applied to a type in any other circumstances, it will be ignored with
-     a warning.  (If greater control is desired for a given attribute,
-     this should be false, and the flags argument to the handler may be
-     used to gain greater control in that case.)  */
-  bool decl_required;
-  /* Whether this attribute requires a type.  If it does, it will be passed
-     from a DECL to the type of that DECL.  */
-  bool type_required;
-  /* Whether this attribute requires a function (or method) type.  If it does,
-     it will be passed from a function pointer type to the target type,
-     and from a function return type (which is not itself a function
-     pointer type) to the function type.  */
-  bool function_type_required;
-  /* Function to handle this attribute.  NODE points to the node to which
-     the attribute is to be applied.  If a DECL, it should be modified in
-     place; if a TYPE, a copy should be created.  NAME is the name of the
-     attribute (possibly with leading or trailing __).  ARGS is the TREE_LIST
-     of the arguments (which may be NULL).  FLAGS gives further information
-     about the context of the attribute.  Afterwards, the attributes will
-     be added to the DECL_ATTRIBUTES or TYPE_ATTRIBUTES, as appropriate,
-     unless *NO_ADD_ATTRS is set to true (which should be done on error,
-     as well as in any other cases when the attributes should not be added
-     to the DECL or TYPE).  Depending on FLAGS, any attributes to be
-     applied to another type or DECL later may be returned;
-     otherwise the return value should be NULL_TREE.  This pointer may be
-     NULL if no special handling is required beyond the checks implied
-     by the rest of this structure.  */
-  tree (*handler) (tree *node, tree name, tree args,
-		   int flags, bool *no_add_attrs);
-  /* Specifies if attribute affects type's identity.  */
-  bool affects_type_identity;
-};
-
-/* Flags that may be passed in the third argument of decl_attributes, and
-   to handler functions for attributes.  */
-enum attribute_flags
-{
-  /* The type passed in is the type of a DECL, and any attributes that
-     should be passed in again to be applied to the DECL rather than the
-     type should be returned.  */
-  ATTR_FLAG_DECL_NEXT = 1,
-  /* The type passed in is a function return type, and any attributes that
-     should be passed in again to be applied to the function type rather
-     than the return type should be returned.  */
-  ATTR_FLAG_FUNCTION_NEXT = 2,
-  /* The type passed in is an array element type, and any attributes that
-     should be passed in again to be applied to the array type rather
-     than the element type should be returned.  */
-  ATTR_FLAG_ARRAY_NEXT = 4,
-  /* The type passed in is a structure, union or enumeration type being
-     created, and should be modified in place.  */
-  ATTR_FLAG_TYPE_IN_PLACE = 8,
-  /* The attributes are being applied by default to a library function whose
-     name indicates known behavior, and should be silently ignored if they
-     are not in fact compatible with the function type.  */
-  ATTR_FLAG_BUILT_IN = 16,
-  /* A given attribute has been parsed as a C++-11 attribute.  */
-  ATTR_FLAG_CXX11 = 32
-};
-
 /* Default versions of target-overridable functions.  */
-
 extern tree merge_decl_attributes (tree, tree);
 extern tree merge_type_attributes (tree, tree);
 
@@ -5177,41 +3735,6 @@ extern void finish_builtin_struct (tree, const char *,
 
 extern void layout_type (tree);
 
-/* These functions allow a front-end to perform a manual layout of a
-   RECORD_TYPE.  (For instance, if the placement of subsequent fields
-   depends on the placement of fields so far.)  Begin by calling
-   start_record_layout.  Then, call place_field for each of the
-   fields.  Then, call finish_record_layout.  See layout_type for the
-   default way in which these functions are used.  */
-
-typedef struct record_layout_info_s
-{
-  /* The RECORD_TYPE that we are laying out.  */
-  tree t;
-  /* The offset into the record so far, in bytes, not including bits in
-     BITPOS.  */
-  tree offset;
-  /* The last known alignment of SIZE.  */
-  unsigned int offset_align;
-  /* The bit position within the last OFFSET_ALIGN bits, in bits.  */
-  tree bitpos;
-  /* The alignment of the record so far, in bits.  */
-  unsigned int record_align;
-  /* The alignment of the record so far, ignoring #pragma pack and
-     __attribute__ ((packed)), in bits.  */
-  unsigned int unpacked_align;
-  /* The previous field laid out.  */
-  tree prev_field;
-  /* The static variables (i.e., class variables, as opposed to
-     instance variables) encountered in T.  */
-  vec<tree, va_gc> *pending_statics;
-  /* Bits remaining in the current alignment group */
-  int remaining_in_alignment;
-  /* True if we've seen a packed field that didn't have normal
-     alignment anyway.  */
-  int packed_maybe_necessary;
-} *record_layout_info;
-
 extern record_layout_info start_record_layout (tree);
 extern tree bit_from_pos (tree, tree);
 extern tree byte_from_pos (tree, tree);
@@ -5271,20 +3794,6 @@ extern HOST_WIDE_INT int_bit_position (const_tree);
 extern tree byte_position (const_tree);
 extern HOST_WIDE_INT int_byte_position (const_tree);
 
-/* Define data structures, macros, and functions for handling sizes
-   and the various types used to represent sizes.  */
-
-enum size_type_kind
-{
-  stk_sizetype,		/* Normal representation of sizes in bytes.  */
-  stk_ssizetype,	/* Signed representation of sizes in bytes.  */
-  stk_bitsizetype,	/* Normal representation of sizes in bits.  */
-  stk_sbitsizetype,	/* Signed representation of sizes in bits.  */
-  stk_type_kind_last
-};
-
-extern GTY(()) tree sizetype_tab[(int) stk_type_kind_last];
-
 #define sizetype sizetype_tab[(int) stk_sizetype]
 #define bitsizetype sizetype_tab[(int) stk_bitsizetype]
 #define ssizetype sizetype_tab[(int) stk_ssizetype]
@@ -5316,9 +3825,6 @@ extern void finalize_size_functions (void);
    + (BITS_PER_UNIT > 8) + (BITS_PER_UNIT > 16) + (BITS_PER_UNIT > 32) \
    + (BITS_PER_UNIT > 64) + (BITS_PER_UNIT > 128) + (BITS_PER_UNIT > 256))
 
-/* If nonzero, an upper limit on alignment of structure fields, in bits,  */
-extern unsigned int maximum_field_alignment;
-
 /* Concatenate two lists (chains of TREE_LIST nodes) X and Y
    by making the last node in X point to Y.
    Returns X, except if X is 0 returns Y.  */
@@ -5593,25 +4099,6 @@ extern tree decl_type_context (const_tree);
 
 /* Return 1 if EXPR is the real constant zero.  */
 extern int real_zerop (const_tree);
-\f
-/* Declare commonly used variables for tree structure.  */
-
-/* Nonzero means lvalues are limited to those valid in pedantic ANSI C.
-   Zero means allow extended lvalues.  */
-
-extern int pedantic_lvalues;
-
-/* Points to the FUNCTION_DECL of the function whose body we are reading.  */
-
-extern GTY(()) tree current_function_decl;
-
-/* Nonzero means a FUNC_BEGIN label was emitted.  */
-extern GTY(()) const char * current_function_func_begin_label;
-\f
-/* Iterator for going through the function arguments.  */
-typedef struct {
-  tree next;			/* TREE_LIST pointing to the next argument */
-} function_args_iterator;
 
 /* Initialize the iterator I with arguments from function FNDECL  */
 
@@ -5817,14 +4304,6 @@ extern void fold_undefer_overflow_warnings (bool, const_gimple, int);
 extern void fold_undefer_and_ignore_overflow_warnings (void);
 extern bool fold_deferring_overflow_warnings_p (void);
 extern tree fold_fma (location_t, tree, tree, tree, tree);
-
-enum operand_equal_flag
-{
-  OEP_ONLY_CONST = 1,
-  OEP_PURE_SAME = 2,
-  OEP_CONSTANT_ADDRESS_OF = 4
-};
-
 extern int operand_equal_p (const_tree, const_tree, unsigned int);
 extern int multiple_of_p (tree, const_tree, const_tree);
 #define omit_one_operand(T1,T2,T3)\
@@ -6109,70 +4588,10 @@ extern bool debug_find_tree (tree, tree);
 extern tree build_duplicate_type (tree);
 
 /* In calls.c */
-
-/* Nonzero if this is a call to a function whose return value depends
-   solely on its arguments, has no side effects, and does not read
-   global memory.  This corresponds to TREE_READONLY for function
-   decls.  */
-#define ECF_CONST		  (1 << 0)
-/* Nonzero if this is a call to "pure" function (like const function,
-   but may read memory.  This corresponds to DECL_PURE_P for function
-   decls.  */
-#define ECF_PURE		  (1 << 1)
-/* Nonzero if this is ECF_CONST or ECF_PURE but cannot be proven to no
-   infinite loop.  This corresponds to DECL_LOOPING_CONST_OR_PURE_P
-   for function decls.*/
-#define ECF_LOOPING_CONST_OR_PURE (1 << 2)
-/* Nonzero if this call will never return.  */
-#define ECF_NORETURN		  (1 << 3)
-/* Nonzero if this is a call to malloc or a related function.  */
-#define ECF_MALLOC		  (1 << 4)
-/* Nonzero if it is plausible that this is a call to alloca.  */
-#define ECF_MAY_BE_ALLOCA	  (1 << 5)
-/* Nonzero if this is a call to a function that won't throw an exception.  */
-#define ECF_NOTHROW		  (1 << 6)
-/* Nonzero if this is a call to setjmp or a related function.  */
-#define ECF_RETURNS_TWICE	  (1 << 7)
-/* Nonzero if this call replaces the current stack frame.  */
-#define ECF_SIBCALL		  (1 << 8)
-/* Function does not read or write memory (but may have side effects, so
-   it does not necessarily fit ECF_CONST).  */
-#define ECF_NOVOPS		  (1 << 9)
-/* The function does not lead to calls within current function unit.  */
-#define ECF_LEAF		  (1 << 10)
-/* Nonzero if this call does not affect transactions.  */
-#define ECF_TM_PURE		  (1 << 11)
-/* Nonzero if this call is into the transaction runtime library.  */
-#define ECF_TM_BUILTIN		  (1 << 12)
-
 extern int flags_from_decl_or_type (const_tree);
 extern int call_expr_flags (const_tree);
 extern void set_call_expr_flags (tree, int);
 
-/* Call argument flags.  */
-
-/* Nonzero if the argument is not dereferenced recursively, thus only
-   directly reachable memory is read or written.  */
-#define EAF_DIRECT		(1 << 0)
-/* Nonzero if memory reached by the argument is not clobbered.  */
-#define EAF_NOCLOBBER		(1 << 1)
-/* Nonzero if the argument does not escape.  */
-#define EAF_NOESCAPE		(1 << 2)
-/* Nonzero if the argument is not used by the function.  */
-#define EAF_UNUSED		(1 << 3)
-
-/* Call return flags.  */
-
-/* Mask for the argument number that is returned.  Lower two bits of
-   the return flags, encodes argument slots zero to three.  */
-#define ERF_RETURN_ARG_MASK	(3)
-/* Nonzero if the return value is equal to the argument number
-   flags & ERF_RETURN_ARG_MASK.  */
-#define ERF_RETURNS_ARG		(1 << 2)
-/* Nonzero if the return value does not alias with anything.  Functions
-   with the malloc attribute have this set on their return value.  */
-#define ERF_NOALIAS		(1 << 3)
-
 extern int setjmp_call_p (const_tree);
 extern bool gimple_alloca_call_p (const_gimple);
 extern bool alloca_call_p (const_tree);
@@ -6273,19 +4692,6 @@ extern tree tree_overlaps_hard_reg_set (tree, HARD_REG_SET *);
 \f
 /* In tree-inline.c  */
 
-/* The type of a set of already-visited pointers.  Functions for creating
-   and manipulating it are declared in pointer-set.h */
-struct pointer_set_t;
-
-/* The type of a callback function for walking over tree structure.  */
-
-typedef tree (*walk_tree_fn) (tree *, int *, void *);
-
-/* The type of a callback function that represents a custom walk_tree.  */
-
-typedef tree (*walk_tree_lh) (tree *, int *, tree (*) (tree *, int *, void *),
-			      void *, struct pointer_set_t*);
-
 extern tree walk_tree_1 (tree*, walk_tree_fn, void*, struct pointer_set_t*,
 			 walk_tree_lh);
 extern tree walk_tree_without_duplicates_1 (tree*, walk_tree_fn, void*,
@@ -6300,106 +4706,33 @@ extern tree walk_tree_without_duplicates_1 (tree*, walk_tree_fn, void*,
 
 extern void set_decl_rtl (tree, rtx);
 extern void set_decl_incoming_rtl (tree, rtx, bool);
-\f
-/* Enum and arrays used for tree allocation stats.
-   Keep in sync with tree.c:tree_node_kind_names.  */
-typedef enum
-{
-  d_kind,
-  t_kind,
-  b_kind,
-  s_kind,
-  r_kind,
-  e_kind,
-  c_kind,
-  id_kind,
-  vec_kind,
-  binfo_kind,
-  ssa_name_kind,
-  constr_kind,
-  x_kind,
-  lang_decl,
-  lang_type,
-  omp_clause_kind,
-  all_kinds
-} tree_node_kind;
-
-extern int tree_node_counts[];
-extern int tree_node_sizes[];
-
-/* True if we are in gimple form and the actions of the folders need to
-   be restricted.  False if we are not in gimple form and folding is not
-   restricted to creating gimple expressions.  */
-extern bool in_gimple_form;
 
 /* In gimple.c.  */
 extern tree get_base_address (tree t);
 extern void mark_addressable (tree);
 
 /* In tree.c.  */
-
-struct GTY(()) tree_map_base {
-  tree from;
-};
-
 extern int tree_map_base_eq (const void *, const void *);
 extern unsigned int tree_map_base_hash (const void *);
 extern int tree_map_base_marked_p (const void *);
 extern bool list_equal_p (const_tree, const_tree);
 
-/* Map from a tree to another tree.  */
-
-struct GTY(()) tree_map {
-  struct tree_map_base base;
-  unsigned int hash;
-  tree to;
-};
-
 #define tree_map_eq tree_map_base_eq
 extern unsigned int tree_map_hash (const void *);
 #define tree_map_marked_p tree_map_base_marked_p
 
-/* Map from a decl tree to another tree.  */
-
-struct GTY(()) tree_decl_map {
-  struct tree_map_base base;
-  tree to;
-};
-
 #define tree_decl_map_eq tree_map_base_eq
 extern unsigned int tree_decl_map_hash (const void *);
 #define tree_decl_map_marked_p tree_map_base_marked_p
 
-/* Map from a tree to an int.  */
-
-struct GTY(()) tree_int_map {
-  struct tree_map_base base;
-  unsigned int to;
-};
-
 #define tree_int_map_eq tree_map_base_eq
 #define tree_int_map_hash tree_map_base_hash
 #define tree_int_map_marked_p tree_map_base_marked_p
 
-/* Map from a tree to initialization/finalization priorities.  */
-
-struct GTY(()) tree_priority_map {
-  struct tree_map_base base;
-  priority_type init;
-  priority_type fini;
-};
-
 #define tree_priority_map_eq tree_map_base_eq
 #define tree_priority_map_hash tree_map_base_hash
 #define tree_priority_map_marked_p tree_map_base_marked_p
 
-/* Map from a decl tree to a tree vector.  */
-
-struct GTY(()) tree_vec_map {
-  struct tree_map_base base;
-  vec<tree, va_gc> *to;
-};
-
 #define tree_vec_map_eq tree_map_base_eq
 #define tree_vec_map_hash tree_decl_map_hash
 #define tree_vec_map_marked_p tree_map_base_marked_p
@@ -6452,23 +4785,6 @@ is_tm_safe_or_pure (const_tree x)
 
 void init_inline_once (void);
 
-/* Abstract iterators for CALL_EXPRs.  These static inline definitions
-   have to go towards the end of tree.h so that union tree_node is fully
-   defined by this point.  */
-
-/* Structure containing iterator state.  */
-typedef struct call_expr_arg_iterator_d {
-  tree t;	/* the call_expr */
-  int n;	/* argument count */
-  int i;	/* next argument index */
-} call_expr_arg_iterator;
-
-typedef struct const_call_expr_arg_iterator_d {
-  const_tree t;	/* the call_expr */
-  int n;	/* argument count */
-  int i;	/* next argument index */
-} const_call_expr_arg_iterator;
-
 /* Initialize the abstract argument list iterator object ITER with the
    arguments from CALL_EXPR node EXP.  */
 static inline void
@@ -6566,20 +4882,6 @@ extern bool block_may_fallthru (const_tree);
 /* In vtable-verify.c.  */
 extern void save_vtable_map_decl (tree);
 
-\f
-/* Functional interface to the builtin functions.  */
-
-/* The builtin_info structure holds the FUNCTION_DECL of the standard builtin
-   function, and a flag that says if the function is available implicitly, or
-   whether the user has to code explicit calls to __builtin_<xxx>.  */
-
-typedef struct GTY(()) builtin_info_type_d {
-  tree decl[(int)END_BUILTINS];
-  bool implicit_p[(int)END_BUILTINS];
-} builtin_info_type;
-
-extern GTY(()) builtin_info_type builtin_info;
-
 /* Valid builtin number.  */
 #define BUILTIN_VALID_P(FNCODE) \
   (IN_RANGE ((int)FNCODE, ((int)BUILT_IN_NONE) + 1, ((int) END_BUILTINS) - 1))
-- 
1.8.4


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

* Re: RFC - Refactor tree.h
  2013-08-31  2:04           ` Diego Novillo
@ 2013-09-02  9:41             ` Richard Biener
  2013-09-05 12:58               ` RFC - Next refactoring steps Andrew MacLeod
  2013-09-05  0:06             ` RFC - Refactor tree.h Mike Stump
  1 sibling, 1 reply; 39+ messages in thread
From: Richard Biener @ 2013-09-02  9:41 UTC (permalink / raw)
  To: Diego Novillo; +Cc: Andrew MacLeod, Mike Stump, gcc-patches

On Sat, Aug 31, 2013 at 1:22 AM, Diego Novillo <dnovillo@google.com> wrote:
> Thanks for the suggestions.  I've incorporated them into the patch.
> It now adds tree-core.h with all the structures, enums, typedefs and
> some fundamental declarations from tree.h.  Everything else stays in
> tree.h for now.
>
> As we convert gimple files, we'll move declarations out of tree.h into
> other headers and rewrite missing functions in the new gimple API.
>
> This new patch bootstraps and tests fine on x86_64.
>
> OK for trunk?

Looks good to me.

Richard.

> 2013-08-30  Diego Novillo  <dnovillo@google.com>
>
> * Makefile.in (TREE_CORE_H): Define.
> (TREE_H): Use.
> (GTFILES): Add tree-core.h.
> * builtins.c (built_in_class_names): Use BUILT_IN_LAST to
> size the array.
> * tree-core.h: New file.
> Move all data structures, enum, typedefs, global
> declarations and constants from ...
> * tree.h: ... here.
>
>
> Thanks.  Diego.

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

* Re: RFC - Refactor tree.h
  2013-08-31  2:04           ` Diego Novillo
  2013-09-02  9:41             ` Richard Biener
@ 2013-09-05  0:06             ` Mike Stump
  2013-09-05  9:11               ` Richard Biener
  1 sibling, 1 reply; 39+ messages in thread
From: Mike Stump @ 2013-09-05  0:06 UTC (permalink / raw)
  To: Diego Novillo; +Cc: Andrew MacLeod, Richard Biener, gcc-patches

On Aug 30, 2013, at 4:22 PM, Diego Novillo <dnovillo@google.com> wrote:
> Thanks for the suggestions.  I've incorporated them into the patch.
> It now adds tree-core.h with all the structures, enums, typedefs and
> some fundamental declarations from tree.h.  Everything else stays in
> tree.h for now.

So, the comments for the data structures that moved, should also move?!

The below moves one comment that I noticed.

Ok?


Index: tree-core.h
===================================================================
--- tree-core.h	(revision 202238)
+++ tree-core.h	(working copy)
@@ -1328,6 +1328,11 @@ struct GTY(()) tree_decl_non_common {
   tree vindex;
 };
 
+/* FUNCTION_DECL inherits from DECL_NON_COMMON because of the use of the
+   arguments/result/saved_tree fields by front ends.   It was either inherit
+   FUNCTION_DECL from non_common, or inherit non_common from FUNCTION_DECL,
+   which seemed a bit strange.  */
+
 struct GTY(()) tree_function_decl {
   struct tree_decl_non_common common;
 
Index: tree.h
===================================================================
--- tree.h	(revision 202238)
+++ tree.h	(working copy)
@@ -2534,11 +2534,6 @@ extern vec<tree, va_gc> **decl_debug_arg
 #define DECL_FINAL_P(NODE)\
    (FUNCTION_DECL_CHECK (NODE)->decl_with_vis.final)
 
-/* FUNCTION_DECL inherits from DECL_NON_COMMON because of the use of the
-   arguments/result/saved_tree fields by front ends.   It was either inherit
-   FUNCTION_DECL from non_common, or inherit non_common from FUNCTION_DECL,
-   which seemed a bit strange.  */
-
 /* The source language of the translation-unit.  */
 #define TRANSLATION_UNIT_LANGUAGE(NODE) \
   (TRANSLATION_UNIT_DECL_CHECK (NODE)->translation_unit_decl.language)


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

* Re: RFC - Refactor tree.h
  2013-09-05  0:06             ` RFC - Refactor tree.h Mike Stump
@ 2013-09-05  9:11               ` Richard Biener
  2013-09-13 15:15                 ` Jakub Jelinek
  0 siblings, 1 reply; 39+ messages in thread
From: Richard Biener @ 2013-09-05  9:11 UTC (permalink / raw)
  To: Mike Stump; +Cc: Diego Novillo, Andrew MacLeod, gcc-patches

On Thu, Sep 5, 2013 at 2:06 AM, Mike Stump <mikestump@comcast.net> wrote:
> On Aug 30, 2013, at 4:22 PM, Diego Novillo <dnovillo@google.com> wrote:
>> Thanks for the suggestions.  I've incorporated them into the patch.
>> It now adds tree-core.h with all the structures, enums, typedefs and
>> some fundamental declarations from tree.h.  Everything else stays in
>> tree.h for now.
>
> So, the comments for the data structures that moved, should also move?!
>
> The below moves one comment that I noticed.
>
> Ok?

Ok.

Thanks,
Richard.

>
> Index: tree-core.h
> ===================================================================
> --- tree-core.h (revision 202238)
> +++ tree-core.h (working copy)
> @@ -1328,6 +1328,11 @@ struct GTY(()) tree_decl_non_common {
>    tree vindex;
>  };
>
> +/* FUNCTION_DECL inherits from DECL_NON_COMMON because of the use of the
> +   arguments/result/saved_tree fields by front ends.   It was either inherit
> +   FUNCTION_DECL from non_common, or inherit non_common from FUNCTION_DECL,
> +   which seemed a bit strange.  */
> +
>  struct GTY(()) tree_function_decl {
>    struct tree_decl_non_common common;
>
> Index: tree.h
> ===================================================================
> --- tree.h      (revision 202238)
> +++ tree.h      (working copy)
> @@ -2534,11 +2534,6 @@ extern vec<tree, va_gc> **decl_debug_arg
>  #define DECL_FINAL_P(NODE)\
>     (FUNCTION_DECL_CHECK (NODE)->decl_with_vis.final)
>
> -/* FUNCTION_DECL inherits from DECL_NON_COMMON because of the use of the
> -   arguments/result/saved_tree fields by front ends.   It was either inherit
> -   FUNCTION_DECL from non_common, or inherit non_common from FUNCTION_DECL,
> -   which seemed a bit strange.  */
> -
>  /* The source language of the translation-unit.  */
>  #define TRANSLATION_UNIT_LANGUAGE(NODE) \
>    (TRANSLATION_UNIT_DECL_CHECK (NODE)->translation_unit_decl.language)
>
>

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

* RFC - Next refactoring steps
  2013-09-02  9:41             ` Richard Biener
@ 2013-09-05 12:58               ` Andrew MacLeod
  2013-09-05 13:08                 ` Richard Biener
  2013-09-06 13:09                 ` Michael Matz
  0 siblings, 2 replies; 39+ messages in thread
From: Andrew MacLeod @ 2013-09-05 12:58 UTC (permalink / raw)
  To: Richard Biener; +Cc: Diego Novillo, Mike Stump, gcc-patches

Now that tree.h is split in two, there are some follow up things that 
will facilitate the deforestation of gimple.  I've also thrown in a 
couple of structuring issues for good measure.

What are your thoughts on these subjects?


1 -  I think we ought to split out the data structures from gimple.h 
into gimple-core.h, like we did with tree.h

What is left as gimple.[ch] which should really be called 
gimple-stmt.[ch] since it implements just the tcc_statement class of 
trees.  we could do that change now, or I'm ok leaving it like that for 
a while since I can just include gimple-type.h and gimple-decl.h and 
other new files from the top of gimple.h.  That won't  really affect my 
work.  I think it probably ought to be done for clarity eventually.    
gimple.h would then simply become a collector of "gimple-blah.h" files 
which are required for a complete gimple system.

2 - all the uses of TREE_NULL to refer to an empty/nonexistent 
object...  it is no longer in tree-core.h, which I think is correct. 
what should we start using instead in converted files?  options are:
   a)  0
   b) NULL
   c) something we define as 0, like GIMPLE_NULL

I prefer a) I think, since its consistent with things like if (!ptr), 
but b) is fine as well.   I'm not too fond of option c). I figured we'd 
see what others like... maybe something else? :-)

3) remove tree.h from other .h files
   Now that tree.h is split, there are a few .h files which directly 
include tree.h themselves. It would be nice if we could remove the 
implementation requirement of tree.h to ease moving to gimple.h. The 4 
files are :
  ipa-utils.h   lto-streamer.h  streamer-hooks.h  tree-streamer.h
It should be possible to not directly include tree.h itself in these 
files.  Worst case, the header file is included  after tree.h from the 
.C files.. that seems to be the way most of the other include files 
avoid including tree.h directly.


4 - Access to tree checking.
    Since trees are still being used under the covers, we still need to 
be able to do tree_checking...  I dont think we need the tree checking 
macros per se, but I do need access to the same basic checking 
functions.. like tree_check, tree-check2, tree_check_failed, etc.

the basic inline tree_check* set of functions use TREE_CODE, so having 
access to them is no good anyway from a gimple.h file, so I pretty much 
need to rewrite those functions for gimple use, but there are a bunch of 
routines in tree.c that I still need the prototypes for.  Things like 
tree_class_check_failed() and tree_contains_struct_check_failed().  I 
dont see the point ina speerate header file for those, but maybe we 
could put the prototypes in tree-core.h.  I dont think I like that 
either.. but it is an option.

5 - This is more of a meta subject. but is on the radar and relates to 
the tree-checking issue.

There is still some interface stuff from trees that is required by the 
gimple system, and will be as long as trees are used under the covers.  
For example, tree.h defines STRIP_NOPS() which is used in a lot of 
places.   Say we add a strip_nops() method to the GimpleExpression 
class. gimple-expr.h needs to implement that functionality, but can't 
access tree.h.  tree.h defines STRIP_NOPS as
     (EXP) = tree_strip_nop_conversions (CONST_CAST_TREE (EXP))
tree_strip_nop_conversions() is defined in tree.c and the protoype is in 
tree.h.. where it belongs.

So there is no way to access this function call within a file converted 
to gimple. So, we need the prototype somewhere we can get at it and call 
it from strip_nops().

Other examples are the tree build routines. From gimple converted 
files,  we still need to be able to build trees under the covers. The 
interface will  building gimple expressions, but under the covers the 
gimple implementation needs to be able to access those build routines.

One thought I had was to provide a gimple-tree.[ch] files which wrap up 
all these sorts of issues in one place.  The gimple-tree.h file provides 
a gimple-only interface via prototypes to something like:
void gimple_strip_nops (GimpleValue Expr);
GimpleValue gimple_build_expression2 (GimpleCode code, GimpleValue 
Expr1, GimpleValue Expr2);

Then in gimple-tree.c we break the rules.  This one .c file would 
include tree.h so that it has access to all the tree stuff, and provides 
implementations of these functions. This would be the only place that 
tree.h is included in the gimple ecosystem.  It has the drawback of an 
extra layer of functions calls for most things, but maybe thats ok for 
the abstraction

  We could also put all the tree checking stuff here as an option. 
Provide a copy of the tree checking inlines in gimple-tree.h as well as 
the prototypes for the functions in tree.c

At least then all the overlap and ickyness ends up in one place... At 
least as a start

Any other thoughts on how to deal with this sort of thing?

Andrew

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

* Re: RFC - Next refactoring steps
  2013-09-05 12:58               ` RFC - Next refactoring steps Andrew MacLeod
@ 2013-09-05 13:08                 ` Richard Biener
  2013-09-05 13:25                   ` Andrew MacLeod
  2013-09-05 15:47                   ` Andrew MacLeod
  2013-09-06 13:09                 ` Michael Matz
  1 sibling, 2 replies; 39+ messages in thread
From: Richard Biener @ 2013-09-05 13:08 UTC (permalink / raw)
  To: Andrew MacLeod; +Cc: Diego Novillo, Mike Stump, gcc-patches

On Thu, Sep 5, 2013 at 2:57 PM, Andrew MacLeod <amacleod@redhat.com> wrote:
> Now that tree.h is split in two, there are some follow up things that will
> facilitate the deforestation of gimple.  I've also thrown in a couple of
> structuring issues for good measure.
>
> What are your thoughts on these subjects?

Jumping in from the side I suggest you start de-foresting existing headers
where they say

/* In foobar.c */
...

to simply add a foobar.h with the contents that follow.  Bonus points if you
actually verify all definitions from X.c are declaed in X.h (the /* In ... */
annotations are hopelessly out-of-date in some cases).

More bonus points if you avoid pass-xyz.h files but instead move code
useful to multiple passes to more appropriate places.  That said, definitely
avoid pass-xyz.h ;)

Richard.

> 1 -  I think we ought to split out the data structures from gimple.h into
> gimple-core.h, like we did with tree.h
>
> What is left as gimple.[ch] which should really be called gimple-stmt.[ch]
> since it implements just the tcc_statement class of trees.  we could do that
> change now, or I'm ok leaving it like that for a while since I can just
> include gimple-type.h and gimple-decl.h and other new files from the top of
> gimple.h.  That won't  really affect my work.  I think it probably ought to
> be done for clarity eventually.    gimple.h would then simply become a
> collector of "gimple-blah.h" files which are required for a complete gimple
> system.
>
> 2 - all the uses of TREE_NULL to refer to an empty/nonexistent object...  it
> is no longer in tree-core.h, which I think is correct. what should we start
> using instead in converted files?  options are:
>   a)  0
>   b) NULL
>   c) something we define as 0, like GIMPLE_NULL
>
> I prefer a) I think, since its consistent with things like if (!ptr), but b)
> is fine as well.   I'm not too fond of option c). I figured we'd see what
> others like... maybe something else? :-)
>
> 3) remove tree.h from other .h files
>   Now that tree.h is split, there are a few .h files which directly include
> tree.h themselves. It would be nice if we could remove the implementation
> requirement of tree.h to ease moving to gimple.h. The 4 files are :
>  ipa-utils.h   lto-streamer.h  streamer-hooks.h  tree-streamer.h
> It should be possible to not directly include tree.h itself in these files.
> Worst case, the header file is included  after tree.h from the .C files..
> that seems to be the way most of the other include files avoid including
> tree.h directly.
>
>
> 4 - Access to tree checking.
>    Since trees are still being used under the covers, we still need to be
> able to do tree_checking...  I dont think we need the tree checking macros
> per se, but I do need access to the same basic checking functions.. like
> tree_check, tree-check2, tree_check_failed, etc.
>
> the basic inline tree_check* set of functions use TREE_CODE, so having
> access to them is no good anyway from a gimple.h file, so I pretty much need
> to rewrite those functions for gimple use, but there are a bunch of routines
> in tree.c that I still need the prototypes for.  Things like
> tree_class_check_failed() and tree_contains_struct_check_failed().  I dont
> see the point ina speerate header file for those, but maybe we could put the
> prototypes in tree-core.h.  I dont think I like that either.. but it is an
> option.
>
> 5 - This is more of a meta subject. but is on the radar and relates to the
> tree-checking issue.
>
> There is still some interface stuff from trees that is required by the
> gimple system, and will be as long as trees are used under the covers.  For
> example, tree.h defines STRIP_NOPS() which is used in a lot of places.   Say
> we add a strip_nops() method to the GimpleExpression class. gimple-expr.h
> needs to implement that functionality, but can't access tree.h.  tree.h
> defines STRIP_NOPS as
>     (EXP) = tree_strip_nop_conversions (CONST_CAST_TREE (EXP))
> tree_strip_nop_conversions() is defined in tree.c and the protoype is in
> tree.h.. where it belongs.
>
> So there is no way to access this function call within a file converted to
> gimple. So, we need the prototype somewhere we can get at it and call it
> from strip_nops().
>
> Other examples are the tree build routines. From gimple converted files,  we
> still need to be able to build trees under the covers. The interface will
> building gimple expressions, but under the covers the gimple implementation
> needs to be able to access those build routines.
>
> One thought I had was to provide a gimple-tree.[ch] files which wrap up all
> these sorts of issues in one place.  The gimple-tree.h file provides a
> gimple-only interface via prototypes to something like:
> void gimple_strip_nops (GimpleValue Expr);
> GimpleValue gimple_build_expression2 (GimpleCode code, GimpleValue Expr1,
> GimpleValue Expr2);
>
> Then in gimple-tree.c we break the rules.  This one .c file would include
> tree.h so that it has access to all the tree stuff, and provides
> implementations of these functions. This would be the only place that tree.h
> is included in the gimple ecosystem.  It has the drawback of an extra layer
> of functions calls for most things, but maybe thats ok for the abstraction
>
>  We could also put all the tree checking stuff here as an option. Provide a
> copy of the tree checking inlines in gimple-tree.h as well as the prototypes
> for the functions in tree.c
>
> At least then all the overlap and ickyness ends up in one place... At least
> as a start
>
> Any other thoughts on how to deal with this sort of thing?
>
> Andrew

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

* Re: RFC - Next refactoring steps
  2013-09-05 13:08                 ` Richard Biener
@ 2013-09-05 13:25                   ` Andrew MacLeod
  2013-09-05 15:47                   ` Andrew MacLeod
  1 sibling, 0 replies; 39+ messages in thread
From: Andrew MacLeod @ 2013-09-05 13:25 UTC (permalink / raw)
  To: Richard Biener; +Cc: Diego Novillo, Mike Stump, gcc-patches

On 09/05/2013 09:08 AM, Richard Biener wrote:
> On Thu, Sep 5, 2013 at 2:57 PM, Andrew MacLeod <amacleod@redhat.com> wrote:
>> Now that tree.h is split in two, there are some follow up things that will
>> facilitate the deforestation of gimple.  I've also thrown in a couple of
>> structuring issues for good measure.
>>
>> What are your thoughts on these subjects?
> Jumping in from the side I suggest you start de-foresting existing headers
> where they say
>
> /* In foobar.c */
> ...
>
> to simply add a foobar.h with the contents that follow.  Bonus points if you
> actually verify all definitions from X.c are declaed in X.h (the /* In ... */
> annotations are hopelessly out-of-date in some cases).
>
> More bonus points if you avoid pass-xyz.h files but instead move code
> useful to multiple passes to more appropriate places.  That said, definitely
> avoid pass-xyz.h ;)
>
> Richard.
>

Yes, well that's high on the list too, I just hadnt given it a lot of 
thought yet.  Yes, thisbis probably the right thing to do. However, The 
functions in tree.c that I need would then end up in tree.h... which 
isnt good for me :-)     we could have a tree-proto.h for just  this one 
file or something like that.  I dont think tree-core is the right place, 
but...

Anyway, that would resolve the tree-checking and place to put protoypes 
issue just fine.  I'd definitely go for the bonus points :-).   I also 
think a lot of include files are including a lot of crud they dont need 
too... In  glancing at those 4 .h files that include tree.h, they have 
along list of includes, most of which are also included in the .c 
files.  And many of those have #includes they don't need I bet.   I'd 
have alook at that on the way through the file too.


Andrew


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

* Re: RFC - Next refactoring steps
  2013-09-05 13:08                 ` Richard Biener
  2013-09-05 13:25                   ` Andrew MacLeod
@ 2013-09-05 15:47                   ` Andrew MacLeod
  2013-09-05 21:53                     ` Steven Bosscher
  2013-09-06  6:54                     ` Richard Biener
  1 sibling, 2 replies; 39+ messages in thread
From: Andrew MacLeod @ 2013-09-05 15:47 UTC (permalink / raw)
  To: Richard Biener; +Cc: Diego Novillo, Mike Stump, gcc-patches

On 09/05/2013 09:08 AM, Richard Biener wrote:
> On Thu, Sep 5, 2013 at 2:57 PM, Andrew MacLeod <amacleod@redhat.com> wrote:
>> Now that tree.h is split in two, there are some follow up things that will
>> facilitate the deforestation of gimple.  I've also thrown in a couple of
>> structuring issues for good measure.
>>
>> What are your thoughts on these subjects?
> Jumping in from the side I suggest you start de-foresting existing headers
> where they say
>
> /* In foobar.c */
> ...
>
> to simply add a foobar.h with the contents that follow.  Bonus points if you
> actually verify all definitions from X.c are declaed in X.h (the /* In ... */
> annotations are hopelessly out-of-date in some cases).
>
> More bonus points if you avoid pass-xyz.h files but instead move code
> useful to multiple passes to more appropriate places.  That said, definitely
> avoid pass-xyz.h ;)
>
>
ok, so to dwell on header file cleanup.   When creating new header files 
for say, tree-ssa-ter.h,  what other include files should we make 
assumptions have already been included... or should we make none?
For instance, the header files tree-ssa-ter.h would require system.h, 
bitmap.h, tree-ssa-live.h, and gimple.h (soon to be gimple-core.h I hope 
:-) to parse the prototypes

It seems that it should include them all, otherwise we are lying :-).  
And the Makefile should reflect that.

On the other hand, it should never be included in an environment where 
system.h and gimple.h are not already available...  so we could almost 
know those are available... and not have to go out and read those 
include files over again...

Of course, trimming the .c file include list with some intelligence 
would help minimize this, but not completely eliminate it.

I'd say just expose everything properly and try to make the include 
lists better. (ie include tree-ssa-ter.h, but not the files it includes)
Andrew

PS
thats just an example, I don't think we need a tree-ssa-ter.h. There are 
only  3 exported functions. 2 are used exclusively in tree-outof-ssa.c 
and one is used in expr.c  (a reuse of the is_replaceable_p function.)
The 2 that are exclusive to tree-out-ssa.c could simple have the 
prototypes in tree-outof-ssa.c,   That seems like the best thing to do 
for single client's?
The other function could be moved from tree-ssa-ter.c to expr.c, and the 
prototype exported in expr.h and used in tree-ssa-ter.c


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

* Re: RFC - Next refactoring steps
  2013-09-05 15:47                   ` Andrew MacLeod
@ 2013-09-05 21:53                     ` Steven Bosscher
  2013-09-05 22:22                       ` Andrew MacLeod
  2013-09-06  6:50                       ` Richard Biener
  2013-09-06  6:54                     ` Richard Biener
  1 sibling, 2 replies; 39+ messages in thread
From: Steven Bosscher @ 2013-09-05 21:53 UTC (permalink / raw)
  To: Andrew MacLeod; +Cc: Richard Biener, Diego Novillo, Mike Stump, gcc-patches

On Thu, Sep 5, 2013 at 5:47 PM, Andrew MacLeod <amacleod@redhat.com> wrote:
> ok, so to dwell on header file cleanup.   When creating new header files for
> say, tree-ssa-ter.h,  what other include files should we make assumptions
> have already been included... or should we make none?
> For instance, the header files tree-ssa-ter.h would require system.h,
> bitmap.h, tree-ssa-live.h, and gimple.h (soon to be gimple-core.h I hope :-)
> to parse the prototypes

Why bitmap.h? bitmap is in coretypes.h.

Anyway, a little more side-stepping: on my wishlist is making the
various data types (sbitmap, bitmap, sparseset, etc.) independent of
gcc headers as much as possible, and having a single header, gccadt.h
say, that provides most/all generic data structures (e.g. also
including hash tables).


> Of course, trimming the .c file include list with some intelligence would
> help minimize this, but not completely eliminate it.

As you may have noticed, I tried trimming the #include lists in many
.c files last year. It's a hard but worthwhile job: You find some
headers have to be included before others, or some headers are used by
some .c file but they don't #include it. Instead they receive it
through an #include in some .h file but nothing defined directly, i.e.
not via #include, is used in the .c file.


> thats just an example, I don't think we need a tree-ssa-ter.h. There are
> only  3 exported functions. 2 are used exclusively in tree-outof-ssa.c and
> one is used in expr.c  (a reuse of the is_replaceable_p function.)
> The 2 that are exclusive to tree-out-ssa.c could simple have the prototypes
> in tree-outof-ssa.c,   That seems like the best thing to do for single
> client's?

Not really. It's a single client now, but if it's an exported
interface of some kind, then why should its use stay limited to a
single client?

Either some function is exported and therefore should have a prototype
in a .h file, or something is local to a file and no prototype is
necessary (in most cases anyway).


> The other function could be moved from tree-ssa-ter.c to expr.c, and the
> prototype exported in expr.h and used in tree-ssa-ter.c

Makes sense.

Ciao!
Steven

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

* Re: RFC - Next refactoring steps
  2013-09-05 21:53                     ` Steven Bosscher
@ 2013-09-05 22:22                       ` Andrew MacLeod
  2013-09-05 22:39                         ` Steven Bosscher
  2013-09-06  0:26                         ` Joseph S. Myers
  2013-09-06  6:50                       ` Richard Biener
  1 sibling, 2 replies; 39+ messages in thread
From: Andrew MacLeod @ 2013-09-05 22:22 UTC (permalink / raw)
  To: Steven Bosscher; +Cc: Richard Biener, Diego Novillo, Mike Stump, gcc-patches

On 09/05/2013 05:53 PM, Steven Bosscher wrote:
> On Thu, Sep 5, 2013 at 5:47 PM, Andrew MacLeod <amacleod@redhat.com> wrote:
>> ok, so to dwell on header file cleanup.   When creating new header files for
>> say, tree-ssa-ter.h,  what other include files should we make assumptions
>> have already been included... or should we make none?
>> For instance, the header files tree-ssa-ter.h would require system.h,
>> bitmap.h, tree-ssa-live.h, and gimple.h (soon to be gimple-core.h I hope :-)
>> to parse the prototypes
> Why bitmap.h? bitmap is in coretypes.h.

well, only because a function prototype used the bitmap type... I 
suppose you could include coretypes.h, but then you get even more stuff 
included.  I was making the list the "minimal" required to compile the 
header file.

Or are you suggesting that coretypes.h is a file we can assume is 
available?  that seems like a bit of a slippery slope, but we could pick 
a few.  I prefer it be explicit myself.
>
> As you may have noticed, I tried trimming the #include lists in many
> .c files last year. It's a hard but worthwhile job: You find some
> headers have to be included before others, or some headers are used by
> some .c file but they don't #include it. Instead they receive it
> through an #include in some .h file but nothing defined directly, i.e.
> not via #include, is used in the .c file.
>
>
>> thats just an example, I don't think we need a tree-ssa-ter.h. There are
>> only  3 exported functions. 2 are used exclusively in tree-outof-ssa.c and
>> one is used in expr.c  (a reuse of the is_replaceable_p function.)
>> The 2 that are exclusive to tree-out-ssa.c could simple have the prototypes
>> in tree-outof-ssa.c,   That seems like the best thing to do for single
>> client's?
> Not really. It's a single client now, but if it's an exported
> interface of some kind, then why should its use stay limited to a
> single client?
>
> Either some function is exported and therefore should have a prototype
> in a .h file, or something is local to a file and no prototype is
> necessary (in most cases anyway).

Its exported only because the original file was split for modularity 
reasons., otherwise tree-outof-ssa.c would be much larger.  If we had 
such a think as a "module clump", it would only be visible inside that 
clump.

If we go down the path of "its external so it it should be in a header 
file", then we will probably need to have pass-xyz.h header files.. ie, 
I would be creating a tree-ssa-ter.h file to put 2 externals in that are 
only used by tree-outof-ssa.c.  a small sortof useless header file we 
don't actually need.   it is cleaner than in putting it in tree-flow.h 
of course :-)


>
>> The other function could be moved from tree-ssa-ter.c to expr.c, and the
>> prototype exported in expr.h and used in tree-ssa-ter.c
> Makes sense.
>
>
IIf I were to create a tree-ssa-ter.h file, then Id just leave the 
prototype in tree-ssa-ter.h :-)

So fundamentally, we need to make a decision on how we want to handle 
these. Richard seemed to prefer not having pass-xyz.h files if possible, 
and that means in my tree-outrof-ssa case, the single external consumer 
can just keep the prototype local.  If there is more than one consumer, 
it should be in a header.

Or we ban that practice and make a .h file for any .c file which exports 
something....  and try to enforce a rule that prototypes required by a 
.c file comes from an appropriate header file associated with the 
originating source file... so no local prototypes for external functions.

Andrew

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

* Re: RFC - Next refactoring steps
  2013-09-05 22:22                       ` Andrew MacLeod
@ 2013-09-05 22:39                         ` Steven Bosscher
  2013-09-05 23:11                           ` Andrew MacLeod
  2013-09-06  0:26                         ` Joseph S. Myers
  1 sibling, 1 reply; 39+ messages in thread
From: Steven Bosscher @ 2013-09-05 22:39 UTC (permalink / raw)
  To: Andrew MacLeod; +Cc: Richard Biener, Diego Novillo, Mike Stump, gcc-patches

On Fri, Sep 6, 2013 at 12:22 AM, Andrew MacLeod wrote:
> Or are you suggesting that coretypes.h is a file we can assume is available?
> that seems like a bit of a slippery slope, but we could pick a few.  I
> prefer it be explicit myself.

coretypes.h is available. Why do you think that's a slippery slope?
The name of this header file already suggests its purpose: Define the
core types - to *avoid* having to include files like bitmap.h if you
really only want "struct bitmap_head; typedef struct bitmap_head
*bitmap;".

Ciao!
Steven

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

* Re: RFC - Next refactoring steps
  2013-09-05 22:39                         ` Steven Bosscher
@ 2013-09-05 23:11                           ` Andrew MacLeod
  0 siblings, 0 replies; 39+ messages in thread
From: Andrew MacLeod @ 2013-09-05 23:11 UTC (permalink / raw)
  To: Steven Bosscher; +Cc: Richard Biener, Diego Novillo, Mike Stump, gcc-patches

On 09/05/2013 06:38 PM, Steven Bosscher wrote:
> On Fri, Sep 6, 2013 at 12:22 AM, Andrew MacLeod wrote:
>> Or are you suggesting that coretypes.h is a file we can assume is available?
>> that seems like a bit of a slippery slope, but we could pick a few.  I
>> prefer it be explicit myself.
> coretypes.h is available. Why do you think that's a slippery slope?
> The name of this header file already suggests its purpose: Define the
> core types - to *avoid* having to include files like bitmap.h if you
> really only want "struct bitmap_head; typedef struct bitmap_head
> *bitmap;".
>
>
yeah, coretypes.h wouldn't be a slipperly slope...  so in this case it 
would be coretype.h which is included not bitmap.h in the header file

Andrew

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

* Re: RFC - Next refactoring steps
  2013-09-05 22:22                       ` Andrew MacLeod
  2013-09-05 22:39                         ` Steven Bosscher
@ 2013-09-06  0:26                         ` Joseph S. Myers
  2013-09-06 15:24                           ` Andrew MacLeod
  1 sibling, 1 reply; 39+ messages in thread
From: Joseph S. Myers @ 2013-09-06  0:26 UTC (permalink / raw)
  To: Andrew MacLeod
  Cc: Steven Bosscher, Richard Biener, Diego Novillo, Mike Stump, gcc-patches

On Thu, 5 Sep 2013, Andrew MacLeod wrote:

> Or are you suggesting that coretypes.h is a file we can assume is available?

Every .c file should start with includes of config.h, system.h and 
coretypes.h, in that order, so all other headers can assume they have been 
included.

(In principle I think coretypes.h should be split up so that files 
included in the driver don't see at all, even through minimal coretypes.h 
declarations, types such as "tree" that don't make sense in the driver.  
But that probably requires splitting up various other headers, and I don't 
think it's a priority.)

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* Re: RFC - Next refactoring steps
  2013-09-05 21:53                     ` Steven Bosscher
  2013-09-05 22:22                       ` Andrew MacLeod
@ 2013-09-06  6:50                       ` Richard Biener
  1 sibling, 0 replies; 39+ messages in thread
From: Richard Biener @ 2013-09-06  6:50 UTC (permalink / raw)
  To: Steven Bosscher; +Cc: Andrew MacLeod, Diego Novillo, Mike Stump, gcc-patches

On Thu, Sep 5, 2013 at 11:53 PM, Steven Bosscher <stevenb.gcc@gmail.com> wrote:
> On Thu, Sep 5, 2013 at 5:47 PM, Andrew MacLeod <amacleod@redhat.com> wrote:
>> ok, so to dwell on header file cleanup.   When creating new header files for
>> say, tree-ssa-ter.h,  what other include files should we make assumptions
>> have already been included... or should we make none?
>> For instance, the header files tree-ssa-ter.h would require system.h,
>> bitmap.h, tree-ssa-live.h, and gimple.h (soon to be gimple-core.h I hope :-)
>> to parse the prototypes
>
> Why bitmap.h? bitmap is in coretypes.h.
>
> Anyway, a little more side-stepping: on my wishlist is making the
> various data types (sbitmap, bitmap, sparseset, etc.) independent of
> gcc headers as much as possible, and having a single header, gccadt.h
> say, that provides most/all generic data structures (e.g. also
> including hash tables).

Yeah, and we could move all the files into a lib/ subdirectory (well, or
make them part of libiberty).

>> Of course, trimming the .c file include list with some intelligence would
>> help minimize this, but not completely eliminate it.
>
> As you may have noticed, I tried trimming the #include lists in many
> .c files last year. It's a hard but worthwhile job: You find some
> headers have to be included before others, or some headers are used by
> some .c file but they don't #include it. Instead they receive it
> through an #include in some .h file but nothing defined directly, i.e.
> not via #include, is used in the .c file.
>
>
>> thats just an example, I don't think we need a tree-ssa-ter.h. There are
>> only  3 exported functions. 2 are used exclusively in tree-outof-ssa.c and
>> one is used in expr.c  (a reuse of the is_replaceable_p function.)
>> The 2 that are exclusive to tree-out-ssa.c could simple have the prototypes
>> in tree-outof-ssa.c,   That seems like the best thing to do for single
>> client's?
>
> Not really. It's a single client now, but if it's an exported
> interface of some kind, then why should its use stay limited to a
> single client?
>
> Either some function is exported and therefore should have a prototype
> in a .h file, or something is local to a file and no prototype is
> necessary (in most cases anyway).
>
>
>> The other function could be moved from tree-ssa-ter.c to expr.c, and the
>> prototype exported in expr.h and used in tree-ssa-ter.c
>
> Makes sense.
>
> Ciao!
> Steven

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

* Re: RFC - Next refactoring steps
  2013-09-05 15:47                   ` Andrew MacLeod
  2013-09-05 21:53                     ` Steven Bosscher
@ 2013-09-06  6:54                     ` Richard Biener
  2013-09-06  8:15                       ` Mike Stump
  1 sibling, 1 reply; 39+ messages in thread
From: Richard Biener @ 2013-09-06  6:54 UTC (permalink / raw)
  To: Andrew MacLeod; +Cc: Diego Novillo, Mike Stump, gcc-patches

On Thu, Sep 5, 2013 at 5:47 PM, Andrew MacLeod <amacleod@redhat.com> wrote:
> On 09/05/2013 09:08 AM, Richard Biener wrote:
>>
>> On Thu, Sep 5, 2013 at 2:57 PM, Andrew MacLeod <amacleod@redhat.com>
>> wrote:
>>>
>>> Now that tree.h is split in two, there are some follow up things that
>>> will
>>> facilitate the deforestation of gimple.  I've also thrown in a couple of
>>> structuring issues for good measure.
>>>
>>> What are your thoughts on these subjects?
>>
>> Jumping in from the side I suggest you start de-foresting existing headers
>> where they say
>>
>> /* In foobar.c */
>> ...
>>
>> to simply add a foobar.h with the contents that follow.  Bonus points if
>> you
>> actually verify all definitions from X.c are declaed in X.h (the /* In ...
>> */
>> annotations are hopelessly out-of-date in some cases).
>>
>> More bonus points if you avoid pass-xyz.h files but instead move code
>> useful to multiple passes to more appropriate places.  That said,
>> definitely
>> avoid pass-xyz.h ;)
>>
>>
> ok, so to dwell on header file cleanup.   When creating new header files for
> say, tree-ssa-ter.h,  what other include files should we make assumptions
> have already been included... or should we make none?
> For instance, the header files tree-ssa-ter.h would require system.h,
> bitmap.h, tree-ssa-live.h, and gimple.h (soon to be gimple-core.h I hope :-)
> to parse the prototypes

Most of the GCC headerfiles do not include all their required headers but
rely on .c files doing that (in the appropriate order).  I somehow like
that though I cannot explain why ;)  Also grepping for #includes I see
that this doesn't seem to be true anymore.  Certainly the issue is that
we have multi-purpose headers where the subset used by .c files
would not require all header dependencies of that header to be included.
Which of course simply asks for a more functional split of the header.

Richard.

>
> It seems that it should include them all, otherwise we are lying :-).  And
> the Makefile should reflect that.
>
> On the other hand, it should never be included in an environment where
> system.h and gimple.h are not already available...  so we could almost know
> those are available... and not have to go out and read those include files
> over again...
>
> Of course, trimming the .c file include list with some intelligence would
> help minimize this, but not completely eliminate it.
>
> I'd say just expose everything properly and try to make the include lists
> better. (ie include tree-ssa-ter.h, but not the files it includes)
> Andrew
>
> PS
> thats just an example, I don't think we need a tree-ssa-ter.h. There are
> only  3 exported functions. 2 are used exclusively in tree-outof-ssa.c and
> one is used in expr.c  (a reuse of the is_replaceable_p function.)
> The 2 that are exclusive to tree-out-ssa.c could simple have the prototypes
> in tree-outof-ssa.c,   That seems like the best thing to do for single
> client's?
> The other function could be moved from tree-ssa-ter.c to expr.c, and the
> prototype exported in expr.h and used in tree-ssa-ter.c
>
>

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

* Re: RFC - Next refactoring steps
  2013-09-06  6:54                     ` Richard Biener
@ 2013-09-06  8:15                       ` Mike Stump
  2013-09-06  8:19                         ` Richard Biener
  2013-09-06 19:39                         ` Diego Novillo
  0 siblings, 2 replies; 39+ messages in thread
From: Mike Stump @ 2013-09-06  8:15 UTC (permalink / raw)
  To: Richard Biener; +Cc: Andrew MacLeod, Diego Novillo, gcc-patches

On Sep 5, 2013, at 11:54 PM, Richard Biener <richard.guenther@gmail.com> wrote:
> Most of the GCC headerfiles do not include all their required headers but
> rely on .c files doing that (in the appropriate order).  I somehow like
> that though I cannot explain why ;)

Very old school.  I can explain why I don't like it, but I'll resist.  The universal standard is for each header to include all it needs and for the ordering of includes not to matter any.  Deviations from this are the exception and should virtually never should be the case.

> Also grepping for #includes I see that this doesn't seem to be true anymore.

Yeah, everyone else hates the old school style with a passion, it was never a good idea.  :-)  When they come across it, people have a tendency to fix the headers as broken and over time, all the dependencies eventually get added.

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

* Re: RFC - Next refactoring steps
  2013-09-06  8:15                       ` Mike Stump
@ 2013-09-06  8:19                         ` Richard Biener
  2013-09-06 15:22                           ` Andrew MacLeod
  2013-09-06 16:48                           ` Joseph S. Myers
  2013-09-06 19:39                         ` Diego Novillo
  1 sibling, 2 replies; 39+ messages in thread
From: Richard Biener @ 2013-09-06  8:19 UTC (permalink / raw)
  To: Mike Stump; +Cc: Andrew MacLeod, Diego Novillo, gcc-patches

On Fri, Sep 6, 2013 at 10:14 AM, Mike Stump <mikestump@comcast.net> wrote:
> On Sep 5, 2013, at 11:54 PM, Richard Biener <richard.guenther@gmail.com> wrote:
>> Most of the GCC headerfiles do not include all their required headers but
>> rely on .c files doing that (in the appropriate order).  I somehow like
>> that though I cannot explain why ;)
>
> Very old school.  I can explain why I don't like it, but I'll resist.  The universal standard is for each header to include all it needs and for the ordering of includes not to matter any.  Deviations from this are the exception and should virtually never should be the case.
>
>> Also grepping for #includes I see that this doesn't seem to be true anymore.
>
> Yeah, everyone else hates the old school style with a passion, it was never a good idea.  :-)  When they come across it, people have a tendency to fix the headers as broken and over time, all the dependencies eventually get added.

Well, I still think you cannot randomly change include file order in
GCC.  At least some

#ifdef ...

hackery in some headers will suddenly break (that is, change outcome)
if you include for example
tm.h before or after it.

But yes, making all dependencies explicit puts #includes where they
belong and shows where
header refactoring would make sense.  It also removes weird includes
from .c files that are
only necessary to make included required headers not break.

Richard.

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

* Re: RFC - Next refactoring steps
  2013-09-05 12:58               ` RFC - Next refactoring steps Andrew MacLeod
  2013-09-05 13:08                 ` Richard Biener
@ 2013-09-06 13:09                 ` Michael Matz
  2013-09-06 14:42                   ` Andrew MacLeod
  1 sibling, 1 reply; 39+ messages in thread
From: Michael Matz @ 2013-09-06 13:09 UTC (permalink / raw)
  To: Andrew MacLeod; +Cc: Richard Biener, Diego Novillo, Mike Stump, gcc-patches

Hi,

On Thu, 5 Sep 2013, Andrew MacLeod wrote:

> 1 -  I think we ought to split out the data structures from gimple.h into
> gimple-core.h, like we did with tree.h

Why?

> gimple.h.  That won't  really affect my work.  I think it probably ought to be
> done for clarity eventually.    gimple.h would then simply become a collector
> of "gimple-blah.h" files which are required for a complete gimple system.

Doesn't make sense to me.  If you split it into multiple files, just to 
then create a wrapper called gimple.h including all of them again for the 
consumers you can just as well have all of it in one file.

> 2 - all the uses of TREE_NULL to refer to an empty/nonexistent object...  it
> is no longer in tree-core.h, which I think is correct. what should we start
> using instead in converted files?  options are:
>   a)  0
>   b) NULL
>   c) something we define as 0, like GIMPLE_NULL

I think I'd prefer 0, but it creates a problem with varargs functions, so 
you'd always need "(gimple)0" for those, which you'd probably hide behind 
a macro, at which point you'd have two forms for the nil gimple ("0" and 
that macro), for consistency you'd want to use the macro in place of "0" 
also in the non-varargs places, et voila, you're back to "NULL" or 
"NULL_GIMPLE" :-/

> 3) remove tree.h from other .h files
>   Now that tree.h is split, there are a few .h files which directly include
> tree.h themselves. It would be nice if we could remove the implementation
> requirement of tree.h to ease moving to gimple.h. The 4 files are :
>  ipa-utils.h   lto-streamer.h  streamer-hooks.h  tree-streamer.h
> It should be possible to not directly include tree.h itself in these files.
> Worst case, the header file is included  after tree.h from the .C files.. that
> seems to be the way most of the other include files avoid including tree.h
> directly.

That can be done right now I think.

For the rest of the topic, tree vs gimple: I don't see much value in that.  
Why create a gimple_expr type that basically is just tree?  You can as 
well use tree then.


Ciao,
Michael.

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

* Re: RFC - Next refactoring steps
  2013-09-06 13:09                 ` Michael Matz
@ 2013-09-06 14:42                   ` Andrew MacLeod
  0 siblings, 0 replies; 39+ messages in thread
From: Andrew MacLeod @ 2013-09-06 14:42 UTC (permalink / raw)
  To: Michael Matz; +Cc: Richard Biener, Diego Novillo, Mike Stump, gcc-patches

On 09/06/2013 09:09 AM, Michael Matz wrote:
> Hi,
>
> On Thu, 5 Sep 2013, Andrew MacLeod wrote:
>
>> 1 -  I think we ought to split out the data structures from gimple.h into
>> gimple-core.h, like we did with tree.h
> Why?
For the seam reason we split tree.h.  The new gimple mechanism needs to 
coexist with trees until the conversion is complete.  There will be a 
period of time when some files have been converted over to the new 
gimple wrappers, and they will export functions which unconverted files 
still need to call.  The functional prototypes will be using things like 
GimpleType, so those files will need to see the basic class description 
to compile and call the routine. (just like how the gimple function need 
to see the baic layout of a tree to interact with trees)  They don't 
need to see all the implementation for the methods in gimple-type.h, but 
they need to see the basic class description which also contains the few 
routines required to cast back and forth to tree.  This allows both to 
coexist while we transition.

Doing it now before we branch into stage 2 makes life much easier in the 
branch I will be working on during stage2, as well as test the 
functionality of it with the rest of the refactoring we are doing before 
the branch.


>> gimple.h.  That won't  really affect my work.  I think it probably ought to be
>> done for clarity eventually.    gimple.h would then simply become a collector
>> of "gimple-blah.h" files which are required for a complete gimple system.
> Doesn't make sense to me.  If you split it into multiple files, just to
> then create a wrapper called gimple.h including all of them again for the
> consumers you can just as well have all of it in one file.
Well, gimple.h right now is 5400 lines, and that just implements gimple 
statements.  when we add the methods for types and decls and expression 
etc etc etc, its going to be a very very very large file.   The split is 
to make it managable.  Im fine with leaving gimple.h to be the statement 
implementation, and then the top of gimple.h can just include all the 
other ones... it just means gimple-stmt is gimple...   Its just a 
consistency naming thing, and i don't feel strongly about it.
>> 2 - all the uses of TREE_NULL to refer to an empty/nonexistent object...  it
>> is no longer in tree-core.h, which I think is correct. what should we start
>> using instead in converted files?  options are:
>>    a)  0
>>    b) NULL
>>    c) something we define as 0, like GIMPLE_NULL
> I think I'd prefer 0, but it creates a problem with varargs functions, so
> you'd always need "(gimple)0" for those, which you'd probably hide behind
> a macro, at which point you'd have two forms for the nil gimple ("0" and
> that macro), for consistency you'd want to use the macro in place of "0"
> also in the non-varargs places, et voila, you're back to "NULL" or
> "NULL_GIMPLE" :-/
I prefer 0 too I think, but I had forgotten about vararg issues... so 
are we thinking maybe just plain old NULL?  I guess thats pretty standard..
>
>> 3) remove tree.h from other .h files
>>    Now that tree.h is split, there are a few .h files which directly include
>> tree.h themselves. It would be nice if we could remove the implementation
>> requirement of tree.h to ease moving to gimple.h. The 4 files are :
>>   ipa-utils.h   lto-streamer.h  streamer-hooks.h  tree-streamer.h
>> It should be possible to not directly include tree.h itself in these files.
>> Worst case, the header file is included  after tree.h from the .C files.. that
>> seems to be the way most of the other include files avoid including tree.h
>> directly.
> That can be done right now I think.
>
> For the rest of the topic, tree vs gimple: I don't see much value in that.
> Why create a gimple_expr type that basically is just tree?  You can as
> well use tree then.
>
Because once its all done... we can do many other things because the 
uses are detached from the implementation.  In a gimple expression we 
can see concisely what elements of tree are actually used, and how. We 
can then remove tree from the implementation of gimple_expr if it makes 
sense. We can change the underlying object from a tree to something 
which more concisely represents what we need in the middle/back end.  We 
can easily change the implementation of gimpe-expr to use an index into 
a table of expressions which makes streaming much simpler.. I am also 
doing this for types and decls and such. We get typesafe checking at 
compile time, And the ultimate goal is to remove dependencies from the 
front end and the gimple... gimple will be detachable from trees.  All 
the fun stuff I talked about in the original document motivating this.

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

* Re: RFC - Next refactoring steps
  2013-09-06  8:19                         ` Richard Biener
@ 2013-09-06 15:22                           ` Andrew MacLeod
  2013-09-06 16:51                             ` Steven Bosscher
  2013-09-06 17:09                             ` Mike Stump
  2013-09-06 16:48                           ` Joseph S. Myers
  1 sibling, 2 replies; 39+ messages in thread
From: Andrew MacLeod @ 2013-09-06 15:22 UTC (permalink / raw)
  To: Richard Biener; +Cc: Mike Stump, Diego Novillo, gcc-patches

On 09/06/2013 04:19 AM, Richard Biener wrote:
> On Fri, Sep 6, 2013 at 10:14 AM, Mike Stump <mikestump@comcast.net> wrote:
>> On Sep 5, 2013, at 11:54 PM, Richard Biener <richard.guenther@gmail.com> wrote:
>>> Most of the GCC headerfiles do not include all their required headers but
>>> rely on .c files doing that (in the appropriate order).  I somehow like
>>> that though I cannot explain why ;)
>> Very old school.  I can explain why I don't like it, but I'll resist.  The universal standard is for each header to include all it needs and for the ordering of includes not to matter any.  Deviations from this are the exception and should virtually never should be the case.
>>
>>> Also grepping for #includes I see that this doesn't seem to be true anymore.
>> Yeah, everyone else hates the old school style with a passion, it was never a good idea.  :-)  When they come across it, people have a tendency to fix the headers as broken and over time, all the dependencies eventually get added.
> Well, I still think you cannot randomly change include file order in
> GCC.  At least some
>
> #ifdef ...
>
> hackery in some headers will suddenly break (that is, change outcome)
> if you include for example
> tm.h before or after it.
>
these would be really good to identify and fix, if possible. (surely 
they can be fixed.. :-)    if they cant be fixed for whatever reason, we 
ought to protect them with some mechanism.. ie assert that tm.h either 
has or has not been included before hand... whichever way is required.   
At least then we get an error if it changes.

Do you know of any of the top of your head?

Andrew

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

* Re: RFC - Next refactoring steps
  2013-09-06  0:26                         ` Joseph S. Myers
@ 2013-09-06 15:24                           ` Andrew MacLeod
  0 siblings, 0 replies; 39+ messages in thread
From: Andrew MacLeod @ 2013-09-06 15:24 UTC (permalink / raw)
  To: Joseph S. Myers
  Cc: Steven Bosscher, Richard Biener, Diego Novillo, Mike Stump, gcc-patches

On 09/05/2013 08:26 PM, Joseph S. Myers wrote:
> On Thu, 5 Sep 2013, Andrew MacLeod wrote:
>
>> Or are you suggesting that coretypes.h is a file we can assume is available?
> Every .c file should start with includes of config.h, system.h and
> coretypes.h, in that order, so all other headers can assume they have been
> included.
>
>
OK, I can work with those assumptions :-).

Andrew

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

* Re: RFC - Next refactoring steps
  2013-09-06  8:19                         ` Richard Biener
  2013-09-06 15:22                           ` Andrew MacLeod
@ 2013-09-06 16:48                           ` Joseph S. Myers
  1 sibling, 0 replies; 39+ messages in thread
From: Joseph S. Myers @ 2013-09-06 16:48 UTC (permalink / raw)
  To: Richard Biener; +Cc: Mike Stump, Andrew MacLeod, Diego Novillo, gcc-patches

On Fri, 6 Sep 2013, Richard Biener wrote:

> But yes, making all dependencies explicit puts #includes where they 
> belong and shows where header refactoring would make sense.  It also 
> removes weird includes from .c files that are only necessary to make 
> included required headers not break.

One difficulty is that e.g. flags.h uses SWITCHABLE_TARGET (tm.h) but is 
included in lots of front-end files that don't actually care about the 
SWITCHABLE_TARGET use in flags.h and have no other reason to include tm.h.  
Since we generally want to eliminate tm.h uses in front-end files 
(converting target macros used there into hooks, etc.), making the 
"dependency" explicit in the obvious way isn't such a good idea.  
Instead, probably the bits that don't depend on SWITCHABLE_TARGET should 
move out of flags.h to other headers, the residual bit that does depend on 
tm.h should become e.g. switchable-target-flags.h (and include tm.h), and 
files that currently include flags.h should change to including the 
generated options.h (and any other headers needed for things formerly got 
from flags.h).

(If other headers do start including tm.h, of course it becomes more 
complicated to identify which front-end files are still including tm.h, as 
they may include it indirectly.)

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* Re: RFC - Next refactoring steps
  2013-09-06 15:22                           ` Andrew MacLeod
@ 2013-09-06 16:51                             ` Steven Bosscher
  2013-09-06 17:09                             ` Mike Stump
  1 sibling, 0 replies; 39+ messages in thread
From: Steven Bosscher @ 2013-09-06 16:51 UTC (permalink / raw)
  To: Andrew MacLeod; +Cc: Richard Biener, Mike Stump, Diego Novillo, gcc-patches

On Fri, Sep 6, 2013 at 5:21 PM, Andrew MacLeod wrote:

>> hackery in some headers will suddenly break (that is, change outcome)
>> if you include for example
>> tm.h before or after it.
>>
> these would be really good to identify and fix, if possible. (surely they
> can be fixed.. :-)    if they cant be fixed for whatever reason, we ought to
> protect them with some mechanism.. ie assert that tm.h either has or has not
> been included before hand... whichever way is required.   At least then we
> get an error if it changes.
>
> Do you know of any of the top of your head?


sched-int.h comes to mind as an example I fixed recently (it needs
INSN_SCHEDULING from insn-attr.h.

But these cases are hard to discover. Usually you simply run into them
while trying to re-arrange the #includes of a .c file.

Ciao!
Steven

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

* Re: RFC - Next refactoring steps
  2013-09-06 15:22                           ` Andrew MacLeod
  2013-09-06 16:51                             ` Steven Bosscher
@ 2013-09-06 17:09                             ` Mike Stump
  1 sibling, 0 replies; 39+ messages in thread
From: Mike Stump @ 2013-09-06 17:09 UTC (permalink / raw)
  To: Andrew MacLeod; +Cc: Richard Biener, Diego Novillo, gcc-patches

On Sep 6, 2013, at 8:21 AM, Andrew MacLeod <amacleod@redhat.com> wrote:
> these would be really good to identify and fix, if possible.

> Do you know of any of the top of your head?

Sure, they are easy to find.  See below.  I'll note one more use of fixing these.  clang is adding modules to get compilation speed.  Modules require that the inclusion of a header be the same in every instance that it is used.  The usages below would prevent these headers from participating in being a module (and transitive closure of all they include them), thus dooming the software to slow compiles.  C++ features exponential compile time, where/as C features logarithmic compile time.  modules return things back to being linear and are worthwhile to control compilation speed issues.  To be competitive, I think gcc will have to add modules eventually as well, and as the gcc source base grows, making use of modules to keep compilation time down is also worthwhile. 


dfp.h:
#ifdef TREE_CODE
bool decimal_real_arithmetic (REAL_VALUE_TYPE *, enum tree_code, const REAL_VALUE_TYPE *,
                              const REAL_VALUE_TYPE *);
#endif

double-int.h:
#ifndef GENERATOR_FILE
/* Conversion to and from GMP integer representations.  */

void mpz_set_double_int (mpz_t, double_int, bool);
double_int mpz_get_double_int (const_tree, mpz_t, bool);
#endif

expr.h:
#ifdef TREE_CODE
extern rtx expand_variable_shift (enum tree_code, enum machine_mode,
                                  rtx, tree, rtx, int);
extern rtx expand_shift (enum tree_code, enum machine_mode, rtx, int, rtx,
                             int);
extern rtx expand_divmod (int, enum tree_code, enum machine_mode, rtx, rtx,
                          rtx, int);
#endif

function.h:
#ifdef RTX_CODE
extern void diddle_return_value (void (*)(rtx, void*), void*);
extern void clobber_return_register (void);
#endif

target.h:
#ifdef GCC_TM_H

#ifndef CUMULATIVE_ARGS_MAGIC
#define CUMULATIVE_ARGS_MAGIC ((void *) &targetm.calls)
#endif

static inline CUMULATIVE_ARGS *
get_cumulative_args (cumulative_args_t arg)
{
#ifdef ENABLE_CHECKING
  gcc_assert (arg.magic == CUMULATIVE_ARGS_MAGIC);
#endif /* ENABLE_CHECKING */
  return (CUMULATIVE_ARGS *) arg.p;
}


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

* Re: RFC - Next refactoring steps
  2013-09-06  8:15                       ` Mike Stump
  2013-09-06  8:19                         ` Richard Biener
@ 2013-09-06 19:39                         ` Diego Novillo
  1 sibling, 0 replies; 39+ messages in thread
From: Diego Novillo @ 2013-09-06 19:39 UTC (permalink / raw)
  To: Mike Stump; +Cc: Richard Biener, Andrew MacLeod, gcc-patches

On Fri, Sep 6, 2013 at 4:14 AM, Mike Stump <mikestump@comcast.net> wrote:
> On Sep 5, 2013, at 11:54 PM, Richard Biener <richard.guenther@gmail.com> wrote:
>> Most of the GCC headerfiles do not include all their required headers but
>> rely on .c files doing that (in the appropriate order).  I somehow like
>> that though I cannot explain why ;)
>
> Very old school.  I can explain why I don't like it, but I'll resist.  The universal standard is for each header to include all it needs and for the ordering of includes not to matter any.  Deviations from this are the exception and should virtually never should be the case.

Agreed. Header files should be self-contained and include everything
they need. This will be increasingly more important in the presence of
C++ modules.


Diego.

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

* Re: RFC - Refactor tree.h
  2013-09-05  9:11               ` Richard Biener
@ 2013-09-13 15:15                 ` Jakub Jelinek
  2013-09-13 15:26                   ` Andrew MacLeod
  2013-09-13 15:33                   ` Diego Novillo
  0 siblings, 2 replies; 39+ messages in thread
From: Jakub Jelinek @ 2013-09-13 15:15 UTC (permalink / raw)
  To: Andrew MacLeod; +Cc: gcc-patches

On Thu, Sep 05, 2013 at 11:11:43AM +0200, Richard Biener wrote:
> On Thu, Sep 5, 2013 at 2:06 AM, Mike Stump <mikestump@comcast.net> wrote:
> > On Aug 30, 2013, at 4:22 PM, Diego Novillo <dnovillo@google.com> wrote:
> >> Thanks for the suggestions.  I've incorporated them into the patch.
> >> It now adds tree-core.h with all the structures, enums, typedefs and
> >> some fundamental declarations from tree.h.  Everything else stays in
> >> tree.h for now.
> >
> > So, the comments for the data structures that moved, should also move?!
> >
> > The below moves one comment that I noticed.
> >
> > Ok?
> 
> Ok.

Please, whenever making such big changes, double check that you have
incorporated all the changes that went in since you've started on the
refactoring, otherwise we lose important changes.
E.g. today I've noticed you've lost OMP_CLAUSE_LINEAR_NO_COPYIN
comment that has been added to tree.h recently, but you haven't
actually moved it into tree-core.h.
Makes me wonder how many other changes got lost.

	Jakub

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

* Re: RFC - Refactor tree.h
  2013-09-13 15:15                 ` Jakub Jelinek
@ 2013-09-13 15:26                   ` Andrew MacLeod
  2013-09-13 15:33                   ` Diego Novillo
  1 sibling, 0 replies; 39+ messages in thread
From: Andrew MacLeod @ 2013-09-13 15:26 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: gcc-patches, Diego Novillo


Rap Diego's knuckles for that :-)   Bad Diego.

Andrew

On 09/13/2013 11:07 AM, Jakub Jelinek wrote:
> On Thu, Sep 05, 2013 at 11:11:43AM +0200, Richard Biener wrote:
>> On Thu, Sep 5, 2013 at 2:06 AM, Mike Stump <mikestump@comcast.net> wrote:
>>> On Aug 30, 2013, at 4:22 PM, Diego Novillo <dnovillo@google.com> wrote:
>>>> Thanks for the suggestions.  I've incorporated them into the patch.
>>>> It now adds tree-core.h with all the structures, enums, typedefs and
>>>> some fundamental declarations from tree.h.  Everything else stays in
>>>> tree.h for now.
>>> So, the comments for the data structures that moved, should also move?!
>>>
>>> The below moves one comment that I noticed.
>>>
>>> Ok?
>> Ok.
> Please, whenever making such big changes, double check that you have
> incorporated all the changes that went in since you've started on the
> refactoring, otherwise we lose important changes.
> E.g. today I've noticed you've lost OMP_CLAUSE_LINEAR_NO_COPYIN
> comment that has been added to tree.h recently, but you haven't
> actually moved it into tree-core.h.
> Makes me wonder how many other changes got lost.
>
> 	Jakub

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

* Re: RFC - Refactor tree.h
  2013-09-13 15:15                 ` Jakub Jelinek
  2013-09-13 15:26                   ` Andrew MacLeod
@ 2013-09-13 15:33                   ` Diego Novillo
  2013-09-16 14:13                     ` Diego Novillo
  1 sibling, 1 reply; 39+ messages in thread
From: Diego Novillo @ 2013-09-13 15:33 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Andrew MacLeod, gcc-patches

On Fri, Sep 13, 2013 at 11:07 AM, Jakub Jelinek <jakub@redhat.com> wrote:

> E.g. today I've noticed you've lost OMP_CLAUSE_LINEAR_NO_COPYIN
> comment that has been added to tree.h recently, but you haven't
> actually moved it into tree-core.h.

Sorry about that.  I remember an update conflict, but I thought I had
incorporated it all.  I will double check and fix.


Diego.

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

* Re: RFC - Refactor tree.h
  2013-09-13 15:33                   ` Diego Novillo
@ 2013-09-16 14:13                     ` Diego Novillo
  2013-09-16 14:20                       ` Jakub Jelinek
  0 siblings, 1 reply; 39+ messages in thread
From: Diego Novillo @ 2013-09-16 14:13 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Andrew MacLeod, gcc-patches

On Fri, Sep 13, 2013 at 11:25 AM, Diego Novillo <dnovillo@google.com> wrote:
> On Fri, Sep 13, 2013 at 11:07 AM, Jakub Jelinek <jakub@redhat.com> wrote:
>
>> E.g. today I've noticed you've lost OMP_CLAUSE_LINEAR_NO_COPYIN
>> comment that has been added to tree.h recently, but you haven't
>> actually moved it into tree-core.h.
>
> Sorry about that.  I remember an update conflict, but I thought I had
> incorporated it all.  I will double check and fix.


Done.

 gcc/ChangeLog   |  5 +++++
 gcc/tree-core.h | 19 +++++++++++++++++--
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b9a335a..906d01b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2013-09-16  Diego Novillo  <dnovillo@google.com>
+
+       * tree-core.h: Add missing comment lines from refactoring
+       of tree.h.
+
 2013-09-16  Jan Hubicka  <jh@suse.cz>

        * gimple-fold.c (can_refer_decl_in_current_unit_p): Do not accept
diff --git a/gcc/tree-core.h b/gcc/tree-core.h
index b1bc56a..69777dc 100644
--- a/gcc/tree-core.h
+++ b/gcc/tree-core.h
@@ -780,6 +780,9 @@ struct GTY(()) tree_base {
        OMP_CLAUSE_PRIVATE_DEBUG in
            OMP_CLAUSE_PRIVATE

+       OMP_CLAUSE_LINEAR_NO_COPYIN in
+          OMP_CLAUSE_LINEAR
+
        TRANSACTION_EXPR_RELAXED in
           TRANSACTION_EXPR

@@ -800,6 +803,9 @@ struct GTY(()) tree_base {
        OMP_CLAUSE_PRIVATE_OUTER_REF in
           OMP_CLAUSE_PRIVATE

+       OMP_CLAUSE_LINEAR_NO_COPYOUT in
+          OMP_CLAUSE_LINEAR
+
        TYPE_REF_IS_RVALUE in
           REFERENCE_TYPE

@@ -935,6 +941,9 @@ struct GTY(()) tree_base {

        DECL_NONLOCAL_FRAME in
           VAR_DECL
+
+       TYPE_FINAL_P in
+          RECORD_TYPE, UNION_TYPE and QUAL_UNION_TYPE
 */

 struct GTY(()) tree_typed {
@@ -1197,8 +1206,7 @@ struct GTY(()) tree_decl_common {
   unsigned lang_flag_7 : 1;
   unsigned lang_flag_8 : 1;

-  /* In LABEL_DECL, this is DECL_ERROR_ISSUED.
-     In VAR_DECL and PARM_DECL, this is DECL_REGISTER.  */
+  /* In VAR_DECL and PARM_DECL, this is DECL_REGISTER.  */
   unsigned decl_flag_0 : 1;
   /* In FIELD_DECL, this is DECL_BIT_FIELD
      In VAR_DECL and FUNCTION_DECL, this is DECL_EXTERNAL.
@@ -1403,6 +1411,9 @@ struct GTY(()) tree_statement_list
   struct tree_statement_list_node *tail;
 };

+
+/* Optimization options used by a function.  */
+
 struct GTY(()) tree_optimization_option {
   struct tree_common common;

@@ -1418,6 +1429,8 @@ struct GTY(()) tree_optimization_option {
   struct target_optabs *GTY ((skip)) base_optabs;
 };

+/* Target options used by a function.  */
+
 struct GTY(()) tree_target_option {
   struct tree_common common;

@@ -1563,6 +1576,8 @@ struct GTY(()) tree_map_base {
   tree from;
 };

+/* Map from a tree to another tree.  */
+
 struct GTY(()) tree_map {
   struct tree_map_base base;
   unsigned int hash;
--
1.8.4

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

* Re: RFC - Refactor tree.h
  2013-09-16 14:13                     ` Diego Novillo
@ 2013-09-16 14:20                       ` Jakub Jelinek
  0 siblings, 0 replies; 39+ messages in thread
From: Jakub Jelinek @ 2013-09-16 14:20 UTC (permalink / raw)
  To: Diego Novillo; +Cc: Andrew MacLeod, gcc-patches

On Mon, Sep 16, 2013 at 09:39:27AM -0400, Diego Novillo wrote:
> On Fri, Sep 13, 2013 at 11:25 AM, Diego Novillo <dnovillo@google.com> wrote:
> > On Fri, Sep 13, 2013 at 11:07 AM, Jakub Jelinek <jakub@redhat.com> wrote:
> >
> >> E.g. today I've noticed you've lost OMP_CLAUSE_LINEAR_NO_COPYIN
> >> comment that has been added to tree.h recently, but you haven't
> >> actually moved it into tree-core.h.
> >
> > Sorry about that.  I remember an update conflict, but I thought I had
> > incorporated it all.  I will double check and fix.
> 
> 
> Done.

Thanks.

	Jakub

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

end of thread, other threads:[~2013-09-16 13:42 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-09 22:36 RFC - Refactor tree.h Diego Novillo
2013-08-10  0:17 ` Mike Stump
2013-08-10 10:02   ` Richard Biener
2013-08-10 19:03     ` Mike Stump
2013-08-11  7:59       ` Richard Biener
2013-08-12 20:36         ` Mike Stump
2013-08-21 17:31     ` Andrew MacLeod
2013-08-21 21:47       ` Mike Stump
2013-08-22 14:06         ` Andrew MacLeod
2013-08-31  2:04           ` Diego Novillo
2013-09-02  9:41             ` Richard Biener
2013-09-05 12:58               ` RFC - Next refactoring steps Andrew MacLeod
2013-09-05 13:08                 ` Richard Biener
2013-09-05 13:25                   ` Andrew MacLeod
2013-09-05 15:47                   ` Andrew MacLeod
2013-09-05 21:53                     ` Steven Bosscher
2013-09-05 22:22                       ` Andrew MacLeod
2013-09-05 22:39                         ` Steven Bosscher
2013-09-05 23:11                           ` Andrew MacLeod
2013-09-06  0:26                         ` Joseph S. Myers
2013-09-06 15:24                           ` Andrew MacLeod
2013-09-06  6:50                       ` Richard Biener
2013-09-06  6:54                     ` Richard Biener
2013-09-06  8:15                       ` Mike Stump
2013-09-06  8:19                         ` Richard Biener
2013-09-06 15:22                           ` Andrew MacLeod
2013-09-06 16:51                             ` Steven Bosscher
2013-09-06 17:09                             ` Mike Stump
2013-09-06 16:48                           ` Joseph S. Myers
2013-09-06 19:39                         ` Diego Novillo
2013-09-06 13:09                 ` Michael Matz
2013-09-06 14:42                   ` Andrew MacLeod
2013-09-05  0:06             ` RFC - Refactor tree.h Mike Stump
2013-09-05  9:11               ` Richard Biener
2013-09-13 15:15                 ` Jakub Jelinek
2013-09-13 15:26                   ` Andrew MacLeod
2013-09-13 15:33                   ` Diego Novillo
2013-09-16 14:13                     ` Diego Novillo
2013-09-16 14:20                       ` Jakub Jelinek

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