From 1236e28bedf61e83042a1c15a7b9ade9417f6ed8 Mon Sep 17 00:00:00 2001 From: fxcoudert Date: Wed, 22 Jul 2009 08:28:10 +0000 Subject: * trans.h (gfc_set_decl_assembler_name): New prototype. * trans-decl.c (gfc_set_decl_assembler_name): New function. (gfc_get_symbol_decl, gfc_get_extern_function_decl, build_function_decl): Use gfc_set_decl_assembler_name instead of SET_DECL_ASSEMBLER_NAME. * trans-common.c (build_common_decl): Use gfc_set_decl_assembler_name instead of SET_DECL_ASSEMBLER_NAME. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@149918 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/trans-common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/fortran/trans-common.c') diff --git a/gcc/fortran/trans-common.c b/gcc/fortran/trans-common.c index f4bbb467bc9..ca94567d633 100644 --- a/gcc/fortran/trans-common.c +++ b/gcc/fortran/trans-common.c @@ -415,7 +415,7 @@ build_common_decl (gfc_common_head *com, tree union_type, bool is_init) { decl = build_decl (input_location, VAR_DECL, get_identifier (com->name), union_type); - SET_DECL_ASSEMBLER_NAME (decl, gfc_sym_mangled_common_id (com)); + gfc_set_decl_assembler_name (decl, gfc_sym_mangled_common_id (com)); TREE_PUBLIC (decl) = 1; TREE_STATIC (decl) = 1; DECL_IGNORED_P (decl) = 1; -- cgit v1.2.1 From eeebe20ba63ca092de5e2d4575b5765dd88a7ce6 Mon Sep 17 00:00:00 2001 From: janus Date: Thu, 13 Aug 2009 19:46:46 +0000 Subject: 2009-08-13 Janus Weil PR fortran/40941 * gfortran.h (gfc_typespec): Put 'derived' and 'cl' into union. * decl.c (build_struct): Make sure 'cl' is only used if type is BT_CHARACTER. * symbol.c (gfc_set_default_type): Ditto. * resolve.c (resolve_symbol, resolve_fl_derived): Ditto. (resolve_equivalence,resolve_equivalence_derived): Make sure 'derived' is only used if type is BT_DERIVED. * trans-io.c (transfer_expr): Make sure 'derived' is only used if type is BT_DERIVED or BT_INTEGER (special case: C_PTR/C_FUNPTR). * array.c: Mechanical replacements to accomodate union in gfc_typespec. * check.c: Ditto. * data.c: Ditto. * decl.c: Ditto. * dump-parse-tree.c: Ditto. * expr.c: Ditto. * interface.c: Ditto. * iresolve.c: Ditto. * match.c: Ditto. * misc.c: Ditto. * module.c: Ditto. * openmp.c: Ditto. * parse.c: Ditto. * primary.c: Ditto. * resolve.c: Ditto. * simplify.c: Ditto. * symbol.c: Ditto. * target-memory.c: Ditto. * trans-array.c: Ditto. * trans-common.c: Ditto. * trans-const.c: Ditto. * trans-decl.c: Ditto. * trans-expr.c: Ditto. * trans-intrinsic.c: Ditto. * trans-io.c: Ditto. * trans-stmt.c: Ditto. * trans-types.c: Ditto. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@150725 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/trans-common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gcc/fortran/trans-common.c') diff --git a/gcc/fortran/trans-common.c b/gcc/fortran/trans-common.c index ca94567d633..5b1952aee4a 100644 --- a/gcc/fortran/trans-common.c +++ b/gcc/fortran/trans-common.c @@ -132,7 +132,7 @@ get_segment_info (gfc_symbol * sym, HOST_WIDE_INT offset) /* Make sure we've got the character length. */ if (sym->ts.type == BT_CHARACTER) - gfc_conv_const_charlen (sym->ts.cl); + gfc_conv_const_charlen (sym->ts.u.cl); /* Create the segment_info and fill it in. */ s = (segment_info *) gfc_getmem (sizeof (segment_info)); @@ -830,7 +830,7 @@ calculate_offset (gfc_expr *e) case AR_ELEMENT: n = element_number (&reference->u.ar); if (element_type->type == BT_CHARACTER) - gfc_conv_const_charlen (element_type->cl); + gfc_conv_const_charlen (element_type->u.cl); element_size = int_size_in_bytes (gfc_typenode_for_spec (element_type)); offset += n * element_size; -- cgit v1.2.1 From e4eb345d1444aecd4974cd7200f45b2e3f700004 Mon Sep 17 00:00:00 2001 From: espindola Date: Wed, 28 Oct 2009 20:44:47 +0000 Subject: 2009-10-28 Rafael Avila de Espindola * trans-common.c (create_common): Set TREE_PUBLIC to false on fake variables. 2009-10-28 Rafael Avila de Espindola * dbxout.c (dbxout_common_check): Accept non public trees. * dwarf2out.c (fortran_common): Accept non public trees. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@153685 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/trans-common.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'gcc/fortran/trans-common.c') diff --git a/gcc/fortran/trans-common.c b/gcc/fortran/trans-common.c index 5b1952aee4a..1fb3c40f113 100644 --- a/gcc/fortran/trans-common.c +++ b/gcc/fortran/trans-common.c @@ -680,7 +680,6 @@ create_common (gfc_common_head *com, segment_info *head, bool saw_equiv) var_decl = build_decl (s->sym->declared_at.lb->location, VAR_DECL, DECL_NAME (s->field), TREE_TYPE (s->field)); - TREE_PUBLIC (var_decl) = TREE_PUBLIC (decl); TREE_STATIC (var_decl) = TREE_STATIC (decl); TREE_USED (var_decl) = TREE_USED (decl); if (s->sym->attr.use_assoc) @@ -689,7 +688,9 @@ create_common (gfc_common_head *com, segment_info *head, bool saw_equiv) TREE_ADDRESSABLE (var_decl) = 1; /* This is a fake variable just for debugging purposes. */ TREE_ASM_WRITTEN (var_decl) = 1; - + /* Fake variables are not visible from other translation units. */ + TREE_PUBLIC (var_decl) = 0; + /* To preserve identifier names in COMMON, chain to procedure scope unless at top level in a module definition. */ if (com -- cgit v1.2.1 From 66a56860076243903465dadec8482f55d32144dc Mon Sep 17 00:00:00 2001 From: jakub Date: Sat, 28 Nov 2009 12:13:21 +0000 Subject: * trans-common.c (create_common): Remove unused offset variable. * io.c (gfc_match_wait): Remove unused loc variable. * trans-openmp.c (gfc_trans_omp_clauses): Remove unused old_clauses variable. (gfc_trans_omp_do): Remove unused outermost variable. * iresolve.c (gfc_resolve_alarm_sub, gfc_resolve_fseek_sub): Remove unused status variable. * module.c (number_use_names): Remove unused c variable. (load_derived_extensions): Remove unused nuse variable. * trans-expr.c (gfc_conv_substring): Remove unused var variable. * trans-types.c (gfc_get_array_descr_info): Remove unused offset_off variable. * matchexp.c (match_primary): Remove unused where variable. * trans-intrinsic.c (gfc_conv_intrinsic_bound): Remove unused cond2 variable. (gfc_conv_intrinsic_sizeof): Remove unused source variable. (gfc_conv_intrinsic_transfer): Remove unused stride variable. (gfc_conv_intrinsic_function): Remove unused isym variable. * arith.c (gfc_hollerith2real, gfc_hollerith2complex, gfc_hollerith2logical): Remove unused len variable. * parse.c (parse_derived): Remove unused derived_sym variable. * decl.c (variable_decl): Remove unused old_locus variable. * resolve.c (check_class_members): Remove unused tbp_sym variable. (resolve_ordinary_assign): Remove unused assign_proc variable. (resolve_equivalence): Remove unused value_name variable. * data.c (get_array_index): Remove unused re variable. * trans-array.c (gfc_conv_array_transpose): Remove unused src_info variable. (gfc_conv_resolve_dependencies): Remove unused aref and temp_dim variables. (gfc_conv_loop_setup): Remove unused dim and len variables. (gfc_walk_variable_expr): Remove unused head variable. * match.c (match_typebound_call): Remove unused var variable. * intrinsic.c (gfc_convert_chartype): Remove unused from_ts variable. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@154722 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/trans-common.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'gcc/fortran/trans-common.c') diff --git a/gcc/fortran/trans-common.c b/gcc/fortran/trans-common.c index 1fb3c40f113..62a2e018210 100644 --- a/gcc/fortran/trans-common.c +++ b/gcc/fortran/trans-common.c @@ -1,5 +1,5 @@ /* Common block and equivalence list handling - Copyright (C) 2000, 2003, 2004, 2005, 2006, 2007, 2008 + Copyright (C) 2000, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. Contributed by Canqun Yang @@ -636,7 +636,6 @@ create_common (gfc_common_head *com, segment_info *head, bool saw_equiv) if (is_init) { tree ctor, tmp; - HOST_WIDE_INT offset = 0; VEC(constructor_elt,gc) *v = NULL; if (field != NULL_TREE && field_init != NULL_TREE) @@ -652,7 +651,6 @@ create_common (gfc_common_head *com, segment_info *head, bool saw_equiv) s->sym->attr.pointer || s->sym->attr.allocatable); CONSTRUCTOR_APPEND_ELT (v, s->field, tmp); - offset = s->offset + s->length; } } -- cgit v1.2.1 From 5d713e67a59aaff7ca333177fd088f5482d9439d Mon Sep 17 00:00:00 2001 From: jakub Date: Thu, 25 Feb 2010 10:50:24 +0000 Subject: PR debug/43166 * cfgexpand.c (expand_debug_expr) : If mode is BLKmode, assert op0 is a MEM and just adjust its mode. * trans-common.c (build_common_decl): Also update DECL_MODE, and DECL_SIZE when encountering a larger common block and call layout_decl. * gfortran.dg/debug/pr43166.f: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@157063 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/trans-common.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'gcc/fortran/trans-common.c') diff --git a/gcc/fortran/trans-common.c b/gcc/fortran/trans-common.c index 62a2e018210..844ac1d2674 100644 --- a/gcc/fortran/trans-common.c +++ b/gcc/fortran/trans-common.c @@ -1,5 +1,5 @@ /* Common block and equivalence list handling - Copyright (C) 2000, 2003, 2004, 2005, 2006, 2007, 2008, 2009 + Copyright (C) 2000, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. Contributed by Canqun Yang @@ -399,8 +399,11 @@ build_common_decl (gfc_common_head *com, tree union_type, bool is_init) if (strcmp (com->name, BLANK_COMMON_NAME)) gfc_warning ("Named COMMON block '%s' at %L shall be of the " "same size", com->name, &com->where); + DECL_SIZE (decl) = TYPE_SIZE (union_type); DECL_SIZE_UNIT (decl) = size; + DECL_MODE (decl) = TYPE_MODE (union_type); TREE_TYPE (decl) = union_type; + layout_decl (decl, 0); } } -- cgit v1.2.1 From 989adef3b44d84f7b46c259ba46911460de87c51 Mon Sep 17 00:00:00 2001 From: steven Date: Thu, 20 May 2010 20:57:45 +0000 Subject: * trans-expr.c: Do not include convert.h, ggc.h, real.h, and gimple.h. (gfc_conv_string_tmp): Do not assert type comparibilty. * trans-array.c: Do not include gimple.h, ggc.h, and real.h. (gfc_conv_expr_descriptor): Remove assert. * trans-common.c: Clarify why rtl.h and tm.h are included. * trans-openmp.c: Do not include ggc.h and real.h. Explain why gimple.h is included. * trans-const.c: Do not include ggc.h. * trans-stmt.c: Do not include gimple.h, ggc.h, and real.h. * trans.c: Do not include ggc.h and real.h. Explain why gimple.h is included. * trans-types.c: Do not include tm.h. Explain why langhooks.h and dwarf2out.h are included. * trans-io.c: Do not include gimple.h and real.h. * trans-decl.c: Explain why gimple.h, tm.h, and rtl.h are included. * trans-intrinsic.c: Do not include gimple.h. Explain why tm.h is included. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159640 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/trans-common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gcc/fortran/trans-common.c') diff --git a/gcc/fortran/trans-common.c b/gcc/fortran/trans-common.c index 844ac1d2674..58811136a0e 100644 --- a/gcc/fortran/trans-common.c +++ b/gcc/fortran/trans-common.c @@ -99,8 +99,8 @@ along with GCC; see the file COPYING3. If not see #include "target.h" #include "tree.h" #include "toplev.h" -#include "tm.h" -#include "rtl.h" +#include "tm.h" /* For rtl.h. */ +#include "rtl.h" /* For decl_default_tls_model. */ #include "gfortran.h" #include "trans.h" #include "trans-types.h" -- cgit v1.2.1 From dca58d219480ce3c10fbc7442128ece6cc724d8f Mon Sep 17 00:00:00 2001 From: burnus Date: Sun, 23 May 2010 17:18:24 +0000 Subject: 2010-05-21 Tobias Burnus * gfortran.h: Do not include system.h. * bbt.c: Include system.h. * data.c: Ditto. * dependency.c: Ditto. * dump-parse-tree.c: Ditto. * arith.h: Do not include gfortran.h. * constructor.h: Do not include gfortran.h and splay-tree.h. * match.h: Do not include gfortran.h. * parse.h: Ditto. * target-memory.h: Ditto. * openmp.c: Do not include toplev.h and target.h. * trans-stmt.c: Ditto not include toplev.h. * primary.c: Ditto. * trans-common.c: Tell why toplev.h is needed. And do not include target.h. * trans-expr.c: Tell why toplev.h is needed. * trans-array.c: Ditto. * trans-openmp.c: Ditto. * trans-const.c: Ditto. * trans.c: Ditto. * trans-types.c: Ditto. * trans-io.c: Ditto. * trans-decl.c: Ditto. * scanner.c: Ditto. * convert.c: Ditto. * trans-intrinsic.c: Ditto. * options.c: Ditto. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159763 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/trans-common.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'gcc/fortran/trans-common.c') diff --git a/gcc/fortran/trans-common.c b/gcc/fortran/trans-common.c index 58811136a0e..f577710949a 100644 --- a/gcc/fortran/trans-common.c +++ b/gcc/fortran/trans-common.c @@ -96,9 +96,8 @@ along with GCC; see the file COPYING3. If not see #include "config.h" #include "system.h" #include "coretypes.h" -#include "target.h" #include "tree.h" -#include "toplev.h" +#include "toplev.h" /* For exact_log2. */ #include "tm.h" /* For rtl.h. */ #include "rtl.h" /* For decl_default_tls_model. */ #include "gfortran.h" -- cgit v1.2.1 From cb4070e00ced433c22465def62435fa9eee5a16e Mon Sep 17 00:00:00 2001 From: steven Date: Wed, 26 May 2010 08:36:49 +0000 Subject: gcc/ChangeLog: * rtl.h (decl_default_tls_model): Move prototype from here... * output.h: ...to here. * c-decl.c: Do not include rtl.h. * c-pragma.c: Likewise. * c-parser.c: Likewise. * c-gimplify.c: Likewise. And also not hard-reg-set. * c-common.c: Do not include rtl.h. Include tm_p.h and add a FIXME note for it. Add a FIXME note for expr.h. * config/i386/i386-protos.h (ix86_enum_va_list, ix86_fn_abi_va_list, ix86_canonical_va_list_type): Make visible even if RTX_CODE is not defined. cp/ChangeLog: * decl.c: Do not include rtl.h * semantics.c: Likewise. ada/ChangeLog: * gcc-interface/utils.c: Do not include rtl.h. fortran/ChangeLog: * trans-common.c: Do not include rtl.h, include output.h instead. * trans-decl.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159856 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/trans-common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gcc/fortran/trans-common.c') diff --git a/gcc/fortran/trans-common.c b/gcc/fortran/trans-common.c index f577710949a..1162636fe5a 100644 --- a/gcc/fortran/trans-common.c +++ b/gcc/fortran/trans-common.c @@ -96,10 +96,10 @@ along with GCC; see the file COPYING3. If not see #include "config.h" #include "system.h" #include "coretypes.h" +#include "tm.h" #include "tree.h" #include "toplev.h" /* For exact_log2. */ -#include "tm.h" /* For rtl.h. */ -#include "rtl.h" /* For decl_default_tls_model. */ +#include "output.h" /* For decl_default_tls_model. */ #include "gfortran.h" #include "trans.h" #include "trans-types.h" -- cgit v1.2.1 From 1767a056f10a2ccbc900df04d01193da73a3d272 Mon Sep 17 00:00:00 2001 From: froydnj Date: Thu, 15 Jul 2010 14:31:28 +0000 Subject: gcc/ * tree.h (DECL_CHAIN): Define. * alias.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * c-decl.c: Likewise. * c-parser.c: Likewise. * c-typeck.c: Likewise. * cfgexpand.c: Likewise. * cgraph.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * config/alpha/alpha.c: Likewise. * config/arm/arm.c: Likewise. * config/frv/frv.c: Likewise. * config/i386/i386.c: Likewise. * config/i386/winnt-cxx.c: Likewise. * config/ia64/ia64.c: Likewise. * config/iq2000/iq2000.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/som.h: Likewise. * config/rs6000/rs6000.c: Likewise. * config/s390/s390.c: Likewise. * config/sh/sh.c: Likewise. * config/sh/symbian-cxx.c: Likewise. * config/sparc/sparc.c: Likewise. * config/spu/spu.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/vxworks.c: Likewise. * config/xtensa/xtensa.c: Likewise. * coverage.c: Likewise. * dbxout.c: Likewise. * dwarf2out.c: Likewise. * emit-rtl.c: Likewise. * expr.c: Likewise. * function.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimplify.c: Likewise. * integrate.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-split.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-type-escape.c: Likewise. * langhooks.c: Likewise. * lto-cgraph.c: Likewise. * omp-low.c: Likewise. * stor-layout.c: Likewise. * tree-cfg.c: Likewise. * tree-complex.c: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-inline.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-object-size.c: Likewise. * tree-pretty-print.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-tailcall.c: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. gcc/ada/ * gcc-interface/decl.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * gcc-interface/trans.c: Likewise. * gcc-interface/utils.c: Likewise. * gcc-interface/utils2.c: Likewise. gcc/c-family/ * c-common.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * c-format.c: Likewise. gcc/cp/ * cp-tree.h: Carefully replace TREE_CHAIN with DECL_CHAIN. * call.c: Likewise. * class.c: Likewise. * cp-gimplify.c: Likewise. * decl.c: Likewise. * decl2.c: Likewise. * init.c: Likewise. * mangle.c: Likewise. * name-lookup.c: Likewise. * optimize.c: Likewise. * parser.c: Likewise. * pt.c: Likewise. * rtti.c: Likewise. * search.c: Likewise. * semantics.c: Likewise. * typeck.c: Likewise. * typeck2.c: Likewise. gcc/fortran/ * f95-lang.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * trans-common.c: Likewise. * trans-decl.c: Likewise. * trans-types.c: Likewise. * trans.c: Likewise. gcc/java/ * java-tree.h: Carefully replace TREE_CHAIN with DECL_CHAIN. * boehm.c: Likewise. * class.c: Likewise. * decl.c: Likewise. * expr.c: Likewise. * jcf-parse.c: Likewise. * typeck.c: Likewise. * verify-glue.c: Likewise. gcc/objc/ * objc-act.c: Carefully replace TREE_CHAIN with DECL_CHAIN. gcc/testsuite/ * g++.dg/plugin/attribute_plugin.c: Carefully replace TREE_CHAIN with DECL_CHAIN. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@162223 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/trans-common.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gcc/fortran/trans-common.c') diff --git a/gcc/fortran/trans-common.c b/gcc/fortran/trans-common.c index 1162636fe5a..a19facb8317 100644 --- a/gcc/fortran/trans-common.c +++ b/gcc/fortran/trans-common.c @@ -432,7 +432,7 @@ build_common_decl (gfc_common_head *com, tree union_type, bool is_init) what C will do. */ tree field = NULL_TREE; field = TYPE_FIELDS (TREE_TYPE (decl)); - if (TREE_CHAIN (field) == NULL_TREE) + if (DECL_CHAIN (field) == NULL_TREE) DECL_ALIGN (decl) = TYPE_ALIGN (TREE_TYPE (field)); } DECL_USER_ALIGN (decl) = 0; @@ -608,7 +608,7 @@ create_common (gfc_common_head *com, segment_info *head, bool saw_equiv) { is_init = true; *field_link = field; - field_link = &TREE_CHAIN (field); + field_link = &DECL_CHAIN (field); } for (s = head; s; s = s->next) @@ -617,7 +617,7 @@ create_common (gfc_common_head *com, segment_info *head, bool saw_equiv) /* Link the field into the type. */ *field_link = s->field; - field_link = &TREE_CHAIN (s->field); + field_link = &DECL_CHAIN (s->field); /* Has initial value. */ if (s->sym->value) -- cgit v1.2.1