aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2017-08-08 06:46:51 +0200
committerMartin Liska <marxin@gcc.gnu.org>2017-08-08 04:46:51 +0000
commit314e6352040016aff26cc2cf0b9eb60c40ca859e (patch)
tree1c03471917bb6c90a9fca32e2ce7b5b594f9421d /gcc
parent082adc1e43fa073a9f7f5ab3bdaa2713a1cc2cdc (diff)
downloadgcc-314e6352040016aff26cc2cf0b9eb60c40ca859e.zip
gcc-314e6352040016aff26cc2cf0b9eb60c40ca859e.tar.gz
gcc-314e6352040016aff26cc2cf0b9eb60c40ca859e.tar.bz2
trans.c: Include header files.
. 2017-08-08 Martin Liska <mliska@suse.cz> * gcc-interface/trans.c: Include header files. 2017-08-08 Martin Liska <mliska@suse.cz> * objc-gnu-runtime-abi-01.c: Include header files. * objc-next-runtime-abi-01.c: Likewise. * objc-next-runtime-abi-02.c: Likewise. 2017-08-08 Martin Liska <mliska@suse.cz> * asan.c: Include header files. * attribs.c (build_decl_attribute_variant): New function moved from tree.[ch]. (build_type_attribute_qual_variant): Likewise. (cmp_attrib_identifiers): Likewise. (simple_cst_list_equal): Likewise. (omp_declare_simd_clauses_equal): Likewise. (attribute_value_equal): Likewise. (comp_type_attributes): Likewise. (build_type_attribute_variant): Likewise. (lookup_ident_attribute): Likewise. (remove_attribute): Likewise. (merge_attributes): Likewise. (merge_type_attributes): Likewise. (merge_decl_attributes): Likewise. (merge_dllimport_decl_attributes): Likewise. (handle_dll_attribute): Likewise. (attribute_list_equal): Likewise. (attribute_list_contained): Likewise. * attribs.h (lookup_attribute): New function moved from tree.[ch]. (lookup_attribute_by_prefix): Likewise. * bb-reorder.c: Include header files. * builtins.c: Likewise. * calls.c: Likewise. * cfgexpand.c: Likewise. * cgraph.c: Likewise. * cgraphunit.c: Likewise. * convert.c: Likewise. * dwarf2out.c: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * gimple-expr.c: Likewise. * gimple-fold.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimplify.c: Likewise. * hsa-common.c: Likewise. * hsa-gen.c: Likewise. * internal-fn.c: Likewise. * ipa-chkp.c: Likewise. * ipa-cp.c: Likewise. * ipa-devirt.c: Likewise. * ipa-fnsummary.c: Likewise. * ipa-inline.c: Likewise. * ipa-visibility.c: Likewise. * ipa.c: Likewise. * lto-cgraph.c: Likewise. * omp-expand.c: Likewise. * omp-general.c: Likewise. * omp-low.c: Likewise. * omp-offload.c: Likewise. * omp-simd-clone.c: Likewise. * opts-global.c: Likewise. * passes.c: Likewise. * predict.c: Likewise. * sancov.c: Likewise. * sanopt.c: Likewise. * symtab.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-chkp.c: Likewise. * tree-eh.c: Likewise. * tree-into-ssa.c: Likewise. * tree-object-size.c: Likewise. * tree-parloops.c: Likewise. * tree-profile.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa.c: Likewise. * tree-streamer-in.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vrp.c: Likewise. * tsan.c: Likewise. * ubsan.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * tree.c: Remove functions moved to attribs.[ch]. * tree.h: Likewise. * config/aarch64/aarch64.c: Add attrs.h header file. * config/alpha/alpha.c: Likewise. * config/arc/arc.c: Likewise. * config/arm/arm.c: Likewise. * config/avr/avr.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/cr16/cr16.c: Likewise. * config/cris/cris.c: Likewise. * config/darwin.c: Likewise. * config/epiphany/epiphany.c: Likewise. * config/fr30/fr30.c: Likewise. * config/frv/frv.c: Likewise. * config/ft32/ft32.c: Likewise. * config/h8300/h8300.c: Likewise. * config/i386/winnt.c: Likewise. * config/ia64/ia64.c: Likewise. * config/iq2000/iq2000.c: Likewise. * config/lm32/lm32.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32r/m32r.c: Likewise. * config/m68k/m68k.c: Likewise. * config/mcore/mcore.c: Likewise. * config/microblaze/microblaze.c: Likewise. * config/mips/mips.c: Likewise. * config/mmix/mmix.c: Likewise. * config/mn10300/mn10300.c: Likewise. * config/moxie/moxie.c: Likewise. * config/msp430/msp430.c: Likewise. * config/nds32/nds32-isr.c: Likewise. * config/nds32/nds32.c: Likewise. * config/nios2/nios2.c: Likewise. * config/nvptx/nvptx.c: Likewise. * config/pa/pa.c: Likewise. * config/pdp11/pdp11.c: Likewise. * config/powerpcspe/powerpcspe.c: Likewise. * config/riscv/riscv.c: Likewise. * config/rl78/rl78.c: Likewise. * config/rx/rx.c: Likewise. * config/s390/s390.c: Likewise. * config/sh/sh.c: Likewise. * config/sol2.c: Likewise. * config/sparc/sparc.c: Likewise. * config/spu/spu.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/tilegx/tilegx.c: Likewise. * config/tilepro/tilepro.c: Likewise. * config/v850/v850.c: Likewise. * config/vax/vax.c: Likewise. * config/visium/visium.c: Likewise. * config/xtensa/xtensa.c: Likewise. 2017-08-08 Martin Liska <mliska@suse.cz> * call.c: Include header files. * cp-gimplify.c: Likewise. * cp-ubsan.c: Likewise. * cvt.c: Likewise. * init.c: Likewise. * search.c: Likewise. * semantics.c: Likewise. * typeck.c: Likewise. 2017-08-08 Martin Liska <mliska@suse.cz> * lto-lang.c: Include header files. * lto-symtab.c: Likewise. 2017-08-08 Martin Liska <mliska@suse.cz> * c-convert.c: Include header files. * c-typeck.c: Likewise. 2017-08-08 Martin Liska <mliska@suse.cz> * c-ada-spec.c: Include header files. * c-ubsan.c: Likewise. * c-warn.c: Likewise. 2017-08-08 Martin Liska <mliska@suse.cz> * trans-types.c: Include header files. From-SVN: r250946
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog136
-rw-r--r--gcc/ada/ChangeLog4
-rw-r--r--gcc/ada/gcc-interface/trans.c2
-rw-r--r--gcc/asan.c2
-rw-r--r--gcc/attribs.c633
-rw-r--r--gcc/attribs.h113
-rw-r--r--gcc/bb-reorder.c2
-rw-r--r--gcc/builtins.c2
-rw-r--r--gcc/c-family/ChangeLog6
-rw-r--r--gcc/c-family/c-ada-spec.c2
-rw-r--r--gcc/c-family/c-ubsan.c4
-rw-r--r--gcc/c-family/c-warn.c2
-rw-r--r--gcc/c/ChangeLog5
-rw-r--r--gcc/c/c-convert.c2
-rw-r--r--gcc/c/c-typeck.c2
-rw-r--r--gcc/calls.c2
-rw-r--r--gcc/cfgexpand.c2
-rw-r--r--gcc/cgraph.c2
-rw-r--r--gcc/cgraphunit.c2
-rw-r--r--gcc/config/aarch64/aarch64.c1
-rw-r--r--gcc/config/alpha/alpha.c2
-rw-r--r--gcc/config/arc/arc.c1
-rw-r--r--gcc/config/arm/arm.c1
-rw-r--r--gcc/config/avr/avr.c2
-rw-r--r--gcc/config/bfin/bfin.c2
-rw-r--r--gcc/config/c6x/c6x.c1
-rw-r--r--gcc/config/cr16/cr16.c2
-rw-r--r--gcc/config/cris/cris.c2
-rw-r--r--gcc/config/darwin.c1
-rw-r--r--gcc/config/epiphany/epiphany.c1
-rw-r--r--gcc/config/fr30/fr30.c2
-rw-r--r--gcc/config/frv/frv.c1
-rw-r--r--gcc/config/ft32/ft32.c2
-rw-r--r--gcc/config/h8300/h8300.c1
-rw-r--r--gcc/config/i386/winnt.c1
-rw-r--r--gcc/config/ia64/ia64.c1
-rw-r--r--gcc/config/iq2000/iq2000.c2
-rw-r--r--gcc/config/lm32/lm32.c2
-rw-r--r--gcc/config/m32r/m32r.c1
-rw-r--r--gcc/config/m68k/m68k.c2
-rw-r--r--gcc/config/mcore/mcore.c1
-rw-r--r--gcc/config/microblaze/microblaze.c2
-rw-r--r--gcc/config/mmix/mmix.c2
-rw-r--r--gcc/config/mn10300/mn10300.c2
-rw-r--r--gcc/config/moxie/moxie.c2
-rw-r--r--gcc/config/msp430/msp430.c2
-rw-r--r--gcc/config/nds32/nds32-isr.c2
-rw-r--r--gcc/config/nds32/nds32.c2
-rw-r--r--gcc/config/nios2/nios2.c2
-rw-r--r--gcc/config/nvptx/nvptx.c1
-rw-r--r--gcc/config/pa/pa.c1
-rw-r--r--gcc/config/pdp11/pdp11.c2
-rw-r--r--gcc/config/powerpcspe/powerpcspe.c1
-rw-r--r--gcc/config/riscv/riscv.c2
-rw-r--r--gcc/config/rx/rx.c2
-rw-r--r--gcc/config/s390/s390.c1
-rw-r--r--gcc/config/sol2.c1
-rw-r--r--gcc/config/sparc/sparc.c1
-rw-r--r--gcc/config/spu/spu.c1
-rw-r--r--gcc/config/stormy16/stormy16.c2
-rw-r--r--gcc/config/tilegx/tilegx.c1
-rw-r--r--gcc/config/tilepro/tilepro.c1
-rw-r--r--gcc/config/vax/vax.c2
-rw-r--r--gcc/config/visium/visium.c1
-rw-r--r--gcc/config/xtensa/xtensa.c1
-rw-r--r--gcc/convert.c2
-rw-r--r--gcc/cp/ChangeLog11
-rw-r--r--gcc/cp/call.c2
-rw-r--r--gcc/cp/cp-gimplify.c2
-rw-r--r--gcc/cp/cp-ubsan.c2
-rw-r--r--gcc/cp/cvt.c2
-rw-r--r--gcc/cp/init.c2
-rw-r--r--gcc/cp/search.c2
-rw-r--r--gcc/cp/semantics.c2
-rw-r--r--gcc/cp/typeck.c2
-rw-r--r--gcc/dwarf2out.c2
-rw-r--r--gcc/final.c2
-rw-r--r--gcc/fold-const.c2
-rw-r--r--gcc/fortran/ChangeLog4
-rw-r--r--gcc/fortran/trans-types.c1
-rw-r--r--gcc/function.c2
-rw-r--r--gcc/gimple-expr.c2
-rw-r--r--gcc/gimple-fold.c2
-rw-r--r--gcc/gimple-pretty-print.c2
-rw-r--r--gcc/gimple.c2
-rw-r--r--gcc/gimplify.c2
-rw-r--r--gcc/hsa-common.c2
-rw-r--r--gcc/hsa-gen.c2
-rw-r--r--gcc/internal-fn.c2
-rw-r--r--gcc/ipa-chkp.c2
-rw-r--r--gcc/ipa-cp.c2
-rw-r--r--gcc/ipa-devirt.c2
-rw-r--r--gcc/ipa-fnsummary.c2
-rw-r--r--gcc/ipa-inline.c2
-rw-r--r--gcc/ipa-visibility.c2
-rw-r--r--gcc/ipa.c3
-rw-r--r--gcc/lto-cgraph.c2
-rw-r--r--gcc/lto/ChangeLog5
-rw-r--r--gcc/lto/lto-lang.c2
-rw-r--r--gcc/lto/lto-symtab.c2
-rw-r--r--gcc/objc/ChangeLog6
-rw-r--r--gcc/objc/objc-gnu-runtime-abi-01.c2
-rw-r--r--gcc/objc/objc-next-runtime-abi-01.c2
-rw-r--r--gcc/objc/objc-next-runtime-abi-02.c2
-rw-r--r--gcc/omp-expand.c3
-rw-r--r--gcc/omp-general.c3
-rw-r--r--gcc/omp-low.c2
-rw-r--r--gcc/omp-offload.c2
-rw-r--r--gcc/omp-simd-clone.c3
-rw-r--r--gcc/opts-global.c2
-rw-r--r--gcc/passes.c2
-rw-r--r--gcc/predict.c2
-rw-r--r--gcc/sancov.c2
-rw-r--r--gcc/sanopt.c2
-rw-r--r--gcc/symtab.c2
-rw-r--r--gcc/toplev.c2
-rw-r--r--gcc/trans-mem.c3
-rw-r--r--gcc/tree-chkp.c2
-rw-r--r--gcc/tree-eh.c2
-rw-r--r--gcc/tree-into-ssa.c2
-rw-r--r--gcc/tree-object-size.c2
-rw-r--r--gcc/tree-parloops.c2
-rw-r--r--gcc/tree-profile.c2
-rw-r--r--gcc/tree-ssa-ccp.c2
-rw-r--r--gcc/tree-ssa-live.c2
-rw-r--r--gcc/tree-ssa-loop.c2
-rw-r--r--gcc/tree-ssa-sccvn.c2
-rw-r--r--gcc/tree-ssa-structalias.c3
-rw-r--r--gcc/tree-ssa.c2
-rw-r--r--gcc/tree-streamer-in.c2
-rw-r--r--gcc/tree-vectorizer.c2
-rw-r--r--gcc/tree-vrp.c2
-rw-r--r--gcc/tree.c685
-rw-r--r--gcc/tree.h86
-rw-r--r--gcc/tsan.c2
-rw-r--r--gcc/ubsan.c2
-rw-r--r--gcc/varasm.c2
-rw-r--r--gcc/varpool.c2
138 files changed, 1154 insertions, 776 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 823da54..dde91ce 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,139 @@
+2017-08-08 Martin Liska <mliska@suse.cz>
+
+ * asan.c: Include header files.
+ * attribs.c (build_decl_attribute_variant): New function moved
+ from tree.[ch].
+ (build_type_attribute_qual_variant): Likewise.
+ (cmp_attrib_identifiers): Likewise.
+ (simple_cst_list_equal): Likewise.
+ (omp_declare_simd_clauses_equal): Likewise.
+ (attribute_value_equal): Likewise.
+ (comp_type_attributes): Likewise.
+ (build_type_attribute_variant): Likewise.
+ (lookup_ident_attribute): Likewise.
+ (remove_attribute): Likewise.
+ (merge_attributes): Likewise.
+ (merge_type_attributes): Likewise.
+ (merge_decl_attributes): Likewise.
+ (merge_dllimport_decl_attributes): Likewise.
+ (handle_dll_attribute): Likewise.
+ (attribute_list_equal): Likewise.
+ (attribute_list_contained): Likewise.
+ * attribs.h (lookup_attribute): New function moved from tree.[ch].
+ (lookup_attribute_by_prefix): Likewise.
+ * bb-reorder.c: Include header files.
+ * builtins.c: Likewise.
+ * calls.c: Likewise.
+ * cfgexpand.c: Likewise.
+ * cgraph.c: Likewise.
+ * cgraphunit.c: Likewise.
+ * convert.c: Likewise.
+ * dwarf2out.c: Likewise.
+ * final.c: Likewise.
+ * fold-const.c: Likewise.
+ * function.c: Likewise.
+ * gimple-expr.c: Likewise.
+ * gimple-fold.c: Likewise.
+ * gimple-pretty-print.c: Likewise.
+ * gimple.c: Likewise.
+ * gimplify.c: Likewise.
+ * hsa-common.c: Likewise.
+ * hsa-gen.c: Likewise.
+ * internal-fn.c: Likewise.
+ * ipa-chkp.c: Likewise.
+ * ipa-cp.c: Likewise.
+ * ipa-devirt.c: Likewise.
+ * ipa-fnsummary.c: Likewise.
+ * ipa-inline.c: Likewise.
+ * ipa-visibility.c: Likewise.
+ * ipa.c: Likewise.
+ * lto-cgraph.c: Likewise.
+ * omp-expand.c: Likewise.
+ * omp-general.c: Likewise.
+ * omp-low.c: Likewise.
+ * omp-offload.c: Likewise.
+ * omp-simd-clone.c: Likewise.
+ * opts-global.c: Likewise.
+ * passes.c: Likewise.
+ * predict.c: Likewise.
+ * sancov.c: Likewise.
+ * sanopt.c: Likewise.
+ * symtab.c: Likewise.
+ * toplev.c: Likewise.
+ * trans-mem.c: Likewise.
+ * tree-chkp.c: Likewise.
+ * tree-eh.c: Likewise.
+ * tree-into-ssa.c: Likewise.
+ * tree-object-size.c: Likewise.
+ * tree-parloops.c: Likewise.
+ * tree-profile.c: Likewise.
+ * tree-ssa-ccp.c: Likewise.
+ * tree-ssa-live.c: Likewise.
+ * tree-ssa-loop.c: Likewise.
+ * tree-ssa-sccvn.c: Likewise.
+ * tree-ssa-structalias.c: Likewise.
+ * tree-ssa.c: Likewise.
+ * tree-streamer-in.c: Likewise.
+ * tree-vectorizer.c: Likewise.
+ * tree-vrp.c: Likewise.
+ * tsan.c: Likewise.
+ * ubsan.c: Likewise.
+ * varasm.c: Likewise.
+ * varpool.c: Likewise.
+ * tree.c: Remove functions moved to attribs.[ch].
+ * tree.h: Likewise.
+ * config/aarch64/aarch64.c: Add attrs.h header file.
+ * config/alpha/alpha.c: Likewise.
+ * config/arc/arc.c: Likewise.
+ * config/arm/arm.c: Likewise.
+ * config/avr/avr.c: Likewise.
+ * config/bfin/bfin.c: Likewise.
+ * config/c6x/c6x.c: Likewise.
+ * config/cr16/cr16.c: Likewise.
+ * config/cris/cris.c: Likewise.
+ * config/darwin.c: Likewise.
+ * config/epiphany/epiphany.c: Likewise.
+ * config/fr30/fr30.c: Likewise.
+ * config/frv/frv.c: Likewise.
+ * config/ft32/ft32.c: Likewise.
+ * config/h8300/h8300.c: Likewise.
+ * config/i386/winnt.c: Likewise.
+ * config/ia64/ia64.c: Likewise.
+ * config/iq2000/iq2000.c: Likewise.
+ * config/lm32/lm32.c: Likewise.
+ * config/m32c/m32c.c: Likewise.
+ * config/m32r/m32r.c: Likewise.
+ * config/m68k/m68k.c: Likewise.
+ * config/mcore/mcore.c: Likewise.
+ * config/microblaze/microblaze.c: Likewise.
+ * config/mips/mips.c: Likewise.
+ * config/mmix/mmix.c: Likewise.
+ * config/mn10300/mn10300.c: Likewise.
+ * config/moxie/moxie.c: Likewise.
+ * config/msp430/msp430.c: Likewise.
+ * config/nds32/nds32-isr.c: Likewise.
+ * config/nds32/nds32.c: Likewise.
+ * config/nios2/nios2.c: Likewise.
+ * config/nvptx/nvptx.c: Likewise.
+ * config/pa/pa.c: Likewise.
+ * config/pdp11/pdp11.c: Likewise.
+ * config/powerpcspe/powerpcspe.c: Likewise.
+ * config/riscv/riscv.c: Likewise.
+ * config/rl78/rl78.c: Likewise.
+ * config/rx/rx.c: Likewise.
+ * config/s390/s390.c: Likewise.
+ * config/sh/sh.c: Likewise.
+ * config/sol2.c: Likewise.
+ * config/sparc/sparc.c: Likewise.
+ * config/spu/spu.c: Likewise.
+ * config/stormy16/stormy16.c: Likewise.
+ * config/tilegx/tilegx.c: Likewise.
+ * config/tilepro/tilepro.c: Likewise.
+ * config/v850/v850.c: Likewise.
+ * config/vax/vax.c: Likewise.
+ * config/visium/visium.c: Likewise.
+ * config/xtensa/xtensa.c: Likewise.
+
2017-08-07 Michael Meissner <meissner@linux.vnet.ibm.com>
PR target/81593
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index dda51d4..b0b7cf3 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,7 @@
+2017-08-08 Martin Liska <mliska@suse.cz>
+
+ * gcc-interface/trans.c: Include header files.
+
2017-07-29 Jakub Jelinek <jakub@redhat.com>
* gcc-interface/utils.c (gnat_write_global_declarations): Pass false
diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c
index 7844bd7..67044b7 100644
--- a/gcc/ada/gcc-interface/trans.c
+++ b/gcc/ada/gcc-interface/trans.c
@@ -46,6 +46,8 @@
#include "gimplify.h"
#include "opts.h"
#include "common/common-target.h"
+#include "stringpool.h"
+#include "attribs.h"
#include "ada.h"
#include "adadecode.h"
diff --git a/gcc/asan.c b/gcc/asan.c
index 5f9275f..f83ca65 100644
--- a/gcc/asan.c
+++ b/gcc/asan.c
@@ -47,6 +47,8 @@ along with GCC; see the file COPYING3. If not see
#include "varasm.h"
#include "stor-layout.h"
#include "tree-iterator.h"
+#include "stringpool.h"
+#include "attribs.h"
#include "asan.h"
#include "dojump.h"
#include "explow.h"
diff --git a/gcc/attribs.c b/gcc/attribs.c
index 05fa8ef..faa0649 100644
--- a/gcc/attribs.c
+++ b/gcc/attribs.c
@@ -942,3 +942,636 @@ is_function_default_version (const tree decl)
return (TREE_CODE (attr) == STRING_CST
&& strcmp (TREE_STRING_POINTER (attr), "default") == 0);
}
+
+/* Return a declaration like DDECL except that its DECL_ATTRIBUTES
+ is ATTRIBUTE. */
+
+tree
+build_decl_attribute_variant (tree ddecl, tree attribute)
+{
+ DECL_ATTRIBUTES (ddecl) = attribute;
+ return ddecl;
+}
+
+/* Return a type like TTYPE except that its TYPE_ATTRIBUTE
+ is ATTRIBUTE and its qualifiers are QUALS.
+
+ Record such modified types already made so we don't make duplicates. */
+
+tree
+build_type_attribute_qual_variant (tree ttype, tree attribute, int quals)
+{
+ if (! attribute_list_equal (TYPE_ATTRIBUTES (ttype), attribute))
+ {
+ tree ntype;
+
+ /* Building a distinct copy of a tagged type is inappropriate; it
+ causes breakage in code that expects there to be a one-to-one
+ relationship between a struct and its fields.
+ build_duplicate_type is another solution (as used in
+ handle_transparent_union_attribute), but that doesn't play well
+ with the stronger C++ type identity model. */
+ if (TREE_CODE (ttype) == RECORD_TYPE
+ || TREE_CODE (ttype) == UNION_TYPE
+ || TREE_CODE (ttype) == QUAL_UNION_TYPE
+ || TREE_CODE (ttype) == ENUMERAL_TYPE)
+ {
+ warning (OPT_Wattributes,
+ "ignoring attributes applied to %qT after definition",
+ TYPE_MAIN_VARIANT (ttype));
+ return build_qualified_type (ttype, quals);
+ }
+
+ ttype = build_qualified_type (ttype, TYPE_UNQUALIFIED);
+ ntype = build_distinct_type_copy (ttype);
+
+ TYPE_ATTRIBUTES (ntype) = attribute;
+
+ hashval_t hash = type_hash_canon_hash (ntype);
+ ntype = type_hash_canon (hash, ntype);
+
+ /* If the target-dependent attributes make NTYPE different from
+ its canonical type, we will need to use structural equality
+ checks for this type. */
+ if (TYPE_STRUCTURAL_EQUALITY_P (ttype)
+ || !comp_type_attributes (ntype, ttype))
+ SET_TYPE_STRUCTURAL_EQUALITY (ntype);
+ else if (TYPE_CANONICAL (ntype) == ntype)
+ TYPE_CANONICAL (ntype) = TYPE_CANONICAL (ttype);
+
+ ttype = build_qualified_type (ntype, quals);
+ }
+ else if (TYPE_QUALS (ttype) != quals)
+ ttype = build_qualified_type (ttype, quals);
+
+ return ttype;
+}
+
+/* Compare two identifier nodes representing attributes.
+ Return true if they are the same, false otherwise. */
+
+static bool
+cmp_attrib_identifiers (const_tree attr1, const_tree attr2)
+{
+ /* Make sure we're dealing with IDENTIFIER_NODEs. */
+ gcc_checking_assert (TREE_CODE (attr1) == IDENTIFIER_NODE
+ && TREE_CODE (attr2) == IDENTIFIER_NODE);
+
+ /* Identifiers can be compared directly for equality. */
+ if (attr1 == attr2)
+ return true;
+
+ return cmp_attribs (IDENTIFIER_POINTER (attr1), IDENTIFIER_LENGTH (attr1),
+ IDENTIFIER_POINTER (attr2), IDENTIFIER_LENGTH (attr2));
+}
+
+/* Compare two constructor-element-type constants. Return 1 if the lists
+ are known to be equal; otherwise return 0. */
+
+static bool
+simple_cst_list_equal (const_tree l1, const_tree l2)
+{
+ while (l1 != NULL_TREE && l2 != NULL_TREE)
+ {
+ if (simple_cst_equal (TREE_VALUE (l1), TREE_VALUE (l2)) != 1)
+ return false;
+
+ l1 = TREE_CHAIN (l1);
+ l2 = TREE_CHAIN (l2);
+ }
+
+ return l1 == l2;
+}
+
+/* Check if "omp declare simd" attribute arguments, CLAUSES1 and CLAUSES2, are
+ the same. */
+
+static bool
+omp_declare_simd_clauses_equal (tree clauses1, tree clauses2)
+{
+ tree cl1, cl2;
+ for (cl1 = clauses1, cl2 = clauses2;
+ cl1 && cl2;
+ cl1 = OMP_CLAUSE_CHAIN (cl1), cl2 = OMP_CLAUSE_CHAIN (cl2))
+ {
+ if (OMP_CLAUSE_CODE (cl1) != OMP_CLAUSE_CODE (cl2))
+ return false;
+ if (OMP_CLAUSE_CODE (cl1) != OMP_CLAUSE_SIMDLEN)
+ {
+ if (simple_cst_equal (OMP_CLAUSE_DECL (cl1),
+ OMP_CLAUSE_DECL (cl2)) != 1)
+ return false;
+ }
+ switch (OMP_CLAUSE_CODE (cl1))
+ {
+ case OMP_CLAUSE_ALIGNED:
+ if (simple_cst_equal (OMP_CLAUSE_ALIGNED_ALIGNMENT (cl1),
+ OMP_CLAUSE_ALIGNED_ALIGNMENT (cl2)) != 1)
+ return false;
+ break;
+ case OMP_CLAUSE_LINEAR:
+ if (simple_cst_equal (OMP_CLAUSE_LINEAR_STEP (cl1),
+ OMP_CLAUSE_LINEAR_STEP (cl2)) != 1)
+ return false;
+ break;
+ case OMP_CLAUSE_SIMDLEN:
+ if (simple_cst_equal (OMP_CLAUSE_SIMDLEN_EXPR (cl1),
+ OMP_CLAUSE_SIMDLEN_EXPR (cl2)) != 1)
+ return false;
+ default:
+ break;
+ }
+ }
+ return true;
+}
+
+
+/* Compare two attributes for their value identity. Return true if the
+ attribute values are known to be equal; otherwise return false. */
+
+bool
+attribute_value_equal (const_tree attr1, const_tree attr2)
+{
+ if (TREE_VALUE (attr1) == TREE_VALUE (attr2))
+ return true;
+
+ if (TREE_VALUE (attr1) != NULL_TREE
+ && TREE_CODE (TREE_VALUE (attr1)) == TREE_LIST
+ && TREE_VALUE (attr2) != NULL_TREE
+ && TREE_CODE (TREE_VALUE (attr2)) == TREE_LIST)
+ {
+ /* Handle attribute format. */
+ if (is_attribute_p ("format", get_attribute_name (attr1)))
+ {
+ attr1 = TREE_VALUE (attr1);
+ attr2 = TREE_VALUE (attr2);
+ /* Compare the archetypes (printf/scanf/strftime/...). */
+ if (!cmp_attrib_identifiers (TREE_VALUE (attr1), TREE_VALUE (attr2)))
+ return false;
+ /* Archetypes are the same. Compare the rest. */
+ return (simple_cst_list_equal (TREE_CHAIN (attr1),
+ TREE_CHAIN (attr2)) == 1);
+ }
+ return (simple_cst_list_equal (TREE_VALUE (attr1),
+ TREE_VALUE (attr2)) == 1);
+ }
+
+ if ((flag_openmp || flag_openmp_simd)
+ && TREE_VALUE (attr1) && TREE_VALUE (attr2)
+ && TREE_CODE (TREE_VALUE (attr1)) == OMP_CLAUSE
+ && TREE_CODE (TREE_VALUE (attr2)) == OMP_CLAUSE)
+ return omp_declare_simd_clauses_equal (TREE_VALUE (attr1),
+ TREE_VALUE (attr2));
+
+ return (simple_cst_equal (TREE_VALUE (attr1), TREE_VALUE (attr2)) == 1);
+}
+
+/* Return 0 if the attributes for two types are incompatible, 1 if they
+ are compatible, and 2 if they are nearly compatible (which causes a
+ warning to be generated). */
+int
+comp_type_attributes (const_tree type1, const_tree type2)
+{
+ const_tree a1 = TYPE_ATTRIBUTES (type1);
+ const_tree a2 = TYPE_ATTRIBUTES (type2);
+ const_tree a;
+
+ if (a1 == a2)
+ return 1;
+ for (a = a1; a != NULL_TREE; a = TREE_CHAIN (a))
+ {
+ const struct attribute_spec *as;
+ const_tree attr;
+
+ as = lookup_attribute_spec (get_attribute_name (a));
+ if (!as || as->affects_type_identity == false)
+ continue;
+
+ attr = lookup_attribute (as->name, CONST_CAST_TREE (a2));
+ if (!attr || !attribute_value_equal (a, attr))
+ break;
+ }
+ if (!a)
+ {
+ for (a = a2; a != NULL_TREE; a = TREE_CHAIN (a))
+ {
+ const struct attribute_spec *as;
+
+ as = lookup_attribute_spec (get_attribute_name (a));
+ if (!as || as->affects_type_identity == false)
+ continue;
+
+ if (!lookup_attribute (as->name, CONST_CAST_TREE (a1)))
+ break;
+ /* We don't need to compare trees again, as we did this
+ already in first loop. */
+ }
+ /* All types - affecting identity - are equal, so
+ there is no need to call target hook for comparison. */
+ if (!a)
+ return 1;
+ }
+ if (lookup_attribute ("transaction_safe", CONST_CAST_TREE (a)))
+ return 0;
+ /* As some type combinations - like default calling-convention - might
+ be compatible, we have to call the target hook to get the final result. */
+ return targetm.comp_type_attributes (type1, type2);
+}
+
+/* Return a type like TTYPE except that its TYPE_ATTRIBUTE
+ is ATTRIBUTE.
+
+ Record such modified types already made so we don't make duplicates. */
+
+tree
+build_type_attribute_variant (tree ttype, tree attribute)
+{
+ return build_type_attribute_qual_variant (ttype, attribute,
+ TYPE_QUALS (ttype));
+}
+
+/* A variant of lookup_attribute() that can be used with an identifier
+ as the first argument, and where the identifier can be either
+ 'text' or '__text__'.
+
+ Given an attribute ATTR_IDENTIFIER, and a list of attributes LIST,
+ return a pointer to the attribute's list element if the attribute
+ is part of the list, or NULL_TREE if not found. If the attribute
+ appears more than once, this only returns the first occurrence; the
+ TREE_CHAIN of the return value should be passed back in if further
+ occurrences are wanted. ATTR_IDENTIFIER must be an identifier but
+ can be in the form 'text' or '__text__'. */
+static tree
+lookup_ident_attribute (tree attr_identifier, tree list)
+{
+ gcc_checking_assert (TREE_CODE (attr_identifier) == IDENTIFIER_NODE);
+
+ while (list)
+ {
+ gcc_checking_assert (TREE_CODE (get_attribute_name (list))
+ == IDENTIFIER_NODE);
+
+ if (cmp_attrib_identifiers (attr_identifier,
+ get_attribute_name (list)))
+ /* Found it. */
+ break;
+ list = TREE_CHAIN (list);
+ }
+
+ return list;
+}
+
+/* Remove any instances of attribute ATTR_NAME in LIST and return the
+ modified list. */
+
+tree
+remove_attribute (const char *attr_name, tree list)
+{
+ tree *p;
+ gcc_checking_assert (attr_name[0] != '_');
+
+ for (p = &list; *p;)
+ {
+ tree l = *p;
+
+ tree attr = get_attribute_name (l);
+ if (is_attribute_p (attr_name, attr))
+ *p = TREE_CHAIN (l);
+ else
+ p = &TREE_CHAIN (l);
+ }
+
+ return list;
+}
+
+/* Return an attribute list that is the union of a1 and a2. */
+
+tree
+merge_attributes (tree a1, tree a2)
+{
+ tree attributes;
+
+ /* Either one unset? Take the set one. */
+
+ if ((attributes = a1) == 0)
+ attributes = a2;
+
+ /* One that completely contains the other? Take it. */
+
+ else if (a2 != 0 && ! attribute_list_contained (a1, a2))
+ {
+ if (attribute_list_contained (a2, a1))
+ attributes = a2;
+ else
+ {
+ /* Pick the longest list, and hang on the other list. */
+
+ if (list_length (a1) < list_length (a2))
+ attributes = a2, a2 = a1;
+
+ for (; a2 != 0; a2 = TREE_CHAIN (a2))
+ {
+ tree a;
+ for (a = lookup_ident_attribute (get_attribute_name (a2),
+ attributes);
+ a != NULL_TREE && !attribute_value_equal (a, a2);
+ a = lookup_ident_attribute (get_attribute_name (a2),
+ TREE_CHAIN (a)))
+ ;
+ if (a == NULL_TREE)
+ {
+ a1 = copy_node (a2);
+ TREE_CHAIN (a1) = attributes;
+ attributes = a1;
+ }
+ }
+ }
+ }
+ return attributes;
+}
+
+/* Given types T1 and T2, merge their attributes and return
+ the result. */
+
+tree
+merge_type_attributes (tree t1, tree t2)
+{
+ return merge_attributes (TYPE_ATTRIBUTES (t1),
+ TYPE_ATTRIBUTES (t2));
+}
+
+/* Given decls OLDDECL and NEWDECL, merge their attributes and return
+ the result. */
+
+tree
+merge_decl_attributes (tree olddecl, tree newdecl)
+{
+ return merge_attributes (DECL_ATTRIBUTES (olddecl),
+ DECL_ATTRIBUTES (newdecl));
+}
+
+#if TARGET_DLLIMPORT_DECL_ATTRIBUTES
+
+/* Specialization of merge_decl_attributes for various Windows targets.
+
+ This handles the following situation:
+
+ __declspec (dllimport) int foo;
+ int foo;
+
+ The second instance of `foo' nullifies the dllimport. */
+
+tree
+merge_dllimport_decl_attributes (tree old, tree new_tree)
+{
+ tree a;
+ int delete_dllimport_p = 1;
+
+ /* What we need to do here is remove from `old' dllimport if it doesn't
+ appear in `new'. dllimport behaves like extern: if a declaration is
+ marked dllimport and a definition appears later, then the object
+ is not dllimport'd. We also remove a `new' dllimport if the old list
+ contains dllexport: dllexport always overrides dllimport, regardless
+ of the order of declaration. */
+ if (!VAR_OR_FUNCTION_DECL_P (new_tree))
+ delete_dllimport_p = 0;
+ else if (DECL_DLLIMPORT_P (new_tree)
+ && lookup_attribute ("dllexport", DECL_ATTRIBUTES (old)))
+ {
+ DECL_DLLIMPORT_P (new_tree) = 0;
+ warning (OPT_Wattributes, "%q+D already declared with dllexport "
+ "attribute: dllimport ignored", new_tree);
+ }
+ else if (DECL_DLLIMPORT_P (old) && !DECL_DLLIMPORT_P (new_tree))
+ {
+ /* Warn about overriding a symbol that has already been used, e.g.:
+ extern int __attribute__ ((dllimport)) foo;
+ int* bar () {return &foo;}
+ int foo;
+ */
+ if (TREE_USED (old))
+ {
+ warning (0, "%q+D redeclared without dllimport attribute "
+ "after being referenced with dll linkage", new_tree);
+ /* If we have used a variable's address with dllimport linkage,
+ keep the old DECL_DLLIMPORT_P flag: the ADDR_EXPR using the
+ decl may already have had TREE_CONSTANT computed.
+ We still remove the attribute so that assembler code refers
+ to '&foo rather than '_imp__foo'. */
+ if (VAR_P (old) && TREE_ADDRESSABLE (old))
+ DECL_DLLIMPORT_P (new_tree) = 1;
+ }
+
+ /* Let an inline definition silently override the external reference,
+ but otherwise warn about attribute inconsistency. */
+ else if (VAR_P (new_tree) || !DECL_DECLARED_INLINE_P (new_tree))
+ warning (OPT_Wattributes, "%q+D redeclared without dllimport "
+ "attribute: previous dllimport ignored", new_tree);
+ }
+ else
+ delete_dllimport_p = 0;
+
+ a = merge_attributes (DECL_ATTRIBUTES (old), DECL_ATTRIBUTES (new_tree));
+
+ if (delete_dllimport_p)
+ a = remove_attribute ("dllimport", a);
+
+ return a;
+}
+
+/* Handle a "dllimport" or "dllexport" attribute; arguments as in
+ struct attribute_spec.handler. */
+
+tree
+handle_dll_attribute (tree * pnode, tree name, tree args, int flags,
+ bool *no_add_attrs)
+{
+ tree node = *pnode;
+ bool is_dllimport;
+
+ /* These attributes may apply to structure and union types being created,
+ but otherwise should pass to the declaration involved. */
+ if (!DECL_P (node))
+ {
+ if (flags & ((int) ATTR_FLAG_DECL_NEXT | (int) ATTR_FLAG_FUNCTION_NEXT
+ | (int) ATTR_FLAG_ARRAY_NEXT))
+ {
+ *no_add_attrs = true;
+ return tree_cons (name, args, NULL_TREE);
+ }
+ if (TREE_CODE (node) == RECORD_TYPE
+ || TREE_CODE (node) == UNION_TYPE)
+ {
+ node = TYPE_NAME (node);
+ if (!node)
+ return NULL_TREE;
+ }
+ else
+ {
+ warning (OPT_Wattributes, "%qE attribute ignored",
+ name);
+ *no_add_attrs = true;
+ return NULL_TREE;
+ }
+ }
+
+ if (!VAR_OR_FUNCTION_DECL_P (node) && TREE_CODE (node) != TYPE_DECL)
+ {
+ *no_add_attrs = true;
+ warning (OPT_Wattributes, "%qE attribute ignored",
+ name);
+ return NULL_TREE;
+ }
+
+ if (TREE_CODE (node) == TYPE_DECL
+ && TREE_CODE (TREE_TYPE (node)) != RECORD_TYPE
+ && TREE_CODE (TREE_TYPE (node)) != UNION_TYPE)
+ {
+ *no_add_attrs = true;
+ warning (OPT_Wattributes, "%qE attribute ignored",
+ name);
+ return NULL_TREE;
+ }
+
+ is_dllimport = is_attribute_p ("dllimport", name);
+
+ /* Report error on dllimport ambiguities seen now before they cause
+ any damage. */
+ if (is_dllimport)
+ {
+ /* Honor any target-specific overrides. */
+ if (!targetm.valid_dllimport_attribute_p (node))
+ *no_add_attrs = true;
+
+ else if (TREE_CODE (node) == FUNCTION_DECL
+ && DECL_DECLARED_INLINE_P (node))
+ {
+ warning (OPT_Wattributes, "inline function %q+D declared as "
+ " dllimport: attribute ignored", node);
+ *no_add_attrs = true;
+ }
+ /* Like MS, treat definition of dllimported variables and
+ non-inlined functions on declaration as syntax errors. */
+ else if (TREE_CODE (node) == FUNCTION_DECL && DECL_INITIAL (node))
+ {
+ error ("function %q+D definition is marked dllimport", node);
+ *no_add_attrs = true;
+ }
+
+ else if (VAR_P (node))
+ {
+ if (DECL_INITIAL (node))
+ {
+ error ("variable %q+D definition is marked dllimport",
+ node);
+ *no_add_attrs = true;
+ }
+
+ /* `extern' needn't be specified with dllimport.
+ Specify `extern' now and hope for the best. Sigh. */
+ DECL_EXTERNAL (node) = 1;
+ /* Also, implicitly give dllimport'd variables declared within
+ a function global scope, unless declared static. */
+ if (current_function_decl != NULL_TREE && !TREE_STATIC (node))
+ TREE_PUBLIC (node) = 1;
+ }
+
+ if (*no_add_attrs == false)
+ DECL_DLLIMPORT_P (node) = 1;
+ }
+ else if (TREE_CODE (node) == FUNCTION_DECL
+ && DECL_DECLARED_INLINE_P (node)
+ && flag_keep_inline_dllexport)
+ /* An exported function, even if inline, must be emitted. */
+ DECL_EXTERNAL (node) = 0;
+
+ /* Report error if symbol is not accessible at global scope. */
+ if (!TREE_PUBLIC (node) && VAR_OR_FUNCTION_DECL_P (node))
+ {
+ error ("external linkage required for symbol %q+D because of "
+ "%qE attribute", node, name);
+ *no_add_attrs = true;
+ }
+
+ /* A dllexport'd entity must have default visibility so that other
+ program units (shared libraries or the main executable) can see
+ it. A dllimport'd entity must have default visibility so that
+ the linker knows that undefined references within this program
+ unit can be resolved by the dynamic linker. */
+ if (!*no_add_attrs)
+ {
+ if (DECL_VISIBILITY_SPECIFIED (node)
+ && DECL_VISIBILITY (node) != VISIBILITY_DEFAULT)
+ error ("%qE implies default visibility, but %qD has already "
+ "been declared with a different visibility",
+ name, node);
+ DECL_VISIBILITY (node) = VISIBILITY_DEFAULT;
+ DECL_VISIBILITY_SPECIFIED (node) = 1;
+ }
+
+ return NULL_TREE;
+}
+
+#endif /* TARGET_DLLIMPORT_DECL_ATTRIBUTES */
+
+/* Given two lists of attributes, return true if list l2 is
+ equivalent to l1. */
+
+int
+attribute_list_equal (const_tree l1, const_tree l2)
+{
+ if (l1 == l2)
+ return 1;
+
+ return attribute_list_contained (l1, l2)
+ && attribute_list_contained (l2, l1);
+}
+
+/* Given two lists of attributes, return true if list L2 is
+ completely contained within L1. */
+/* ??? This would be faster if attribute names were stored in a canonicalized
+ form. Otherwise, if L1 uses `foo' and L2 uses `__foo__', the long method
+ must be used to show these elements are equivalent (which they are). */
+/* ??? It's not clear that attributes with arguments will always be handled
+ correctly. */
+
+int
+attribute_list_contained (const_tree l1, const_tree l2)
+{
+ const_tree t1, t2;
+
+ /* First check the obvious, maybe the lists are identical. */
+ if (l1 == l2)
+ return 1;
+
+ /* Maybe the lists are similar. */
+ for (t1 = l1, t2 = l2;
+ t1 != 0 && t2 != 0
+ && get_attribute_name (t1) == get_attribute_name (t2)
+ && TREE_VALUE (t1) == TREE_VALUE (t2);
+ t1 = TREE_CHAIN (t1), t2 = TREE_CHAIN (t2))
+ ;
+
+ /* Maybe the lists are equal. */
+ if (t1 == 0 && t2 == 0)
+ return 1;
+
+ for (; t2 != 0; t2 = TREE_CHAIN (t2))
+ {
+ const_tree attr;
+ /* This CONST_CAST is okay because lookup_attribute does not
+ modify its argument and the return value is assigned to a
+ const_tree. */
+ for (attr = lookup_ident_attribute (get_attribute_name (t2),
+ CONST_CAST_TREE (l1));
+ attr != NULL_TREE && !attribute_value_equal (t2, attr);
+ attr = lookup_ident_attribute (get_attribute_name (t2),
+ TREE_CHAIN (attr)))
+ ;
+
+ if (attr == NULL_TREE)
+ return 0;
+ }
+
+ return 1;
+}
diff --git a/gcc/attribs.h b/gcc/attribs.h
index d4a790b..06e6993 100644
--- a/gcc/attribs.h
+++ b/gcc/attribs.h
@@ -47,6 +47,46 @@ extern char *make_unique_name (tree, const char *, bool);
extern tree make_dispatcher_decl (const tree);
extern bool is_function_default_version (const tree);
+/* Return a type like TTYPE except that its TYPE_ATTRIBUTES
+ is ATTRIBUTE.
+
+ Such modified types already made are recorded so that duplicates
+ are not made. */
+
+extern tree build_type_attribute_variant (tree, tree);
+extern tree build_decl_attribute_variant (tree, tree);
+extern tree build_type_attribute_qual_variant (tree, tree, int);
+
+extern bool attribute_value_equal (const_tree, const_tree);
+
+/* Return 0 if the attributes for two types are incompatible, 1 if they
+ are compatible, and 2 if they are nearly compatible (which causes a
+ warning to be generated). */
+extern int comp_type_attributes (const_tree, const_tree);
+
+/* Default versions of target-overridable functions. */
+extern tree merge_decl_attributes (tree, tree);
+extern tree merge_type_attributes (tree, tree);
+
+/* Remove any instances of attribute ATTR_NAME in LIST and return the
+ modified list. */
+
+extern tree remove_attribute (const char *, tree);
+
+/* Given two attributes lists, return a list of their union. */
+
+extern tree merge_attributes (tree, tree);
+
+/* Given two Windows decl attributes lists, possibly including
+ dllimport, return a list of their union . */
+extern tree merge_dllimport_decl_attributes (tree, tree);
+
+/* Handle a "dllimport" or "dllexport" attribute. */
+extern tree handle_dll_attribute (tree *, tree, tree, int, bool *);
+
+extern int attribute_list_equal (const_tree, const_tree);
+extern int attribute_list_contained (const_tree, const_tree);
+
/* For a given IDENTIFIER_NODE, strip leading and trailing '_' characters
so that we have a canonical form of attribute names. */
@@ -90,4 +130,77 @@ is_attribute_p (const char *attr_name, const_tree ident)
IDENTIFIER_POINTER (ident), IDENTIFIER_LENGTH (ident));
}
+/* Given an attribute name ATTR_NAME and a list of attributes LIST,
+ return a pointer to the attribute's list element if the attribute
+ is part of the list, or NULL_TREE if not found. If the attribute
+ appears more than once, this only returns the first occurrence; the
+ TREE_CHAIN of the return value should be passed back in if further
+ occurrences are wanted. ATTR_NAME must be in the form 'text' (not
+ '__text__'). */
+
+static inline tree
+lookup_attribute (const char *attr_name, tree list)
+{
+ gcc_checking_assert (attr_name[0] != '_');
+ /* In most cases, list is NULL_TREE. */
+ if (list == NULL_TREE)
+ return NULL_TREE;
+ else
+ {
+ size_t attr_len = strlen (attr_name);
+ /* Do the strlen() before calling the out-of-line implementation.
+ In most cases attr_name is a string constant, and the compiler
+ will optimize the strlen() away. */
+ while (list)
+ {
+ tree attr = get_attribute_name (list);
+ size_t ident_len = IDENTIFIER_LENGTH (attr);
+ if (cmp_attribs (attr_name, attr_len, IDENTIFIER_POINTER (attr),
+ ident_len))
+ break;
+ list = TREE_CHAIN (list);
+ }
+
+ return list;
+ }
+}
+
+/* Given an attribute name ATTR_NAME and a list of attributes LIST,
+ return a pointer to the attribute's list first element if the attribute
+ starts with ATTR_NAME. ATTR_NAME must be in the form 'text' (not
+ '__text__'). */
+
+static inline tree
+lookup_attribute_by_prefix (const char *attr_name, tree list)
+{
+ gcc_checking_assert (attr_name[0] != '_');
+ /* In most cases, list is NULL_TREE. */
+ if (list == NULL_TREE)
+ return NULL_TREE;
+ else
+ {
+ size_t attr_len = strlen (attr_name);
+ while (list)
+ {
+ size_t ident_len = IDENTIFIER_LENGTH (get_attribute_name (list));
+
+ if (attr_len > ident_len)
+ {
+ list = TREE_CHAIN (list);
+ continue;
+ }
+
+ const char *p = IDENTIFIER_POINTER (get_attribute_name (list));
+ gcc_checking_assert (attr_len == 0 || p[0] != '_');
+
+ if (strncmp (attr_name, p, attr_len) == 0)
+ break;
+
+ list = TREE_CHAIN (list);
+ }
+
+ return list;
+ }
+}
+
#endif // GCC_ATTRIBS_H
diff --git a/gcc/bb-reorder.c b/gcc/bb-reorder.c
index 3dbae81..4dad298 100644
--- a/gcc/bb-reorder.c
+++ b/gcc/bb-reorder.c
@@ -115,6 +115,8 @@
#include "bb-reorder.h"
#include "except.h"
#include "fibonacci_heap.h"
+#include "stringpool.h"
+#include "attribs.h"
/* The number of rounds. In most cases there will only be 4 rounds, but
when partitioning hot and cold basic blocks into separate sections of
diff --git a/gcc/builtins.c b/gcc/builtins.c
index 016f68d..fa0f89c 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -60,6 +60,8 @@ along with GCC; see the file COPYING3. If not see
#include "langhooks.h"
#include "value-prof.h"
#include "builtins.h"
+#include "stringpool.h"
+#include "attribs.h"
#include "asan.h"
#include "cilk.h"
#include "tree-chkp.h"
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index c27da8a..d1cf80e 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,3 +1,9 @@
+2017-08-08 Martin Liska <mliska@suse.cz>
+
+ * c-ada-spec.c: Include header files.
+ * c-ubsan.c: Likewise.
+ * c-warn.c: Likewise.
+
2017-08-07 Jakub Jelinek <jakub@redhat.com>
PR c/69389
diff --git a/gcc/c-family/c-ada-spec.c b/gcc/c-family/c-ada-spec.c
index 6c050fb..0cd3d55 100644
--- a/gcc/c-family/c-ada-spec.c
+++ b/gcc/c-family/c-ada-spec.c
@@ -28,6 +28,8 @@ along with GCC; see the file COPYING3. If not see
#include "fold-const.h"
#include "c-pragma.h"
#include "cpp-id-data.h"
+#include "stringpool.h"
+#include "attribs.h"
/* Local functions, macros and variables. */
static int dump_generic_ada_node (pretty_printer *, tree, tree, int, int,
diff --git a/gcc/c-family/c-ubsan.c b/gcc/c-family/c-ubsan.c
index 541b530..b1386db 100644
--- a/gcc/c-family/c-ubsan.c
+++ b/gcc/c-family/c-ubsan.c
@@ -25,10 +25,12 @@ along with GCC; see the file COPYING3. If not see
#include "c-family/c-common.h"
#include "ubsan.h"
#include "c-family/c-ubsan.h"
-#include "asan.h"
#include "stor-layout.h"
#include "builtins.h"
#include "gimplify.h"
+#include "stringpool.h"
+#include "attribs.h"
+#include "asan.h"
/* Instrument division by zero and INT_MIN / -1. If not instrumenting,
return NULL_TREE. */
diff --git a/gcc/c-family/c-warn.c b/gcc/c-family/c-warn.c
index e970ab2..9c30734 100644
--- a/gcc/c-family/c-warn.c
+++ b/gcc/c-family/c-warn.c
@@ -28,6 +28,8 @@ along with GCC; see the file COPYING3. If not see
#include "tm_p.h"
#include "diagnostic.h"
#include "intl.h"
+#include "stringpool.h"
+#include "attribs.h"
#include "asan.h"
#include "gcc-rich-location.h"
#include "gimplify.h"
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog
index 06dd1b7..d29f444 100644
--- a/gcc/c/ChangeLog
+++ b/gcc/c/ChangeLog
@@ -1,3 +1,8 @@
+2017-08-08 Martin Liska <mliska@suse.cz>
+
+ * c-convert.c: Include header files.
+ * c-typeck.c: Likewise.
+
2017-08-07 Martin Liska <mliska@suse.cz>
* c-parser.c (c_parser_attributes): Canonicalize name of an
diff --git a/gcc/c/c-convert.c b/gcc/c/c-convert.c
index bc64917..8752132 100644
--- a/gcc/c/c-convert.c
+++ b/gcc/c/c-convert.c
@@ -31,6 +31,8 @@ along with GCC; see the file COPYING3. If not see
#include "convert.h"
#include "langhooks.h"
#include "ubsan.h"
+#include "stringpool.h"
+#include "attribs.h"
#include "asan.h"
/* Change of width--truncation and extension of integers or reals--
diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c
index 71d0135..321c953 100644
--- a/gcc/c/c-typeck.c
+++ b/gcc/c/c-typeck.c
@@ -50,6 +50,8 @@ along with GCC; see the file COPYING3. If not see
#include "gomp-constants.h"
#include "spellcheck-tree.h"
#include "gcc-rich-location.h"
+#include "stringpool.h"
+#include "attribs.h"
#include "asan.h"
/* Possible cases of implicit bad conversions. Used to select
diff --git a/gcc/calls.c b/gcc/calls.c
index 6405f48..7599928 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -52,6 +52,8 @@ along with GCC; see the file COPYING3. If not see
#include "tree-ssanames.h"
#include "rtl-chkp.h"
#include "intl.h"
+#include "stringpool.h"
+#include "attribs.h"
/* Like PREFERRED_STACK_BOUNDARY but in units of bytes, not bits. */
#define STACK_BYTES (PREFERRED_STACK_BOUNDARY / BITS_PER_UNIT)
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index c9d8118..7f0130d 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -68,6 +68,8 @@ along with GCC; see the file COPYING3. If not see
#include "tree-outof-ssa.h"
#include "cfgloop.h"
#include "insn-attr.h" /* For INSN_SCHEDULING. */
+#include "stringpool.h"
+#include "attribs.h"
#include "asan.h"
#include "tree-ssa-address.h"
#include "output.h"
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index d7c9ba6..c6ab7e3 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -61,6 +61,8 @@ along with GCC; see the file COPYING3. If not see
#include "tree-chkp.h"
#include "context.h"
#include "gimplify.h"
+#include "stringpool.h"
+#include "attribs.h"
/* FIXME: Only for PROP_loops, but cgraph shouldn't have to know about this. */
#include "tree-pass.h"
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index 6072c56..e8cc765 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -204,6 +204,8 @@ along with GCC; see the file COPYING3. If not see
#include "dbgcnt.h"
#include "tree-chkp.h"
#include "lto-section-names.h"
+#include "stringpool.h"
+#include "attribs.h"
/* Queue of cgraph nodes scheduled to be added into cgraph. This is a
secondary queue used during optimization to accommodate passes that
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index 79a396e..28c4e0e 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -33,6 +33,7 @@
#include "df.h"
#include "tm_p.h"
#include "stringpool.h"
+#include "attribs.h"
#include "optabs.h"
#include "regs.h"
#include "emit-rtl.h"
diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c
index 341ec20..e13c5f9 100644
--- a/gcc/config/alpha/alpha.c
+++ b/gcc/config/alpha/alpha.c
@@ -26,6 +26,8 @@ along with GCC; see the file COPYING3. If not see
#include "target.h"
#include "rtl.h"
#include "tree.h"
+#include "stringpool.h"
+#include "attribs.h"
#include "memmodel.h"
#include "gimple.h"
#include "df.h"
diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c
index be5f1bd..057f875 100644
--- a/gcc/config/arc/arc.c
+++ b/gcc/config/arc/arc.c
@@ -40,6 +40,7 @@ along with GCC; see the file COPYING3. If not see
#include "df.h"
#include "tm_p.h"
#include "stringpool.h"
+#include "attribs.h"
#include "optabs.h"
#include "regs.h"
#include "emit-rtl.h"
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 25677d1..fa3e2fa 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -32,6 +32,7 @@
#include "df.h"
#include "tm_p.h"
#include "stringpool.h"
+#include "attribs.h"
#include "optabs.h"
#include "regs.h"
#include "emit-rtl.h"
diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c
index 1f333cc..e453bfb 100644
--- a/gcc/config/avr/avr.c
+++ b/gcc/config/avr/avr.c
@@ -26,6 +26,8 @@
#include "target.h"
#include "rtl.h"
#include "tree.h"
+#include "stringpool.h"
+#include "attribs.h"
#include "cgraph.h"
#include "c-family/c-common.h"
#include "cfghooks.h"
diff --git a/gcc/config/bfin/bfin.c b/gcc/config/bfin/bfin.c
index 9fe90fc..f04fe87 100644
--- a/gcc/config/bfin/bfin.c
+++ b/gcc/config/bfin/bfin.c
@@ -25,6 +25,8 @@
#include "target.h"
#include "rtl.h"
#include "tree.h"
+#include "stringpool.h"
+#include "attribs.h"
#include "cfghooks.h"
#include "df.h"
#include "memmodel.h"
diff --git a/gcc/config/c6x/c6x.c b/gcc/config/c6x/c6x.c
index 4529fd4..a7083c1 100644
--- a/gcc/config/c6x/c6x.c
+++ b/gcc/config/c6x/c6x.c
@@ -32,6 +32,7 @@
#include "memmodel.h"
#include "tm_p.h"
#include "stringpool.h"
+#include "attribs.h"
#include "optabs.h"
#include "regs.h"
#include "emit-rtl.h"
diff --git a/gcc/config/cr16/cr16.c b/gcc/config/cr16/cr16.c
index 93edd23..ab6ef7a 100644
--- a/gcc/config/cr16/cr16.c
+++ b/gcc/config/cr16/cr16.c
@@ -25,6 +25,8 @@
#include "target.h"
#include "rtl.h"
#include "tree.h"
+#include "stringpool.h"
+#include "attribs.h"
#include "df.h"
#include "memmodel.h"
#include "tm_p.h"
diff --git a/gcc/config/cris/cris.c b/gcc/config/cris/cris.c
index 8c134a6..b57881a 100644
--- a/gcc/config/cris/cris.c
+++ b/gcc/config/cris/cris.c
@@ -25,6 +25,8 @@ along with GCC; see the file COPYING3. If not see
#include "target.h"
#include "rtl.h"
#include "tree.h"
+#include "stringpool.h"
+#include "attribs.h"
#include "cfghooks.h"
#include "df.h"
#include "memmodel.h"
diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c
index 9a8cf31..949db25 100644
--- a/gcc/config/darwin.c
+++ b/gcc/config/darwin.c
@@ -31,6 +31,7 @@ along with GCC; see the file COPYING3. If not see
#include "memmodel.h"
#include "tm_p.h"
#include "stringpool.h"
+#include "attribs.h"
#include "insn-config.h"
#include "emit-rtl.h"
#include "cgraph.h"
diff --git a/gcc/config/epiphany/epiphany.c b/gcc/config/epiphany/epiphany.c
index b9ec0f4..4e27557 100644
--- a/gcc/config/epiphany/epiphany.c
+++ b/gcc/config/epiphany/epiphany.c
@@ -29,6 +29,7 @@ along with GCC; see the file COPYING3. If not see
#include "memmodel.h"
#include "tm_p.h"
#include "stringpool.h"
+#include "attribs.h"
#include "optabs.h"
#include "emit-rtl.h"
#include "recog.h"
diff --git a/gcc/config/fr30/fr30.c b/gcc/config/fr30/fr30.c
index 42bec9f..d83b2f3 100644
--- a/gcc/config/fr30/fr30.c
+++ b/gcc/config/fr30/fr30.c
@@ -27,6 +27,8 @@
#include "target.h"
#include "rtl.h"
#include "tree.h"
+#include "stringpool.h"
+#include "attribs.h"
#include "df.h"
#include "memmodel.h"
#include "emit-rtl.h"
diff --git a/gcc/config/frv/frv.c b/gcc/config/frv/frv.c
index c571d63..1cdbaa8 100644
--- a/gcc/config/frv/frv.c
+++ b/gcc/config/frv/frv.c
@@ -28,6 +28,7 @@ along with GCC; see the file COPYING3. If not see
#include "memmodel.h"
#include "tm_p.h"
#include "stringpool.h"
+#include "attribs.h"
#include "optabs.h"
#include "regs.h"
#include "emit-rtl.h"
diff --git a/gcc/config/ft32/ft32.c b/gcc/config/ft32/ft32.c
index db0365e..78c5edc 100644
--- a/gcc/config/ft32/ft32.c
+++ b/gcc/config/ft32/ft32.c
@@ -25,6 +25,8 @@
#include "target.h"
#include "rtl.h"
#include "tree.h"
+#include "stringpool.h"
+#include "attribs.h"
#include "df.h"
#include "memmodel.h"
#include "tm_p.h"
diff --git a/gcc/config/h8300/h8300.c b/gcc/config/h8300/h8300.c
index acdeded..0e0bb57 100644
--- a/gcc/config/h8300/h8300.c
+++ b/gcc/config/h8300/h8300.c
@@ -30,6 +30,7 @@ along with GCC; see the file COPYING3. If not see
#include "memmodel.h"
#include "tm_p.h"
#include "stringpool.h"
+#include "attribs.h"
#include "optabs.h"
#include "regs.h"
#include "emit-rtl.h"
diff --git a/gcc/config/i386/winnt.c b/gcc/config/i386/winnt.c
index 8272c7f..405f74a 100644
--- a/gcc/config/i386/winnt.c
+++ b/gcc/config/i386/winnt.c
@@ -30,6 +30,7 @@ along with GCC; see the file COPYING3. If not see
#include "memmodel.h"
#include "tm_p.h"
#include "stringpool.h"
+#include "attribs.h"
#include "emit-rtl.h"
#include "cgraph.h"
#include "lto-streamer.h"
diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c
index c8e4c74..79c323f 100644
--- a/gcc/config/ia64/ia64.c
+++ b/gcc/config/ia64/ia64.c
@@ -31,6 +31,7 @@ along with GCC; see the file COPYING3. If not see
#include "df.h"
#include "tm_p.h"
#include "stringpool.h"
+#include "attribs.h"
#include "optabs.h"
#include "regs.h"
#include "emit-rtl.h"
diff --git a/gcc/config/iq2000/iq2000.c b/gcc/config/iq2000/iq2000.c
index 99abd76..5a92164 100644
--- a/gcc/config/iq2000/iq2000.c
+++ b/gcc/config/iq2000/iq2000.c
@@ -24,6 +24,8 @@ along with GCC; see the file COPYING3. If not see
#include "target.h"
#include "rtl.h"
#include "tree.h"
+#include "stringpool.h"
+#include "attribs.h"
#include "df.h"
#include "memmodel.h"
#include "tm_p.h"
diff --git a/gcc/config/lm32/lm32.c b/gcc/config/lm32/lm32.c
index 2231412..214cc0a 100644
--- a/gcc/config/lm32/lm32.c
+++ b/gcc/config/lm32/lm32.c
@@ -26,6 +26,8 @@
#include "target.h"
#include "rtl.h"
#include "tree.h"
+#include "stringpool.h"
+#include "attribs.h"
#include "df.h"
#include "memmodel.h"
#include "tm_p.h"
diff --git a/gcc/config/m32r/m32r.c b/gcc/config/m32r/m32r.c
index 4efb4b9..d7893d7 100644
--- a/gcc/config/m32r/m32r.c
+++ b/gcc/config/m32r/m32r.c
@@ -28,6 +28,7 @@
#include "memmodel.h"
#include "tm_p.h"
#include "stringpool.h"
+#include "attribs.h"
#include "insn-config.h"
#include "emit-rtl.h"
#include "recog.h"
diff --git a/gcc/config/m68k/m68k.c b/gcc/config/m68k/m68k.c
index c14ce86..8972665 100644
--- a/gcc/config/m68k/m68k.c
+++ b/gcc/config/m68k/m68k.c
@@ -23,6 +23,8 @@ along with GCC; see the file COPYING3. If not see
#include "backend.h"
#include "cfghooks.h"
#include "tree.h"
+#include "stringpool.h"
+#include "attribs.h"
#include "rtl.h"
#include "df.h"
#include "alias.h"
diff --git a/gcc/config/mcore/mcore.c b/gcc/config/mcore/mcore.c
index c4b7c4c..e67376f 100644
--- a/gcc/config/mcore/mcore.c
+++ b/gcc/config/mcore/mcore.c
@@ -28,6 +28,7 @@
#include "memmodel.h"
#include "tm_p.h"
#include "stringpool.h"
+#include "attribs.h"
#include "emit-rtl.h"
#include "diagnostic-core.h"
#include "stor-layout.h"
diff --git a/gcc/config/microblaze/microblaze.c b/gcc/config/microblaze/microblaze.c
index 15ceac0..2cdd240 100644
--- a/gcc/config/microblaze/microblaze.c
+++ b/gcc/config/microblaze/microblaze.c
@@ -26,6 +26,8 @@
#include "target.h"
#include "rtl.h"
#include "tree.h"
+#include "stringpool.h"
+#include "attribs.h"
#include "df.h"
#include "memmodel.h"
#include "tm_p.h"
diff --git a/gcc/config/mmix/mmix.c b/gcc/config/mmix/mmix.c
index 9849c19..6ca2fd9 100644
--- a/gcc/config/mmix/mmix.c
+++ b/gcc/config/mmix/mmix.c
@@ -25,6 +25,8 @@ along with GCC; see the file COPYING3. If not see
#include "target.h"
#include "rtl.h"
#include "tree.h"
+#include "stringpool.h"
+#include "attribs.h"
#include "df.h"
#include "memmodel.h"
#include "tm_p.h"
diff --git a/gcc/config/mn10300/mn10300.c b/gcc/config/mn10300/mn10300.c
index 301207f..f46caac 100644
--- a/gcc/config/mn10300/mn10300.c
+++ b/gcc/config/mn10300/mn10300.c
@@ -25,6 +25,8 @@
#include "target.h"
#include "rtl.h"
#include "tree.h"
+#include "stringpool.h"
+#include "attribs.h"
#include "cfghooks.h"
#include "cfgloop.h"
#include "df.h"
diff --git a/gcc/config/moxie/moxie.c b/gcc/config/moxie/moxie.c
index 70d6d7e..19cd83f 100644
--- a/gcc/config/moxie/moxie.c
+++ b/gcc/config/moxie/moxie.c
@@ -25,6 +25,8 @@
#include "target.h"
#include "rtl.h"
#include "tree.h"
+#include "stringpool.h"
+#include "attribs.h"
#include "df.h"
#include "regs.h"
#include "memmodel.h"
diff --git a/gcc/config/msp430/msp430.c b/gcc/config/msp430/msp430.c
index 6acab1e..1ab79a7 100644
--- a/gcc/config/msp430/msp430.c
+++ b/gcc/config/msp430/msp430.c
@@ -25,6 +25,8 @@
#include "target.h"
#include "rtl.h"
#include "tree.h"
+#include "stringpool.h"
+#include "attribs.h"
#include "gimple-expr.h"
#include "df.h"
#include "memmodel.h"
diff --git a/gcc/config/nds32/nds32-isr.c b/gcc/config/nds32/nds32-isr.c
index 29e94d0..7d7b9e2 100644
--- a/gcc/config/nds32/nds32-isr.c
+++ b/gcc/config/nds32/nds32-isr.c
@@ -27,6 +27,8 @@
#include "target.h"
#include "rtl.h"
#include "tree.h"
+#include "stringpool.h"
+#include "attribs.h"
#include "diagnostic-core.h"
#include "output.h"
diff --git a/gcc/config/nds32/nds32.c b/gcc/config/nds32/nds32.c
index 705d223..14310de 100644
--- a/gcc/config/nds32/nds32.c
+++ b/gcc/config/nds32/nds32.c
@@ -27,6 +27,8 @@
#include "target.h"
#include "rtl.h"
#include "tree.h"
+#include "stringpool.h"
+#include "attribs.h"
#include "df.h"
#include "memmodel.h"
#include "tm_p.h"
diff --git a/gcc/config/nios2/nios2.c b/gcc/config/nios2/nios2.c
index 2fc9a08..884b1dc 100644
--- a/gcc/config/nios2/nios2.c
+++ b/gcc/config/nios2/nios2.c
@@ -27,6 +27,8 @@
#include "target.h"
#include "rtl.h"
#include "tree.h"
+#include "stringpool.h"
+#include "attribs.h"
#include "df.h"
#include "memmodel.h"
#include "tm_p.h"
diff --git a/gcc/config/nvptx/nvptx.c b/gcc/config/nvptx/nvptx.c
index dddb952..ffd50d7 100644
--- a/gcc/config/nvptx/nvptx.c
+++ b/gcc/config/nvptx/nvptx.c
@@ -62,6 +62,7 @@
#include "internal-fn.h"
#include "gimple-iterator.h"
#include "stringpool.h"
+#include "attribs.h"
#include "tree-vrp.h"
#include "tree-ssa-operands.h"
#include "tree-ssanames.h"
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index 2a78018..52f76cf 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -29,6 +29,7 @@ along with GCC; see the file COPYING3. If not see
#include "df.h"
#include "tm_p.h"
#include "stringpool.h"
+#include "attribs.h"
#include "optabs.h"
#include "regs.h"
#include "emit-rtl.h"
diff --git a/gcc/config/pdp11/pdp11.c b/gcc/config/pdp11/pdp11.c
index c2ce6e8..fbbb343 100644
--- a/gcc/config/pdp11/pdp11.c
+++ b/gcc/config/pdp11/pdp11.c
@@ -25,6 +25,8 @@ along with GCC; see the file COPYING3. If not see
#include "target.h"
#include "rtl.h"
#include "tree.h"
+#include "stringpool.h"
+#include "attribs.h"
#include "df.h"
#include "memmodel.h"
#include "tm_p.h"
diff --git a/gcc/config/powerpcspe/powerpcspe.c b/gcc/config/powerpcspe/powerpcspe.c
index b94afd5..f284089 100644
--- a/gcc/config/powerpcspe/powerpcspe.c
+++ b/gcc/config/powerpcspe/powerpcspe.c
@@ -31,6 +31,7 @@
#include "df.h"
#include "tm_p.h"
#include "stringpool.h"
+#include "attribs.h"
#include "expmed.h"
#include "optabs.h"
#include "regs.h"
diff --git a/gcc/config/riscv/riscv.c b/gcc/config/riscv/riscv.c
index 57b2edb..cbf2f79 100644
--- a/gcc/config/riscv/riscv.c
+++ b/gcc/config/riscv/riscv.c
@@ -31,6 +31,8 @@ along with GCC; see the file COPYING3. If not see
#include "output.h"
#include "alias.h"
#include "tree.h"
+#include "stringpool.h"
+#include "attribs.h"
#include "varasm.h"
#include "stor-layout.h"
#include "calls.h"
diff --git a/gcc/config/rx/rx.c b/gcc/config/rx/rx.c
index 9d512b8..daae27b 100644
--- a/gcc/config/rx/rx.c
+++ b/gcc/config/rx/rx.c
@@ -29,6 +29,8 @@
#include "target.h"
#include "rtl.h"
#include "tree.h"
+#include "stringpool.h"
+#include "attribs.h"
#include "cfghooks.h"
#include "df.h"
#include "memmodel.h"
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index 9f422c8..deced95 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -35,6 +35,7 @@ along with GCC; see the file COPYING3. If not see
#include "memmodel.h"
#include "tm_p.h"
#include "stringpool.h"
+#include "attribs.h"
#include "expmed.h"
#include "optabs.h"
#include "regs.h"
diff --git a/gcc/config/sol2.c b/gcc/config/sol2.c
index cdabf24..b8ef340 100644
--- a/gcc/config/sol2.c
+++ b/gcc/config/sol2.c
@@ -27,6 +27,7 @@ along with GCC; see the file COPYING3. If not see
#include "memmodel.h"
#include "tm_p.h"
#include "stringpool.h"
+#include "attribs.h"
#include "diagnostic-core.h"
#include "varasm.h"
#include "output.h"
diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c
index 59761aa..d494ecf2 100644
--- a/gcc/config/sparc/sparc.c
+++ b/gcc/config/sparc/sparc.c
@@ -32,6 +32,7 @@ along with GCC; see the file COPYING3. If not see
#include "df.h"
#include "tm_p.h"
#include "stringpool.h"
+#include "attribs.h"
#include "expmed.h"
#include "optabs.h"
#include "regs.h"
diff --git a/gcc/config/spu/spu.c b/gcc/config/spu/spu.c
index ec20bd6..b6d03d7 100644
--- a/gcc/config/spu/spu.c
+++ b/gcc/config/spu/spu.c
@@ -28,6 +28,7 @@
#include "memmodel.h"
#include "tm_p.h"
#include "stringpool.h"
+#include "attribs.h"
#include "expmed.h"
#include "optabs.h"
#include "regs.h"
diff --git a/gcc/config/stormy16/stormy16.c b/gcc/config/stormy16/stormy16.c
index aee7742..1a36252 100644
--- a/gcc/config/stormy16/stormy16.c
+++ b/gcc/config/stormy16/stormy16.c
@@ -25,6 +25,8 @@
#include "target.h"
#include "rtl.h"
#include "tree.h"
+#include "stringpool.h"
+#include "attribs.h"
#include "gimple.h"
#include "df.h"
#include "memmodel.h"
diff --git a/gcc/config/tilegx/tilegx.c b/gcc/config/tilegx/tilegx.c
index dafb49d..81559ac 100644
--- a/gcc/config/tilegx/tilegx.c
+++ b/gcc/config/tilegx/tilegx.c
@@ -30,6 +30,7 @@
#include "df.h"
#include "tm_p.h"
#include "stringpool.h"
+#include "attribs.h"
#include "expmed.h"
#include "optabs.h"
#include "regs.h"
diff --git a/gcc/config/tilepro/tilepro.c b/gcc/config/tilepro/tilepro.c
index 80475b9..f03f067 100644
--- a/gcc/config/tilepro/tilepro.c
+++ b/gcc/config/tilepro/tilepro.c
@@ -30,6 +30,7 @@
#include "memmodel.h"
#include "tm_p.h"
#include "stringpool.h"
+#include "attribs.h"
#include "expmed.h"
#include "optabs.h"
#include "regs.h"
diff --git a/gcc/config/vax/vax.c b/gcc/config/vax/vax.c
index 864eaeb..fad4849 100644
--- a/gcc/config/vax/vax.c
+++ b/gcc/config/vax/vax.c
@@ -24,6 +24,8 @@ along with GCC; see the file COPYING3. If not see
#include "target.h"
#include "rtl.h"
#include "tree.h"
+#include "stringpool.h"
+#include "attribs.h"
#include "df.h"
#include "memmodel.h"
#include "tm_p.h"
diff --git a/gcc/config/visium/visium.c b/gcc/config/visium/visium.c
index e5d843e..2c5b673 100644
--- a/gcc/config/visium/visium.c
+++ b/gcc/config/visium/visium.c
@@ -30,6 +30,7 @@
#include "memmodel.h"
#include "tm_p.h"
#include "stringpool.h"
+#include "attribs.h"
#include "expmed.h"
#include "optabs.h"
#include "regs.h"
diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c
index cf9a3a7..7c36e68 100644
--- a/gcc/config/xtensa/xtensa.c
+++ b/gcc/config/xtensa/xtensa.c
@@ -31,6 +31,7 @@ along with GCC; see the file COPYING3. If not see
#include "memmodel.h"
#include "tm_p.h"
#include "stringpool.h"
+#include "attribs.h"
#include "optabs.h"
#include "regs.h"
#include "emit-rtl.h"
diff --git a/gcc/convert.c b/gcc/convert.c
index 58d8054..b1a53af 100644
--- a/gcc/convert.c
+++ b/gcc/convert.c
@@ -33,6 +33,8 @@ along with GCC; see the file COPYING3. If not see
#include "langhooks.h"
#include "builtins.h"
#include "ubsan.h"
+#include "stringpool.h"
+#include "attribs.h"
#include "asan.h"
#define maybe_fold_build1_loc(FOLD_P, LOC, CODE, TYPE, EXPR) \
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 2e7f77a..23f6a1d 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,14 @@
+2017-08-08 Martin Liska <mliska@suse.cz>
+
+ * call.c: Include header files.
+ * cp-gimplify.c: Likewise.
+ * cp-ubsan.c: Likewise.
+ * cvt.c: Likewise.
+ * init.c: Likewise.
+ * search.c: Likewise.
+ * semantics.c: Likewise.
+ * typeck.c: Likewise.
+
2017-08-07 Martin Liska <mliska@suse.cz>
* parser.c (cp_parser_gnu_attribute_list): Canonicalize name of an
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index f633fa5..fdd3731 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -39,6 +39,8 @@ along with GCC; see the file COPYING3. If not see
#include "langhooks.h"
#include "c-family/c-objc.h"
#include "internal-fn.h"
+#include "stringpool.h"
+#include "attribs.h"
/* The various kinds of conversion. */
diff --git a/gcc/cp/cp-gimplify.c b/gcc/cp/cp-gimplify.c
index a9563b1..528e388 100644
--- a/gcc/cp/cp-gimplify.c
+++ b/gcc/cp/cp-gimplify.c
@@ -33,6 +33,8 @@ along with GCC; see the file COPYING3. If not see
#include "c-family/c-ubsan.h"
#include "cilk.h"
#include "cp-cilkplus.h"
+#include "stringpool.h"
+#include "attribs.h"
#include "asan.h"
/* Forward declarations. */
diff --git a/gcc/cp/cp-ubsan.c b/gcc/cp/cp-ubsan.c
index 3be607c..cd2b60a 100644
--- a/gcc/cp/cp-ubsan.c
+++ b/gcc/cp/cp-ubsan.c
@@ -23,6 +23,8 @@ along with GCC; see the file COPYING3. If not see
#include "coretypes.h"
#include "cp-tree.h"
#include "ubsan.h"
+#include "stringpool.h"
+#include "attribs.h"
#include "asan.h"
/* Test if we should instrument vptr access. */
diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c
index 631ff49..fd758d3 100644
--- a/gcc/cp/cvt.c
+++ b/gcc/cp/cvt.c
@@ -33,6 +33,8 @@ along with GCC; see the file COPYING3. If not see
#include "flags.h"
#include "intl.h"
#include "convert.h"
+#include "stringpool.h"
+#include "attribs.h"
static tree convert_to_pointer_force (tree, tree, tsubst_flags_t);
static tree build_type_conversion (tree, tree);
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index 3fe8f18..81804112 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -30,6 +30,8 @@ along with GCC; see the file COPYING3. If not see
#include "gimplify.h"
#include "c-family/c-ubsan.h"
#include "intl.h"
+#include "stringpool.h"
+#include "attribs.h"
#include "asan.h"
static bool begin_init_stmts (tree *, tree *);
diff --git a/gcc/cp/search.c b/gcc/cp/search.c
index 469a88b..ced82da 100644
--- a/gcc/cp/search.c
+++ b/gcc/cp/search.c
@@ -28,6 +28,8 @@ along with GCC; see the file COPYING3. If not see
#include "intl.h"
#include "toplev.h"
#include "spellcheck-tree.h"
+#include "stringpool.h"
+#include "attribs.h"
static int is_subobject_of_p (tree, tree);
static tree dfs_lookup_base (tree, void *);
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index f56d00f..5401e78 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -40,6 +40,8 @@ along with GCC; see the file COPYING3. If not see
#include "tree-iterator.h"
#include "omp-general.h"
#include "convert.h"
+#include "stringpool.h"
+#include "attribs.h"
#include "gomp-constants.h"
#include "predict.h"
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index a58de1d..074dae2 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -37,6 +37,8 @@ along with GCC; see the file COPYING3. If not see
#include "c-family/c-ubsan.h"
#include "params.h"
#include "gcc-rich-location.h"
+#include "stringpool.h"
+#include "attribs.h"
#include "asan.h"
static tree cp_build_addr_expr_strict (tree, tsubst_flags_t);
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 4a3b3c1..8e42227 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -92,6 +92,8 @@ along with GCC; see the file COPYING3. If not see
#include "tree-dfa.h"
#include "gdb/gdb-index.h"
#include "rtl-iter.h"
+#include "stringpool.h"
+#include "attribs.h"
static void dwarf2out_source_line (unsigned int, unsigned int, const char *,
int, bool);
diff --git a/gcc/final.c b/gcc/final.c
index 2a24f4f..ad999f7 100644
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -76,6 +76,8 @@ along with GCC; see the file COPYING3. If not see
#include "tree-ssa.h"
#include "cfgloop.h"
#include "params.h"
+#include "stringpool.h"
+#include "attribs.h"
#include "asan.h"
#include "rtl-iter.h"
#include "print-rtl.h"
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 8eaea6c..5a118ca 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -79,6 +79,8 @@ along with GCC; see the file COPYING3. If not see
#include "tree-vrp.h"
#include "tree-ssanames.h"
#include "selftest.h"
+#include "stringpool.h"
+#include "attribs.h"
/* Nonzero if we are folding constants inside an initializer; zero
otherwise. */
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index e52bd06..09138ab4 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,7 @@
+2017-08-08 Martin Liska <mliska@suse.cz>
+
+ * trans-types.c: Include header files.
+
2017-08-07 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/68829
diff --git a/gcc/fortran/trans-types.c b/gcc/fortran/trans-types.c
index 8617cd5..76ee97b 100644
--- a/gcc/fortran/trans-types.c
+++ b/gcc/fortran/trans-types.c
@@ -36,6 +36,7 @@ along with GCC; see the file COPYING3. If not see
#include "trans-types.h"
#include "trans-const.h"
#include "dwarf2out.h" /* For struct array_descr_info. */
+#include "attribs.h"
#if (GFC_MAX_DIMENSIONS < 10)
diff --git a/gcc/function.c b/gcc/function.c
index 86f1484..20c287b 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -77,6 +77,8 @@ along with GCC; see the file COPYING3. If not see
#include "rtl-chkp.h"
#include "tree-dfa.h"
#include "tree-ssa.h"
+#include "stringpool.h"
+#include "attribs.h"
/* So we can assign to cfun in this file. */
#undef cfun
diff --git a/gcc/gimple-expr.c b/gcc/gimple-expr.c
index 13e55ef..c1771fc 100644
--- a/gcc/gimple-expr.c
+++ b/gcc/gimple-expr.c
@@ -35,6 +35,8 @@ along with GCC; see the file COPYING3. If not see
#include "hash-set.h"
#include "rtl.h"
#include "tree-pass.h"
+#include "stringpool.h"
+#include "attribs.h"
/* ----- Type related ----- */
diff --git a/gcc/gimple-fold.c b/gcc/gimple-fold.c
index d82d060..251446c 100644
--- a/gcc/gimple-fold.c
+++ b/gcc/gimple-fold.c
@@ -56,6 +56,8 @@ along with GCC; see the file COPYING3. If not see
#include "ipa-chkp.h"
#include "tree-cfg.h"
#include "fold-const-call.h"
+#include "stringpool.h"
+#include "attribs.h"
#include "asan.h"
/* Return true when DECL can be referenced from current unit.
diff --git a/gcc/gimple-pretty-print.c b/gcc/gimple-pretty-print.c
index 8b69b72..5727d14 100644
--- a/gcc/gimple-pretty-print.c
+++ b/gcc/gimple-pretty-print.c
@@ -38,6 +38,8 @@ along with GCC; see the file COPYING3. If not see
#include "value-prof.h"
#include "trans-mem.h"
#include "cfganal.h"
+#include "stringpool.h"
+#include "attribs.h"
#include "asan.h"
#define INDENT(SPACE) \
diff --git a/gcc/gimple.c b/gcc/gimple.c
index 3a32b53..c4e6f81 100644
--- a/gcc/gimple.c
+++ b/gcc/gimple.c
@@ -41,6 +41,8 @@ along with GCC; see the file COPYING3. If not see
#include "builtins.h"
#include "selftest.h"
#include "gimple-pretty-print.h"
+#include "stringpool.h"
+#include "attribs.h"
#include "asan.h"
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index ed2ec64..86623e0 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -60,6 +60,8 @@ along with GCC; see the file COPYING3. If not see
#include "gimple-walk.h"
#include "langhooks-def.h" /* FIXME: for lhd_set_decl_assembler_name */
#include "builtins.h"
+#include "stringpool.h"
+#include "attribs.h"
#include "asan.h"
#include "dbgcnt.h"
diff --git a/gcc/hsa-common.c b/gcc/hsa-common.c
index 95636eb..c8c12af 100644
--- a/gcc/hsa-common.c
+++ b/gcc/hsa-common.c
@@ -40,6 +40,8 @@ along with GCC; see the file COPYING3. If not see
#include "internal-fn.h"
#include "ctype.h"
#include "builtins.h"
+#include "stringpool.h"
+#include "attribs.h"
/* Structure containing intermediate HSA representation of the generated
function. */
diff --git a/gcc/hsa-gen.c b/gcc/hsa-gen.c
index 6ec8c34..bd22762 100644
--- a/gcc/hsa-gen.c
+++ b/gcc/hsa-gen.c
@@ -60,6 +60,8 @@ along with GCC; see the file COPYING3. If not see
#include "internal-fn.h"
#include "builtins.h"
#include "stor-layout.h"
+#include "stringpool.h"
+#include "attribs.h"
/* Print a warning message and set that we have seen an error. */
diff --git a/gcc/internal-fn.c b/gcc/internal-fn.c
index e24ed16..2b72367 100644
--- a/gcc/internal-fn.c
+++ b/gcc/internal-fn.c
@@ -39,6 +39,8 @@ along with GCC; see the file COPYING3. If not see
#include "stor-layout.h"
#include "dojump.h"
#include "expr.h"
+#include "stringpool.h"
+#include "attribs.h"
#include "asan.h"
#include "ubsan.h"
#include "recog.h"
diff --git a/gcc/ipa-chkp.c b/gcc/ipa-chkp.c
index 753673c..704ef6e 100644
--- a/gcc/ipa-chkp.c
+++ b/gcc/ipa-chkp.c
@@ -34,6 +34,8 @@ along with GCC; see the file COPYING3. If not see
#include "tree-chkp.h"
#include "tree-inline.h"
#include "ipa-chkp.h"
+#include "stringpool.h"
+#include "attribs.h"
/* Pointer Bounds Checker has two IPA passes to support code instrumentation.
diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c
index 3b9eab4..6b3d8d7 100644
--- a/gcc/ipa-cp.c
+++ b/gcc/ipa-cp.c
@@ -122,6 +122,8 @@ along with GCC; see the file COPYING3. If not see
#include "ipa-fnsummary.h"
#include "ipa-utils.h"
#include "tree-ssa-ccp.h"
+#include "stringpool.h"
+#include "attribs.h"
template <typename valtype> class ipcp_value;
diff --git a/gcc/ipa-devirt.c b/gcc/ipa-devirt.c
index 9781acd..f0aecfb 100644
--- a/gcc/ipa-devirt.c
+++ b/gcc/ipa-devirt.c
@@ -129,6 +129,8 @@ along with GCC; see the file COPYING3. If not see
#include "dbgcnt.h"
#include "gimple-pretty-print.h"
#include "intl.h"
+#include "stringpool.h"
+#include "attribs.h"
/* Hash based set of pairs of types. */
struct type_pair
diff --git a/gcc/ipa-fnsummary.c b/gcc/ipa-fnsummary.c
index 27e8d73..076ccd4 100644
--- a/gcc/ipa-fnsummary.c
+++ b/gcc/ipa-fnsummary.c
@@ -82,6 +82,8 @@ along with GCC; see the file COPYING3. If not see
#include "cilk.h"
#include "cfgexpand.h"
#include "gimplify.h"
+#include "stringpool.h"
+#include "attribs.h"
/* Summaries. */
function_summary <ipa_fn_summary *> *ipa_fn_summaries;
diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c
index 608db8f..dd46cb6 100644
--- a/gcc/ipa-inline.c
+++ b/gcc/ipa-inline.c
@@ -117,6 +117,8 @@ along with GCC; see the file COPYING3. If not see
#include "auto-profile.h"
#include "builtins.h"
#include "fibonacci_heap.h"
+#include "stringpool.h"
+#include "attribs.h"
#include "asan.h"
typedef fibonacci_heap <sreal, cgraph_edge> edge_heap_t;
diff --git a/gcc/ipa-visibility.c b/gcc/ipa-visibility.c
index 3033f20..9980248 100644
--- a/gcc/ipa-visibility.c
+++ b/gcc/ipa-visibility.c
@@ -84,6 +84,8 @@ along with GCC; see the file COPYING3. If not see
#include "calls.h"
#include "varasm.h"
#include "ipa-utils.h"
+#include "stringpool.h"
+#include "attribs.h"
/* Return true when NODE can not be local. Worker for cgraph_local_node_p. */
diff --git a/gcc/ipa.c b/gcc/ipa.c
index 00cd308..16df4ca 100644
--- a/gcc/ipa.c
+++ b/gcc/ipa.c
@@ -37,7 +37,8 @@ along with GCC; see the file COPYING3. If not see
#include "ipa-fnsummary.h"
#include "dbgcnt.h"
#include "debug.h"
-
+#include "stringpool.h"
+#include "attribs.h"
/* Return true when NODE has ADDR reference. */
diff --git a/gcc/lto-cgraph.c b/gcc/lto-cgraph.c
index e268027..15f0eaa 100644
--- a/gcc/lto-cgraph.c
+++ b/gcc/lto-cgraph.c
@@ -38,6 +38,8 @@ along with GCC; see the file COPYING3. If not see
#include "ipa-utils.h"
#include "omp-offload.h"
#include "ipa-chkp.h"
+#include "stringpool.h"
+#include "attribs.h"
/* True when asm nodes has been output. */
bool asm_nodes_output = false;
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog
index 9861e98..cd9de758 100644
--- a/gcc/lto/ChangeLog
+++ b/gcc/lto/ChangeLog
@@ -1,3 +1,8 @@
+2017-08-08 Martin Liska <mliska@suse.cz>
+
+ * lto-lang.c: Include header files.
+ * lto-symtab.c: Likewise.
+
2017-08-03 Richard Biener <rguenther@suse.de>
* lto-symtab.h (lto_symtab_prevail_decl): Do not use
diff --git a/gcc/lto/lto-lang.c b/gcc/lto/lto-lang.c
index 6e9a138..375cdd1 100644
--- a/gcc/lto/lto-lang.c
+++ b/gcc/lto/lto-lang.c
@@ -35,6 +35,8 @@ along with GCC; see the file COPYING3. If not see
#include "lto-tree.h"
#include "lto.h"
#include "cilk.h"
+#include "stringpool.h"
+#include "attribs.h"
static tree handle_noreturn_attribute (tree *, tree, tree, int, bool *);
static tree handle_leaf_attribute (tree *, tree, tree, int, bool *);
diff --git a/gcc/lto/lto-symtab.c b/gcc/lto/lto-symtab.c
index 019677e..70190d0 100644
--- a/gcc/lto/lto-symtab.c
+++ b/gcc/lto/lto-symtab.c
@@ -32,6 +32,8 @@ along with GCC; see the file COPYING3. If not see
#include "builtins.h"
#include "alias.h"
#include "lto-symtab.h"
+#include "stringpool.h"
+#include "attribs.h"
/* Replace the cgraph node NODE with PREVAILING_NODE in the cgraph, merging
all edges and removing the old node. */
diff --git a/gcc/objc/ChangeLog b/gcc/objc/ChangeLog
index 27bb060..5d632a6 100644
--- a/gcc/objc/ChangeLog
+++ b/gcc/objc/ChangeLog
@@ -1,3 +1,9 @@
+2017-08-08 Martin Liska <mliska@suse.cz>
+
+ * objc-gnu-runtime-abi-01.c: Include header files.
+ * objc-next-runtime-abi-01.c: Likewise.
+ * objc-next-runtime-abi-02.c: Likewise.
+
2017-07-20 Nathan Sidwell <nathan@acm.org>
Remove TYPE_METHODS.
diff --git a/gcc/objc/objc-gnu-runtime-abi-01.c b/gcc/objc/objc-gnu-runtime-abi-01.c
index d1686e6..b53d182 100644
--- a/gcc/objc/objc-gnu-runtime-abi-01.c
+++ b/gcc/objc/objc-gnu-runtime-abi-01.c
@@ -22,7 +22,9 @@ along with GCC; see the file COPYING3. If not see
#include "system.h"
#include "coretypes.h"
#include "options.h"
+#include "tree.h"
#include "stringpool.h"
+#include "attribs.h"
#ifdef OBJCPLUS
#include "cp/cp-tree.h"
diff --git a/gcc/objc/objc-next-runtime-abi-01.c b/gcc/objc/objc-next-runtime-abi-01.c
index 7aff788..686d928 100644
--- a/gcc/objc/objc-next-runtime-abi-01.c
+++ b/gcc/objc/objc-next-runtime-abi-01.c
@@ -26,7 +26,9 @@ along with GCC; see the file COPYING3. If not see
#include "config.h"
#include "system.h"
#include "coretypes.h"
+#include "tree.h"
#include "stringpool.h"
+#include "attribs.h"
#ifdef OBJCPLUS
#include "cp/cp-tree.h"
diff --git a/gcc/objc/objc-next-runtime-abi-02.c b/gcc/objc/objc-next-runtime-abi-02.c
index 9731486..a2245a4 100644
--- a/gcc/objc/objc-next-runtime-abi-02.c
+++ b/gcc/objc/objc-next-runtime-abi-02.c
@@ -28,7 +28,9 @@ along with GCC; see the file COPYING3. If not see
#include "config.h"
#include "system.h"
#include "coretypes.h"
+#include "tree.h"
#include "stringpool.h"
+#include "attribs.h"
#ifdef OBJCPLUS
#include "cp/cp-tree.h"
diff --git a/gcc/omp-expand.c b/gcc/omp-expand.c
index 0f63507..ac83ba1 100644
--- a/gcc/omp-expand.c
+++ b/gcc/omp-expand.c
@@ -58,7 +58,8 @@ along with GCC; see the file COPYING3. If not see
#include "gimple-pretty-print.h"
#include "hsa-common.h"
#include "debug.h"
-
+#include "stringpool.h"
+#include "attribs.h"
/* OMP region information. Every parallel and workshare
directive is enclosed between two markers, the OMP_* directive
diff --git a/gcc/omp-general.c b/gcc/omp-general.c
index ed94668..af955bc 100644
--- a/gcc/omp-general.c
+++ b/gcc/omp-general.c
@@ -33,7 +33,8 @@ along with GCC; see the file COPYING3. If not see
#include "fold-const.h"
#include "langhooks.h"
#include "omp-general.h"
-
+#include "stringpool.h"
+#include "attribs.h"
tree
omp_find_clause (tree clauses, enum omp_clause_code kind)
diff --git a/gcc/omp-low.c b/gcc/omp-low.c
index 2e0973e..3df6056 100644
--- a/gcc/omp-low.c
+++ b/gcc/omp-low.c
@@ -58,6 +58,8 @@ along with GCC; see the file COPYING3. If not see
#include "gomp-constants.h"
#include "gimple-pretty-print.h"
#include "hsa-common.h"
+#include "stringpool.h"
+#include "attribs.h"
/* Lowering of OMP parallel and workshare constructs proceeds in two
phases. The first phase scans the function looking for OMP statements
diff --git a/gcc/omp-offload.c b/gcc/omp-offload.c
index 54a4e90..2d4fd41 100644
--- a/gcc/omp-offload.c
+++ b/gcc/omp-offload.c
@@ -49,6 +49,8 @@ along with GCC; see the file COPYING3. If not see
#include "gomp-constants.h"
#include "gimple-pretty-print.h"
#include "intl.h"
+#include "stringpool.h"
+#include "attribs.h"
/* Describe the OpenACC looping structure of a function. The entire
function is held in a 'NULL' loop. */
diff --git a/gcc/omp-simd-clone.c b/gcc/omp-simd-clone.c
index fbb122c..0a3a386 100644
--- a/gcc/omp-simd-clone.c
+++ b/gcc/omp-simd-clone.c
@@ -48,7 +48,8 @@ along with GCC; see the file COPYING3. If not see
#include "ipa-prop.h"
#include "tree-eh.h"
#include "varasm.h"
-
+#include "stringpool.h"
+#include "attribs.h"
/* Allocate a fresh `simd_clone' and return it. NARGS is the number
of arguments to reserve space for. */
diff --git a/gcc/opts-global.c b/gcc/opts-global.c
index 50bad77..fc55512 100644
--- a/gcc/opts-global.c
+++ b/gcc/opts-global.c
@@ -35,6 +35,8 @@ along with GCC; see the file COPYING3. If not see
#include "plugin.h"
#include "toplev.h"
#include "context.h"
+#include "stringpool.h"
+#include "attribs.h"
#include "asan.h"
typedef const char *const_char_p; /* For DEF_VEC_P. */
diff --git a/gcc/passes.c b/gcc/passes.c
index f5791ac..2c9add8 100644
--- a/gcc/passes.c
+++ b/gcc/passes.c
@@ -61,6 +61,8 @@ along with GCC; see the file COPYING3. If not see
#include "tree-cfgcleanup.h"
#include "insn-addr.h" /* for INSN_ADDRESSES_ALLOC. */
#include "diagnostic-core.h" /* for fnotice */
+#include "stringpool.h"
+#include "attribs.h"
using namespace gcc;
diff --git a/gcc/predict.c b/gcc/predict.c
index 609c099..80c2c19 100644
--- a/gcc/predict.c
+++ b/gcc/predict.c
@@ -59,6 +59,8 @@ along with GCC; see the file COPYING3. If not see
#include "gimple-pretty-print.h"
#include "selftest.h"
#include "cfgrtl.h"
+#include "stringpool.h"
+#include "attribs.h"
/* Enum with reasons why a predictor is ignored. */
diff --git a/gcc/sancov.c b/gcc/sancov.c
index 1651989..b19de8b 100644
--- a/gcc/sancov.c
+++ b/gcc/sancov.c
@@ -32,6 +32,8 @@ along with GCC; see the file COPYING3. If not see
#include "tree-cfg.h"
#include "tree-pass.h"
#include "tree-iterator.h"
+#include "stringpool.h"
+#include "attribs.h"
#include "asan.h"
namespace {
diff --git a/gcc/sanopt.c b/gcc/sanopt.c
index f6dd14d..d17c7db 100644
--- a/gcc/sanopt.c
+++ b/gcc/sanopt.c
@@ -30,6 +30,8 @@ along with GCC; see the file COPYING3. If not see
#include "gimple-pretty-print.h"
#include "fold-const.h"
#include "gimple-iterator.h"
+#include "stringpool.h"
+#include "attribs.h"
#include "asan.h"
#include "ubsan.h"
#include "params.h"
diff --git a/gcc/symtab.c b/gcc/symtab.c
index 0145910..7e5eb7d 100644
--- a/gcc/symtab.c
+++ b/gcc/symtab.c
@@ -35,6 +35,8 @@ along with GCC; see the file COPYING3. If not see
#include "output.h"
#include "ipa-utils.h"
#include "calls.h"
+#include "stringpool.h"
+#include "attribs.h"
static const char *ipa_ref_use_name[] = {"read","write","addr","alias","chkp"};
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 48a79e2..d23714c 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -63,6 +63,8 @@ along with GCC; see the file COPYING3. If not see
#include "hosthooks.h"
#include "opts.h"
#include "opts-diagnostic.h"
+#include "stringpool.h"
+#include "attribs.h"
#include "asan.h"
#include "tsan.h"
#include "plugin.h"
diff --git a/gcc/trans-mem.c b/gcc/trans-mem.c
index eb03560..40b5368 100644
--- a/gcc/trans-mem.c
+++ b/gcc/trans-mem.c
@@ -50,7 +50,8 @@
#include "langhooks.h"
#include "cfgloop.h"
#include "tree-ssa-address.h"
-
+#include "stringpool.h"
+#include "attribs.h"
#define A_RUNINSTRUMENTEDCODE 0x0001
#define A_RUNUNINSTRUMENTEDCODE 0x0002
diff --git a/gcc/tree-chkp.c b/gcc/tree-chkp.c
index e241f50..12af458 100644
--- a/gcc/tree-chkp.c
+++ b/gcc/tree-chkp.c
@@ -52,6 +52,8 @@ along with GCC; see the file COPYING3. If not see
#include "tree-dfa.h"
#include "ipa-chkp.h"
#include "params.h"
+#include "stringpool.h"
+#include "attribs.h"
/* Pointer Bounds Checker instruments code with memory checks to find
out-of-bounds memory accesses. Checks are performed by computing
diff --git a/gcc/tree-eh.c b/gcc/tree-eh.c
index c68d71a..9381979 100644
--- a/gcc/tree-eh.c
+++ b/gcc/tree-eh.c
@@ -43,6 +43,8 @@ along with GCC; see the file COPYING3. If not see
#include "langhooks.h"
#include "cfgloop.h"
#include "gimple-low.h"
+#include "stringpool.h"
+#include "attribs.h"
#include "asan.h"
/* In some instances a tree and a gimple need to be stored in a same table,
diff --git a/gcc/tree-into-ssa.c b/gcc/tree-into-ssa.c
index d405637..28f72e4 100644
--- a/gcc/tree-into-ssa.c
+++ b/gcc/tree-into-ssa.c
@@ -38,6 +38,8 @@ along with GCC; see the file COPYING3. If not see
#include "tree-ssa.h"
#include "domwalk.h"
#include "statistics.h"
+#include "stringpool.h"
+#include "attribs.h"
#include "asan.h"
#define PERCENT(x,y) ((float)(x) * 100.0 / (float)(y))
diff --git a/gcc/tree-object-size.c b/gcc/tree-object-size.c
index 723a528..a56b78a 100644
--- a/gcc/tree-object-size.c
+++ b/gcc/tree-object-size.c
@@ -32,6 +32,8 @@ along with GCC; see the file COPYING3. If not see
#include "gimple-fold.h"
#include "gimple-iterator.h"
#include "tree-cfg.h"
+#include "stringpool.h"
+#include "attribs.h"
struct object_size_info
{
diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c
index 59e261d..cfc143f 100644
--- a/gcc/tree-parloops.c
+++ b/gcc/tree-parloops.c
@@ -58,6 +58,8 @@ along with GCC; see the file COPYING3. If not see
#include "tree-eh.h"
#include "gomp-constants.h"
#include "tree-dfa.h"
+#include "stringpool.h"
+#include "attribs.h"
/* This pass tries to distribute iterations of loops into several threads.
The implementation is straightforward -- for each loop we test whether its
diff --git a/gcc/tree-profile.c b/gcc/tree-profile.c
index b1ee7f2..4b73255 100644
--- a/gcc/tree-profile.c
+++ b/gcc/tree-profile.c
@@ -50,6 +50,8 @@ along with GCC; see the file COPYING3. If not see
#include "profile.h"
#include "tree-cfgcleanup.h"
#include "params.h"
+#include "stringpool.h"
+#include "attribs.h"
static GTY(()) tree gcov_type_node;
static GTY(()) tree tree_interval_profiler_fn;
diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c
index f18f2e0..3940d53 100644
--- a/gcc/tree-ssa-ccp.c
+++ b/gcc/tree-ssa-ccp.c
@@ -145,6 +145,8 @@ along with GCC; see the file COPYING3. If not see
#include "tree-ssa-ccp.h"
#include "tree-dfa.h"
#include "diagnostic-core.h"
+#include "stringpool.h"
+#include "attribs.h"
/* Possible lattice values. */
typedef enum
diff --git a/gcc/tree-ssa-live.c b/gcc/tree-ssa-live.c
index c77075e..8738fe2 100644
--- a/gcc/tree-ssa-live.c
+++ b/gcc/tree-ssa-live.c
@@ -38,6 +38,8 @@ along with GCC; see the file COPYING3. If not see
#include "tree-ssa.h"
#include "ipa-utils.h"
#include "cfgloop.h"
+#include "stringpool.h"
+#include "attribs.h"
static void verify_live_on_entry (tree_live_info_p);
diff --git a/gcc/tree-ssa-loop.c b/gcc/tree-ssa-loop.c
index 19a0f30..1e84917 100644
--- a/gcc/tree-ssa-loop.c
+++ b/gcc/tree-ssa-loop.c
@@ -38,6 +38,8 @@ along with GCC; see the file COPYING3. If not see
#include "tree-vectorizer.h"
#include "omp-general.h"
#include "diagnostic-core.h"
+#include "stringpool.h"
+#include "attribs.h"
/* A pass making sure loops are fixed up. */
diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c
index ca43f01..d62a49d 100644
--- a/gcc/tree-ssa-sccvn.c
+++ b/gcc/tree-ssa-sccvn.c
@@ -60,6 +60,8 @@ along with GCC; see the file COPYING3. If not see
#include "domwalk.h"
#include "gimple-iterator.h"
#include "gimple-match.h"
+#include "stringpool.h"
+#include "attribs.h"
/* This algorithm is based on the SCC algorithm presented by Keith
Cooper and L. Taylor Simpson in "SCC-Based Value numbering"
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c
index e743e35..c120ce4 100644
--- a/gcc/tree-ssa-structalias.c
+++ b/gcc/tree-ssa-structalias.c
@@ -40,7 +40,8 @@
#include "params.h"
#include "gimple-walk.h"
#include "varasm.h"
-
+#include "stringpool.h"
+#include "attribs.h"
/* The idea behind this analyzer is to generate set constraints from the
program, then solve the resulting constraints in order to generate the
diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c
index a67012c..8b6da96 100644
--- a/gcc/tree-ssa.c
+++ b/gcc/tree-ssa.c
@@ -41,6 +41,8 @@ along with GCC; see the file COPYING3. If not see
#include "cfgexpand.h"
#include "tree-cfg.h"
#include "tree-dfa.h"
+#include "stringpool.h"
+#include "attribs.h"
#include "asan.h"
/* Pointer map of variable mappings, keyed by edge. */
diff --git a/gcc/tree-streamer-in.c b/gcc/tree-streamer-in.c
index eb41e75..6004700 100644
--- a/gcc/tree-streamer-in.c
+++ b/gcc/tree-streamer-in.c
@@ -32,6 +32,8 @@ along with GCC; see the file COPYING3. If not see
#include "builtins.h"
#include "ipa-chkp.h"
#include "gomp-constants.h"
+#include "stringpool.h"
+#include "attribs.h"
#include "asan.h"
#include "opts.h"
diff --git a/gcc/tree-vectorizer.c b/gcc/tree-vectorizer.c
index 129129f..feddfa2 100644
--- a/gcc/tree-vectorizer.c
+++ b/gcc/tree-vectorizer.c
@@ -76,6 +76,8 @@ along with GCC; see the file COPYING3. If not see
#include "tree-ssa-propagate.h"
#include "dbgcnt.h"
#include "tree-scalar-evolution.h"
+#include "stringpool.h"
+#include "attribs.h"
/* Loop or bb location. */
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index 79a29bf..657a8d1 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -62,6 +62,8 @@ along with GCC; see the file COPYING3. If not see
#include "alloc-pool.h"
#include "domwalk.h"
#include "tree-cfgcleanup.h"
+#include "stringpool.h"
+#include "attribs.h"
#define VR_INITIALIZER { VR_UNDEFINED, NULL_TREE, NULL_TREE, NULL }
diff --git a/gcc/tree.c b/gcc/tree.c
index 2b65cb1..c493edd 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -62,6 +62,8 @@ along with GCC; see the file COPYING3. If not see
#include "print-tree.h"
#include "ipa-utils.h"
#include "selftest.h"
+#include "stringpool.h"
+#include "attribs.h"
/* Tree code classes. */
@@ -4822,254 +4824,6 @@ protected_set_expr_location (tree t, location_t loc)
SET_EXPR_LOCATION (t, loc);
}
-/* Return a declaration like DDECL except that its DECL_ATTRIBUTES
- is ATTRIBUTE. */
-
-tree
-build_decl_attribute_variant (tree ddecl, tree attribute)
-{
- DECL_ATTRIBUTES (ddecl) = attribute;
- return ddecl;
-}
-
-/* Return a type like TTYPE except that its TYPE_ATTRIBUTE
- is ATTRIBUTE and its qualifiers are QUALS.
-
- Record such modified types already made so we don't make duplicates. */
-
-tree
-build_type_attribute_qual_variant (tree ttype, tree attribute, int quals)
-{
- if (! attribute_list_equal (TYPE_ATTRIBUTES (ttype), attribute))
- {
- tree ntype;
-
- /* Building a distinct copy of a tagged type is inappropriate; it
- causes breakage in code that expects there to be a one-to-one
- relationship between a struct and its fields.
- build_duplicate_type is another solution (as used in
- handle_transparent_union_attribute), but that doesn't play well
- with the stronger C++ type identity model. */
- if (TREE_CODE (ttype) == RECORD_TYPE
- || TREE_CODE (ttype) == UNION_TYPE
- || TREE_CODE (ttype) == QUAL_UNION_TYPE
- || TREE_CODE (ttype) == ENUMERAL_TYPE)
- {
- warning (OPT_Wattributes,
- "ignoring attributes applied to %qT after definition",
- TYPE_MAIN_VARIANT (ttype));
- return build_qualified_type (ttype, quals);
- }
-
- ttype = build_qualified_type (ttype, TYPE_UNQUALIFIED);
- ntype = build_distinct_type_copy (ttype);
-
- TYPE_ATTRIBUTES (ntype) = attribute;
-
- hashval_t hash = type_hash_canon_hash (ntype);
- ntype = type_hash_canon (hash, ntype);
-
- /* If the target-dependent attributes make NTYPE different from
- its canonical type, we will need to use structural equality
- checks for this type. */
- if (TYPE_STRUCTURAL_EQUALITY_P (ttype)
- || !comp_type_attributes (ntype, ttype))
- SET_TYPE_STRUCTURAL_EQUALITY (ntype);
- else if (TYPE_CANONICAL (ntype) == ntype)
- TYPE_CANONICAL (ntype) = TYPE_CANONICAL (ttype);
-
- ttype = build_qualified_type (ntype, quals);
- }
- else if (TYPE_QUALS (ttype) != quals)
- ttype = build_qualified_type (ttype, quals);
-
- return ttype;
-}
-
-/* Check if "omp declare simd" attribute arguments, CLAUSES1 and CLAUSES2, are
- the same. */
-
-static bool
-omp_declare_simd_clauses_equal (tree clauses1, tree clauses2)
-{
- tree cl1, cl2;
- for (cl1 = clauses1, cl2 = clauses2;
- cl1 && cl2;
- cl1 = OMP_CLAUSE_CHAIN (cl1), cl2 = OMP_CLAUSE_CHAIN (cl2))
- {
- if (OMP_CLAUSE_CODE (cl1) != OMP_CLAUSE_CODE (cl2))
- return false;
- if (OMP_CLAUSE_CODE (cl1) != OMP_CLAUSE_SIMDLEN)
- {
- if (simple_cst_equal (OMP_CLAUSE_DECL (cl1),
- OMP_CLAUSE_DECL (cl2)) != 1)
- return false;
- }
- switch (OMP_CLAUSE_CODE (cl1))
- {
- case OMP_CLAUSE_ALIGNED:
- if (simple_cst_equal (OMP_CLAUSE_ALIGNED_ALIGNMENT (cl1),
- OMP_CLAUSE_ALIGNED_ALIGNMENT (cl2)) != 1)
- return false;
- break;
- case OMP_CLAUSE_LINEAR:
- if (simple_cst_equal (OMP_CLAUSE_LINEAR_STEP (cl1),
- OMP_CLAUSE_LINEAR_STEP (cl2)) != 1)
- return false;
- break;
- case OMP_CLAUSE_SIMDLEN:
- if (simple_cst_equal (OMP_CLAUSE_SIMDLEN_EXPR (cl1),
- OMP_CLAUSE_SIMDLEN_EXPR (cl2)) != 1)
- return false;
- default:
- break;
- }
- }
- return true;
-}
-
-/* Compare two constructor-element-type constants. Return 1 if the lists
- are known to be equal; otherwise return 0. */
-
-static bool
-simple_cst_list_equal (const_tree l1, const_tree l2)
-{
- while (l1 != NULL_TREE && l2 != NULL_TREE)
- {
- if (simple_cst_equal (TREE_VALUE (l1), TREE_VALUE (l2)) != 1)
- return false;
-
- l1 = TREE_CHAIN (l1);
- l2 = TREE_CHAIN (l2);
- }
-
- return l1 == l2;
-}
-
-/* Compare two identifier nodes representing attributes.
- Return true if they are the same, false otherwise. */
-
-static bool
-cmp_attrib_identifiers (const_tree attr1, const_tree attr2)
-{
- /* Make sure we're dealing with IDENTIFIER_NODEs. */
- gcc_checking_assert (TREE_CODE (attr1) == IDENTIFIER_NODE
- && TREE_CODE (attr2) == IDENTIFIER_NODE);
-
- /* Identifiers can be compared directly for equality. */
- if (attr1 == attr2)
- return true;
-
- return cmp_attribs (IDENTIFIER_POINTER (attr1), IDENTIFIER_LENGTH (attr1),
- IDENTIFIER_POINTER (attr2), IDENTIFIER_LENGTH (attr2));
-}
-
-/* Compare two attributes for their value identity. Return true if the
- attribute values are known to be equal; otherwise return false. */
-
-bool
-attribute_value_equal (const_tree attr1, const_tree attr2)
-{
- if (TREE_VALUE (attr1) == TREE_VALUE (attr2))
- return true;
-
- if (TREE_VALUE (attr1) != NULL_TREE
- && TREE_CODE (TREE_VALUE (attr1)) == TREE_LIST
- && TREE_VALUE (attr2) != NULL_TREE
- && TREE_CODE (TREE_VALUE (attr2)) == TREE_LIST)
- {
- /* Handle attribute format. */
- if (is_attribute_p ("format", get_attribute_name (attr1)))
- {
- attr1 = TREE_VALUE (attr1);
- attr2 = TREE_VALUE (attr2);
- /* Compare the archetypes (printf/scanf/strftime/...). */
- if (!cmp_attrib_identifiers (TREE_VALUE (attr1),
- TREE_VALUE (attr2)))
- return false;
- /* Archetypes are the same. Compare the rest. */
- return (simple_cst_list_equal (TREE_CHAIN (attr1),
- TREE_CHAIN (attr2)) == 1);
- }
- return (simple_cst_list_equal (TREE_VALUE (attr1),
- TREE_VALUE (attr2)) == 1);
- }
-
- if ((flag_openmp || flag_openmp_simd)
- && TREE_VALUE (attr1) && TREE_VALUE (attr2)
- && TREE_CODE (TREE_VALUE (attr1)) == OMP_CLAUSE
- && TREE_CODE (TREE_VALUE (attr2)) == OMP_CLAUSE)
- return omp_declare_simd_clauses_equal (TREE_VALUE (attr1),
- TREE_VALUE (attr2));
-
- return (simple_cst_equal (TREE_VALUE (attr1), TREE_VALUE (attr2)) == 1);
-}
-
-/* Return 0 if the attributes for two types are incompatible, 1 if they
- are compatible, and 2 if they are nearly compatible (which causes a
- warning to be generated). */
-int
-comp_type_attributes (const_tree type1, const_tree type2)
-{
- const_tree a1 = TYPE_ATTRIBUTES (type1);
- const_tree a2 = TYPE_ATTRIBUTES (type2);
- const_tree a;
-
- if (a1 == a2)
- return 1;
- for (a = a1; a != NULL_TREE; a = TREE_CHAIN (a))
- {
- const struct attribute_spec *as;
- const_tree attr;
-
- as = lookup_attribute_spec (get_attribute_name (a));
- if (!as || as->affects_type_identity == false)
- continue;
-
- attr = lookup_attribute (as->name, CONST_CAST_TREE (a2));
- if (!attr || !attribute_value_equal (a, attr))
- break;
- }
- if (!a)
- {
- for (a = a2; a != NULL_TREE; a = TREE_CHAIN (a))
- {
- const struct attribute_spec *as;
-
- as = lookup_attribute_spec (get_attribute_name (a));
- if (!as || as->affects_type_identity == false)
- continue;
-
- if (!lookup_attribute (as->name, CONST_CAST_TREE (a1)))
- break;
- /* We don't need to compare trees again, as we did this
- already in first loop. */
- }
- /* All types - affecting identity - are equal, so
- there is no need to call target hook for comparison. */
- if (!a)
- return 1;
- }
- if (lookup_attribute ("transaction_safe", CONST_CAST_TREE (a)))
- return 0;
- /* As some type combinations - like default calling-convention - might
- be compatible, we have to call the target hook to get the final result. */
- return targetm.comp_type_attributes (type1, type2);
-}
-
-/* Return a type like TTYPE except that its TYPE_ATTRIBUTE
- is ATTRIBUTE.
-
- Record such modified types already made so we don't make duplicates. */
-
-tree
-build_type_attribute_variant (tree ttype, tree attribute)
-{
- return build_type_attribute_qual_variant (ttype, attribute,
- TYPE_QUALS (ttype));
-}
-
-
/* Reset the expression *EXPR_P, a size or position.
??? We could reset all non-constant sizes or positions. But it's cheap
@@ -6023,379 +5777,6 @@ make_pass_ipa_free_lang_data (gcc::context *ctxt)
{
return new pass_ipa_free_lang_data (ctxt);
}
-
-/* The backbone of lookup_attribute(). ATTR_LEN is the string length
- of ATTR_NAME, and LIST is not NULL_TREE. */
-tree
-private_lookup_attribute (const char *attr_name, size_t attr_len, tree list)
-{
- while (list)
- {
- tree attr = get_attribute_name (list);
- size_t ident_len = IDENTIFIER_LENGTH (attr);
- if (cmp_attribs (attr_name, attr_len, IDENTIFIER_POINTER (attr),
- ident_len))
- break;
- list = TREE_CHAIN (list);
- }
-
- return list;
-}
-
-/* Given an attribute name ATTR_NAME and a list of attributes LIST,
- return a pointer to the attribute's list first element if the attribute
- starts with ATTR_NAME. */
-
-tree
-private_lookup_attribute_by_prefix (const char *attr_name, size_t attr_len,
- tree list)
-{
- while (list)
- {
- size_t ident_len = IDENTIFIER_LENGTH (get_attribute_name (list));
-
- if (attr_len > ident_len)
- {
- list = TREE_CHAIN (list);
- continue;
- }
-
- const char *p = IDENTIFIER_POINTER (get_attribute_name (list));
- gcc_checking_assert (attr_len == 0 || p[0] != '_');
-
- if (strncmp (attr_name, p, attr_len) == 0)
- break;
-
- list = TREE_CHAIN (list);
- }
-
- return list;
-}
-
-
-/* A variant of lookup_attribute() that can be used with an identifier
- as the first argument, and where the identifier can be either
- 'text' or '__text__'.
-
- Given an attribute ATTR_IDENTIFIER, and a list of attributes LIST,
- return a pointer to the attribute's list element if the attribute
- is part of the list, or NULL_TREE if not found. If the attribute
- appears more than once, this only returns the first occurrence; the
- TREE_CHAIN of the return value should be passed back in if further
- occurrences are wanted. ATTR_IDENTIFIER must be an identifier but
- can be in the form 'text' or '__text__'. */
-static tree
-lookup_ident_attribute (tree attr_identifier, tree list)
-{
- gcc_checking_assert (TREE_CODE (attr_identifier) == IDENTIFIER_NODE);
-
- while (list)
- {
- gcc_checking_assert (TREE_CODE (get_attribute_name (list))
- == IDENTIFIER_NODE);
-
- if (cmp_attrib_identifiers (attr_identifier,
- get_attribute_name (list)))
- /* Found it. */
- break;
- list = TREE_CHAIN (list);
- }
-
- return list;
-}
-
-/* Remove any instances of attribute ATTR_NAME in LIST and return the
- modified list. */
-
-tree
-remove_attribute (const char *attr_name, tree list)
-{
- tree *p;
- gcc_checking_assert (attr_name[0] != '_');
-
- for (p = &list; *p; )
- {
- tree l = *p;
-
- tree attr = get_attribute_name (l);
- if (is_attribute_p (attr_name, attr))
- *p = TREE_CHAIN (l);
- else
- p = &TREE_CHAIN (l);
- }
-
- return list;
-}
-
-/* Return an attribute list that is the union of a1 and a2. */
-
-tree
-merge_attributes (tree a1, tree a2)
-{
- tree attributes;
-
- /* Either one unset? Take the set one. */
-
- if ((attributes = a1) == 0)
- attributes = a2;
-
- /* One that completely contains the other? Take it. */
-
- else if (a2 != 0 && ! attribute_list_contained (a1, a2))
- {
- if (attribute_list_contained (a2, a1))
- attributes = a2;
- else
- {
- /* Pick the longest list, and hang on the other list. */
-
- if (list_length (a1) < list_length (a2))
- attributes = a2, a2 = a1;
-
- for (; a2 != 0; a2 = TREE_CHAIN (a2))
- {
- tree a;
- for (a = lookup_ident_attribute (get_attribute_name (a2),
- attributes);
- a != NULL_TREE && !attribute_value_equal (a, a2);
- a = lookup_ident_attribute (get_attribute_name (a2),
- TREE_CHAIN (a)))
- ;
- if (a == NULL_TREE)
- {
- a1 = copy_node (a2);
- TREE_CHAIN (a1) = attributes;
- attributes = a1;
- }
- }
- }
- }
- return attributes;
-}
-
-/* Given types T1 and T2, merge their attributes and return
- the result. */
-
-tree
-merge_type_attributes (tree t1, tree t2)
-{
- return merge_attributes (TYPE_ATTRIBUTES (t1),
- TYPE_ATTRIBUTES (t2));
-}
-
-/* Given decls OLDDECL and NEWDECL, merge their attributes and return
- the result. */
-
-tree
-merge_decl_attributes (tree olddecl, tree newdecl)
-{
- return merge_attributes (DECL_ATTRIBUTES (olddecl),
- DECL_ATTRIBUTES (newdecl));
-}
-
-#if TARGET_DLLIMPORT_DECL_ATTRIBUTES
-
-/* Specialization of merge_decl_attributes for various Windows targets.
-
- This handles the following situation:
-
- __declspec (dllimport) int foo;
- int foo;
-
- The second instance of `foo' nullifies the dllimport. */
-
-tree
-merge_dllimport_decl_attributes (tree old, tree new_tree)
-{
- tree a;
- int delete_dllimport_p = 1;
-
- /* What we need to do here is remove from `old' dllimport if it doesn't
- appear in `new'. dllimport behaves like extern: if a declaration is
- marked dllimport and a definition appears later, then the object
- is not dllimport'd. We also remove a `new' dllimport if the old list
- contains dllexport: dllexport always overrides dllimport, regardless
- of the order of declaration. */
- if (!VAR_OR_FUNCTION_DECL_P (new_tree))
- delete_dllimport_p = 0;
- else if (DECL_DLLIMPORT_P (new_tree)
- && lookup_attribute ("dllexport", DECL_ATTRIBUTES (old)))
- {
- DECL_DLLIMPORT_P (new_tree) = 0;
- warning (OPT_Wattributes, "%q+D already declared with dllexport attribute: "
- "dllimport ignored", new_tree);
- }
- else if (DECL_DLLIMPORT_P (old) && !DECL_DLLIMPORT_P (new_tree))
- {
- /* Warn about overriding a symbol that has already been used, e.g.:
- extern int __attribute__ ((dllimport)) foo;
- int* bar () {return &foo;}
- int foo;
- */
- if (TREE_USED (old))
- {
- warning (0, "%q+D redeclared without dllimport attribute "
- "after being referenced with dll linkage", new_tree);
- /* If we have used a variable's address with dllimport linkage,
- keep the old DECL_DLLIMPORT_P flag: the ADDR_EXPR using the
- decl may already have had TREE_CONSTANT computed.
- We still remove the attribute so that assembler code refers
- to '&foo rather than '_imp__foo'. */
- if (VAR_P (old) && TREE_ADDRESSABLE (old))
- DECL_DLLIMPORT_P (new_tree) = 1;
- }
-
- /* Let an inline definition silently override the external reference,
- but otherwise warn about attribute inconsistency. */
- else if (VAR_P (new_tree) || !DECL_DECLARED_INLINE_P (new_tree))
- warning (OPT_Wattributes, "%q+D redeclared without dllimport attribute: "
- "previous dllimport ignored", new_tree);
- }
- else
- delete_dllimport_p = 0;
-
- a = merge_attributes (DECL_ATTRIBUTES (old), DECL_ATTRIBUTES (new_tree));
-
- if (delete_dllimport_p)
- a = remove_attribute ("dllimport", a);
-
- return a;
-}
-
-/* Handle a "dllimport" or "dllexport" attribute; arguments as in
- struct attribute_spec.handler. */
-
-tree
-handle_dll_attribute (tree * pnode, tree name, tree args, int flags,
- bool *no_add_attrs)
-{
- tree node = *pnode;
- bool is_dllimport;
-
- /* These attributes may apply to structure and union types being created,
- but otherwise should pass to the declaration involved. */
- if (!DECL_P (node))
- {
- if (flags & ((int) ATTR_FLAG_DECL_NEXT | (int) ATTR_FLAG_FUNCTION_NEXT
- | (int) ATTR_FLAG_ARRAY_NEXT))
- {
- *no_add_attrs = true;
- return tree_cons (name, args, NULL_TREE);
- }
- if (TREE_CODE (node) == RECORD_TYPE
- || TREE_CODE (node) == UNION_TYPE)
- {
- node = TYPE_NAME (node);
- if (!node)
- return NULL_TREE;
- }
- else
- {
- warning (OPT_Wattributes, "%qE attribute ignored",
- name);
- *no_add_attrs = true;
- return NULL_TREE;
- }
- }
-
- if (!VAR_OR_FUNCTION_DECL_P (node) && TREE_CODE (node) != TYPE_DECL)
- {
- *no_add_attrs = true;
- warning (OPT_Wattributes, "%qE attribute ignored",
- name);
- return NULL_TREE;
- }
-
- if (TREE_CODE (node) == TYPE_DECL
- && TREE_CODE (TREE_TYPE (node)) != RECORD_TYPE
- && TREE_CODE (TREE_TYPE (node)) != UNION_TYPE)
- {
- *no_add_attrs = true;
- warning (OPT_Wattributes, "%qE attribute ignored",
- name);
- return NULL_TREE;
- }
-
- is_dllimport = is_attribute_p ("dllimport", name);
-
- /* Report error on dllimport ambiguities seen now before they cause
- any damage. */
- if (is_dllimport)
- {
- /* Honor any target-specific overrides. */
- if (!targetm.valid_dllimport_attribute_p (node))
- *no_add_attrs = true;
-
- else if (TREE_CODE (node) == FUNCTION_DECL
- && DECL_DECLARED_INLINE_P (node))
- {
- warning (OPT_Wattributes, "inline function %q+D declared as "
- " dllimport: attribute ignored", node);
- *no_add_attrs = true;
- }
- /* Like MS, treat definition of dllimported variables and
- non-inlined functions on declaration as syntax errors. */
- else if (TREE_CODE (node) == FUNCTION_DECL && DECL_INITIAL (node))
- {
- error ("function %q+D definition is marked dllimport", node);
- *no_add_attrs = true;
- }
-
- else if (VAR_P (node))
- {
- if (DECL_INITIAL (node))
- {
- error ("variable %q+D definition is marked dllimport",
- node);
- *no_add_attrs = true;
- }
-
- /* `extern' needn't be specified with dllimport.
- Specify `extern' now and hope for the best. Sigh. */
- DECL_EXTERNAL (node) = 1;
- /* Also, implicitly give dllimport'd variables declared within
- a function global scope, unless declared static. */
- if (current_function_decl != NULL_TREE && !TREE_STATIC (node))
- TREE_PUBLIC (node) = 1;
- }
-
- if (*no_add_attrs == false)
- DECL_DLLIMPORT_P (node) = 1;
- }
- else if (TREE_CODE (node) == FUNCTION_DECL
- && DECL_DECLARED_INLINE_P (node)
- && flag_keep_inline_dllexport)
- /* An exported function, even if inline, must be emitted. */
- DECL_EXTERNAL (node) = 0;
-
- /* Report error if symbol is not accessible at global scope. */
- if (!TREE_PUBLIC (node) && VAR_OR_FUNCTION_DECL_P (node))
- {
- error ("external linkage required for symbol %q+D because of "
- "%qE attribute", node, name);
- *no_add_attrs = true;
- }
-
- /* A dllexport'd entity must have default visibility so that other
- program units (shared libraries or the main executable) can see
- it. A dllimport'd entity must have default visibility so that
- the linker knows that undefined references within this program
- unit can be resolved by the dynamic linker. */
- if (!*no_add_attrs)
- {
- if (DECL_VISIBILITY_SPECIFIED (node)
- && DECL_VISIBILITY (node) != VISIBILITY_DEFAULT)
- error ("%qE implies default visibility, but %qD has already "
- "been declared with a different visibility",
- name, node);
- DECL_VISIBILITY (node) = VISIBILITY_DEFAULT;
- DECL_VISIBILITY_SPECIFIED (node) = 1;
- }
-
- return NULL_TREE;
-}
-
-#endif /* TARGET_DLLIMPORT_DECL_ATTRIBUTES */
/* Set the type qualifiers for TYPE to TYPE_QUALS, which is a bitmask
of the various TYPE_QUAL values. */
@@ -7155,68 +6536,6 @@ print_type_hash_statistics (void)
type_hash_table->collisions ());
}
-/* Given two lists of attributes, return true if list l2 is
- equivalent to l1. */
-
-int
-attribute_list_equal (const_tree l1, const_tree l2)
-{
- if (l1 == l2)
- return 1;
-
- return attribute_list_contained (l1, l2)
- && attribute_list_contained (l2, l1);
-}
-
-/* Given two lists of attributes, return true if list L2 is
- completely contained within L1. */
-/* ??? This would be faster if attribute names were stored in a canonicalized
- form. Otherwise, if L1 uses `foo' and L2 uses `__foo__', the long method
- must be used to show these elements are equivalent (which they are). */
-/* ??? It's not clear that attributes with arguments will always be handled
- correctly. */
-
-int
-attribute_list_contained (const_tree l1, const_tree l2)
-{
- const_tree t1, t2;
-
- /* First check the obvious, maybe the lists are identical. */
- if (l1 == l2)
- return 1;
-
- /* Maybe the lists are similar. */
- for (t1 = l1, t2 = l2;
- t1 != 0 && t2 != 0
- && get_attribute_name (t1) == get_attribute_name (t2)
- && TREE_VALUE (t1) == TREE_VALUE (t2);
- t1 = TREE_CHAIN (t1), t2 = TREE_CHAIN (t2))
- ;
-
- /* Maybe the lists are equal. */
- if (t1 == 0 && t2 == 0)
- return 1;
-
- for (; t2 != 0; t2 = TREE_CHAIN (t2))
- {
- const_tree attr;
- /* This CONST_CAST is okay because lookup_attribute does not
- modify its argument and the return value is assigned to a
- const_tree. */
- for (attr = lookup_ident_attribute (get_attribute_name (t2),
- CONST_CAST_TREE (l1));
- attr != NULL_TREE && !attribute_value_equal (t2, attr);
- attr = lookup_ident_attribute (get_attribute_name (t2),
- TREE_CHAIN (attr)))
- ;
-
- if (attr == NULL_TREE)
- return 0;
- }
-
- return 1;
-}
-
/* Given two lists of types
(chains of TREE_LIST nodes with types in the TREE_VALUE slots)
return 1 if the lists contain the same types in the same order.
diff --git a/gcc/tree.h b/gcc/tree.h
index 1e89809..46debc1 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -4088,8 +4088,6 @@ extern tree purpose_member (const_tree, tree);
extern bool vec_member (const_tree, vec<tree, va_gc> *);
extern tree chain_index (int, tree);
-extern int attribute_list_equal (const_tree, const_tree);
-extern int attribute_list_contained (const_tree, const_tree);
extern int tree_int_cst_equal (const_tree, const_tree);
extern bool tree_fits_shwi_p (const_tree)
@@ -4127,90 +4125,6 @@ extern bool valid_constant_size_p (const_tree);
extern tree make_tree (tree, rtx);
-/* Return a type like TTYPE except that its TYPE_ATTRIBUTES
- is ATTRIBUTE.
-
- Such modified types already made are recorded so that duplicates
- are not made. */
-
-extern tree build_type_attribute_variant (tree, tree);
-extern tree build_decl_attribute_variant (tree, tree);
-extern tree build_type_attribute_qual_variant (tree, tree, int);
-
-extern bool attribute_value_equal (const_tree, const_tree);
-
-/* Return 0 if the attributes for two types are incompatible, 1 if they
- are compatible, and 2 if they are nearly compatible (which causes a
- warning to be generated). */
-extern int comp_type_attributes (const_tree, const_tree);
-
-/* Default versions of target-overridable functions. */
-extern tree merge_decl_attributes (tree, tree);
-extern tree merge_type_attributes (tree, tree);
-
-/* This function is a private implementation detail of lookup_attribute()
- and you should never call it directly. */
-extern tree private_lookup_attribute (const char *, size_t, tree);
-
-/* This function is a private implementation detail
- of lookup_attribute_by_prefix() and you should never call it directly. */
-extern tree private_lookup_attribute_by_prefix (const char *, size_t, tree);
-
-/* Given an attribute name ATTR_NAME and a list of attributes LIST,
- return a pointer to the attribute's list element if the attribute
- is part of the list, or NULL_TREE if not found. If the attribute
- appears more than once, this only returns the first occurrence; the
- TREE_CHAIN of the return value should be passed back in if further
- occurrences are wanted. ATTR_NAME must be in the form 'text' (not
- '__text__'). */
-
-static inline tree
-lookup_attribute (const char *attr_name, tree list)
-{
- gcc_checking_assert (attr_name[0] != '_');
- /* In most cases, list is NULL_TREE. */
- if (list == NULL_TREE)
- return NULL_TREE;
- else
- /* Do the strlen() before calling the out-of-line implementation.
- In most cases attr_name is a string constant, and the compiler
- will optimize the strlen() away. */
- return private_lookup_attribute (attr_name, strlen (attr_name), list);
-}
-
-/* Given an attribute name ATTR_NAME and a list of attributes LIST,
- return a pointer to the attribute's list first element if the attribute
- starts with ATTR_NAME. ATTR_NAME must be in the form 'text' (not
- '__text__'). */
-
-static inline tree
-lookup_attribute_by_prefix (const char *attr_name, tree list)
-{
- gcc_checking_assert (attr_name[0] != '_');
- /* In most cases, list is NULL_TREE. */
- if (list == NULL_TREE)
- return NULL_TREE;
- else
- return private_lookup_attribute_by_prefix (attr_name, strlen (attr_name),
- list);
-}
-
-/* Remove any instances of attribute ATTR_NAME in LIST and return the
- modified list. */
-
-extern tree remove_attribute (const char *, tree);
-
-/* Given two attributes lists, return a list of their union. */
-
-extern tree merge_attributes (tree, tree);
-
-/* Given two Windows decl attributes lists, possibly including
- dllimport, return a list of their union . */
-extern tree merge_dllimport_decl_attributes (tree, tree);
-
-/* Handle a "dllimport" or "dllexport" attribute. */
-extern tree handle_dll_attribute (tree *, tree, tree, int, bool *);
-
/* Returns true iff CAND and BASE have equivalent language-specific
qualifiers. */
diff --git a/gcc/tsan.c b/gcc/tsan.c
index 2f98b93..51b5821 100644
--- a/gcc/tsan.c
+++ b/gcc/tsan.c
@@ -40,6 +40,8 @@ along with GCC; see the file COPYING3. If not see
#include "tree-ssa-loop-ivopts.h"
#include "tree-eh.h"
#include "tsan.h"
+#include "stringpool.h"
+#include "attribs.h"
#include "asan.h"
#include "builtins.h"
#include "target.h"
diff --git a/gcc/ubsan.c b/gcc/ubsan.c
index 2580a58..49e38fa 100644
--- a/gcc/ubsan.c
+++ b/gcc/ubsan.c
@@ -39,6 +39,8 @@ along with GCC; see the file COPYING3. If not see
#include "cfgloop.h"
#include "ubsan.h"
#include "expr.h"
+#include "stringpool.h"
+#include "attribs.h"
#include "asan.h"
#include "gimplify-me.h"
#include "dfp.h"
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 6eccbe4..e0834a1 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -51,6 +51,8 @@ along with GCC; see the file COPYING3. If not see
#include "langhooks.h"
#include "debug.h"
#include "common/common-target.h"
+#include "stringpool.h"
+#include "attribs.h"
#include "asan.h"
#include "rtl-iter.h"
diff --git a/gcc/varpool.c b/gcc/varpool.c
index ab59c80..b005f52 100644
--- a/gcc/varpool.c
+++ b/gcc/varpool.c
@@ -33,6 +33,8 @@ along with GCC; see the file COPYING3. If not see
#include "output.h"
#include "omp-offload.h"
#include "context.h"
+#include "stringpool.h"
+#include "attribs.h"
const char * const tls_model_names[]={"none", "emulated",
"global-dynamic", "local-dynamic",