* trans.h (struct lang_type): Add span.
(GFC_TYPE_ARRAY_SPAN): Define.
* trans-decl.c (gfc_get_symbol_decl): For subref array pointers,
copy TREE_STATIC from decl to span instead of setting it
unconditionally, set DECL_ARTIFICIAL, fix type of initializer
and set GFC_TYPE_ARRAY_SPAN on decl's type.
* trans-types.c (gfc_get_array_descr_info): If
GFC_TYPE_ARRAY_SPAN is non-NULL, use it as element size.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@139782
138bc75d-0d04-0410-961f-
82ee72b054a4
2008-08-29 Jakub Jelinek <jakub@redhat.com>
+ * dwarf2out.c (descr_info_loc): Handle VAR_DECL.
+
* dwarf2out.c (gen_const_die): New function.
(size_of_die, value_format, output_die): Output larger
dw_val_class_vec using DW_FORM_block2 or DW_FORM_block4.
{
CASE_CONVERT:
return descr_info_loc (TREE_OPERAND (val, 0), base_decl);
+ case VAR_DECL:
+ return loc_descriptor_from_tree_1 (val, 0);
case INTEGER_CST:
if (host_integerp (val, 0))
return int_loc_descriptor (tree_low_cst (val, 0));
2008-08-29 Jakub Jelinek <jakub@redhat.com>
+ * trans.h (struct lang_type): Add span.
+ (GFC_TYPE_ARRAY_SPAN): Define.
+ * trans-decl.c (gfc_get_symbol_decl): For subref array pointers,
+ copy TREE_STATIC from decl to span instead of setting it
+ unconditionally, set DECL_ARTIFICIAL, fix type of initializer
+ and set GFC_TYPE_ARRAY_SPAN on decl's type.
+ * trans-types.c (gfc_get_array_descr_info): If
+ GFC_TYPE_ARRAY_SPAN is non-NULL, use it as element size.
+
* trans-decl.c (check_constant_initializer,
gfc_emit_parameter_debug_info): New functions.
(gfc_generate_module_vars, gfc_generate_function_code): Emit
span = build_decl (VAR_DECL, create_tmp_var_name ("span"),
gfc_array_index_type);
gfc_finish_var_decl (span, sym);
- TREE_STATIC (span) = 1;
- DECL_INITIAL (span) = build_int_cst (NULL_TREE, 0);
+ TREE_STATIC (span) = TREE_STATIC (decl);
+ DECL_ARTIFICIAL (span) = 1;
+ DECL_INITIAL (span) = build_int_cst (gfc_array_index_type, 0);
GFC_DECL_SPAN (decl) = span;
+ GFC_TYPE_ARRAY_SPAN (TREE_TYPE (decl)) = span;
}
sym->backend_decl = decl;
else
info->base_decl = base_decl = build_decl (VAR_DECL, NULL_TREE, ptype);
- elem_size = fold_convert (gfc_array_index_type, TYPE_SIZE_UNIT (etype));
+ if (GFC_TYPE_ARRAY_SPAN (type))
+ elem_size = GFC_TYPE_ARRAY_SPAN (type);
+ else
+ elem_size = fold_convert (gfc_array_index_type, TYPE_SIZE_UNIT (etype));
field = TYPE_FIELDS (TYPE_MAIN_VARIANT (type));
data_off = byte_position (field);
field = TREE_CHAIN (field);
tree offset;
tree dtype;
tree dataptr_type;
+ tree span;
};
struct lang_decl GTY(())
#define GFC_TYPE_ARRAY_DTYPE(node) (TYPE_LANG_SPECIFIC(node)->dtype)
#define GFC_TYPE_ARRAY_DATAPTR_TYPE(node) \
(TYPE_LANG_SPECIFIC(node)->dataptr_type)
+#define GFC_TYPE_ARRAY_SPAN(node) (TYPE_LANG_SPECIFIC(node)->span)
/* Build an expression with void type. */
#define build1_v(code, arg) fold_build1(code, void_type_node, arg)