1. 11 Sep, 2017 17 commits
  2. 10 Sep, 2017 4 commits
    • re PR ada/79441 (gnat.dg/pack9.adb fails) · 2f6c18e0
      	PR ada/79441
      	* gnat.dg/pack9.adb: Robustify.
      
      From-SVN: r251951
      Eric Botcazou committed
    • re PR fortran/34640 (ICE when assigning item of a derived-component to a pointer) · ff3598bc
      2017-09-10  Paul Thomas  <pault@gcc.gnu.org>
      
      	PR fortran/34640
      	PR fortran/40737
      	PR fortran/55763
      	PR fortran/57019
      	PR fortran/57116
      
      	* expr.c (is_subref_array): Add class pointer array dummies
      	to the list of expressions that return true.
      	* trans-array.c: Add SPAN_FIELD and update indices for
      	subsequent fields.
      	(gfc_conv_descriptor_span, gfc_conv_descriptor_span_get,
      	gfc_conv_descriptor_span_set, is_pointer_array,
      	get_array_span): New functions.
      	(gfc_get_descriptor_offsets_for_info): New function to preserve
      	API for access to descriptor fields for trans-types.c.
      	(gfc_conv_scalarized_array_ref): If the expression is a subref
      	array, make sure that info->descriptor is a descriptor type.
      	Otherwise, if info->descriptor is a pointer array, set 'decl'
      	and fix it if it is a component reference.
      	(build_array_ref): Simplify handling of class array refs by
      	passing the vptr to gfc_build_array_ref rather than generating
      	the pointer arithmetic in this function.
      	(gfc_conv_array_ref): As in gfc_conv_scalarized_array_ref, set
      	'decl'.
      	(gfc_array_allocate): Set the span field if this is a pointer
      	array. Use the expr3 element size if it is available, so that
      	the dynamic type element size is used.
      	(gfc_conv_expr_descriptor): Set the span field for pointer
      	assignments.
      	* trans-array.h: Prototypes for gfc_conv_descriptor_span_get
      	gfc_conv_descriptor_span_set and
      	gfc_get_descriptor_offsets_for_info added.
      	trans-decl.c (gfc_get_symbol_decl): If a non-class pointer
      	array, mark the declaration as a GFC_DECL_PTR_ARRAY_P. Remove
      	the setting of GFC_DECL_SPAN.
      	(gfc_trans_deferred_vars): Set the span field to zero in thge
      	originating scope.
      	* trans-expr.c (gfc_conv_procedure_call): Do not use copy-in/
      	copy-out to pass subref expressions to a pointer dummy.
      	(gfc_trans_pointer_assignment): Remove code for setting of
      	GFC_DECL_SPAN. Set the 'span' field for non-class pointers to
      	class function results. Likewise for rank remap. In the case
      	that the target is not a whole array, use the target array ref
      	for remap and, since the 'start' indices are missing, set the
      	lbounds to one, as required by the standard.
      	* trans-intrinsic.c (conv_expr_ref_to_caf_ref): Pick up the
      	'token' offset from the field decl in the descriptor.
      	(conv_isocbinding_subroutine): Set the 'span' field.
      	* trans-io.c (gfc_trans_transfer): Always scalarize pointer
      	array io.
      	* trans-stmt.c (trans_associate_var): Set the 'span' field.
      	* trans-types.c (gfc_get_array_descriptor_base): Add the 'span'
      	field to the array descriptor.
      	(gfc_get_derived_type): Pointer array components are marked as
      	GFC_DECL_PTR_ARRAY_P.
      	(gfc_get_array_descr_info): Replaced API breaking code for
      	descriptor offset calling gfc_get_descriptor_offsets_for_info.
      	* trans.c (get_array_span): New function.
      	(gfc_build_array_ref): Simplify by calling get_array_span and
      	obtain 'span' if 'decl' or 'vptr' present.
      	* trans.h : Rename DECL_LANG_FLAG_6, GFC_DECL_SUBREF_ARRAY_P,
      	as GFC_DECL_PTR_ARRAY_P.
      
      
      2017-09-10  Paul Thomas  <pault@gcc.gnu.org>
      
      	PR fortran/34640
      	* gfortran.dg/associate_24.f90: New test.
      	* gfortran.dg/assumed_type_2.f90: Adjust some of the tree dump
      	checks.
      	* gfortran.dg/no_arg_check_2.f90: Likewise.
      	* gfortran.dg/pointer_array_1.f90: New test.
      	* gfortran.dg/pointer_array_2.f90: New test.
      	* gfortran.dg/pointer_array_7.f90: New test.
      	* gfortran.dg/pointer_array_8.f90: New test.
      	* gfortran.dg/pointer_array_component_1.f90: New test.
      	* gfortran.dg/pointer_array_component_2.f90: New test.
      	* gfortran.dg/goacc/kernels-alias-4.f95: Bump up both tree scan
      	counts by 1.
      
      	PR fortran/40737
      	* gfortran.dg/pointer_array_3.f90: New test.
      
      	PR fortran/57116
      	* gfortran.dg/pointer_array_4.f90: New test.
      
      	PR fortran/55763
      	* gfortran.dg/pointer_array_5.f90: New test.
      
      	PR fortran/57019
      	* gfortran.dg/pointer_array_6.f90: New test.
      
      2017-09-10  Paul Thomas  <pault@gcc.gnu.org>
      
      	PR fortran/34640
      	* libgfortran/libgfortran.h: Add span field to descriptor.
      	* libgfortran/libtool-version : Bump up version number to 5:0:0.
      
      From-SVN: r251949
      Paul Thomas committed
    • A partially initialized variable isn't constant. · 7368cfa4
      	* constexpr.c (reduced_constant_expression_p): If
      	CONSTRUCTOR_NO_IMPLICIT_ZERO, check that all fields are initialized.
      
      From-SVN: r251948
      Jason Merrill committed
    • Daily bump. · 84284f02
      From-SVN: r251945
      GCC Administrator committed
  3. 09 Sep, 2017 18 commits
    • Revert: * dwarf2out.c (gen_formal_parameter_die): Remove obsolete hunk. · 96fddae8
      	Check ultimate_origin before setting reusing_die.
      
      From-SVN: r251941
      Jason Merrill committed
    • [MAINTAINERS] Add myself as AArch64 CPU Port maintainer · 84d0b6f5
      From-SVN: r251940
      James Greenhalgh committed
    • PR c++/81852 define feature-test macro for -fthreadsafe-statics · 019bf9ad
      gcc/c-family:
      
      	PR c++/81852
      	* c-cppbuiltin.c (c_cpp_builtins): Define __cpp_threadsafe_static_init.
      
      gcc/testsuite:
      
      	PR c++/81852
      	* g++.dg/cpp1y/feat-cxx11.C: Check __cpp_threadsafe_static_init.
      	* g++.dg/cpp1y/feat-cxx14.C: Likewise.
      	* g++.dg/cpp1y/feat-cxx98.C: Likewise.
      	* g++.dg/cpp1y/feat-neg.C: Likewise.
      	* g++.dg/cpp1z/feat-cxx1z.C: Likewise.
      
      From-SVN: r251939
      Jonathan Wakely committed
    • dwarf2out.c (gen_formal_parameter_die): Remove obsolete hunk. · b40e0048
      	* dwarf2out.c (gen_formal_parameter_die): Remove obsolete hunk.
      
      	Check ultimate_origin before setting reusing_die.
      
      Co-Authored-By: Jason Merrill <jason@redhat.com>
      
      From-SVN: r251938
      Richard Biener committed
    • decl.c (gnat_to_gnu_entity): Don't generate debug info for inner record types if… · 95b7c2e0
      decl.c (gnat_to_gnu_entity): Don't generate debug info for inner record types if -fgnat-encodings=minimal.
      
      	* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Record_Type>: Don't
      	generate debug info for inner record types if -fgnat-encodings=minimal.
      	(gnat_to_gnu_entity) <E_Record_Subtype>: Use the ultimate base record
      	type as the debug type.
      
      From-SVN: r251937
      Pierre-Marie de Rodat committed
    • decl.c (components_to_record): Do not reorder in non- packed record types if... · a713e7bb
      	* gcc-interface/decl.c (components_to_record): Do not reorder in non-
      	packed record types if pragma Optimize_Alignment (Space) is enabled.
      
      From-SVN: r251936
      Eric Botcazou committed
    • trans.c (Subprogram_Body_to_gnu): Disregard inlining limits for expression functions. · 3d25b3ba
      	* gcc-interface/trans.c (Subprogram_Body_to_gnu): Disregard inlining
      	limits for expression functions.
      	(gnat_to_gnu) <N_Object_Declaration>: Fix formatting.
      
      From-SVN: r251935
      Eric Botcazou committed
    • decl.c (gnat_to_gnu_entity): Copy the layout of the record from the parent type only if... · 87eddedc
      	* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Record_Type>: Copy the
      	layout of the record from the parent type only if both are or are not
      	unchecked unions.
      	(is_stored_discriminant): Return false for an unchecked union.
      
      From-SVN: r251934
      Eric Botcazou committed
    • utils2.c (build_allocator): In type_annotate_only mode return NULL_EXPR. · f4657d60
      	* gcc-interface/utils2.c (build_allocator): In type_annotate_only mode
      	return NULL_EXPR.
      
      From-SVN: r251933
      Eric Botcazou committed
    • decl.c (promote_object_alignment): New function taken from... · 89ec98ed
      	* gcc-interface/decl.c (promote_object_alignment): New function taken
      	from...
      	(gnat_to_gnu_entity) <E_Variable>: ...here.  Invoke it.
      	(gnat_to_gnu_field): If the field is Atomic or VFA, invoke it and
      	create a padding type on success before doing the atomic check.
      
      From-SVN: r251931
      Eric Botcazou committed
    • decl.c (gnat_to_gnu_entity): Apply the promotion to static memory earlier in the processing. · 7f46ecf6
      	* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Variable>: Apply the
      	promotion to static memory earlier in the processing.
      
      From-SVN: r251929
      Eric Botcazou committed
    • decl.c (gnat_to_gnu_entity): Only set the TYPE_ALIGN_OK and TYPE_BY_REFERENCE_P… · ea09ecc5
      decl.c (gnat_to_gnu_entity): Only set the TYPE_ALIGN_OK and TYPE_BY_REFERENCE_P flags on types after various...
      
      	* gcc-interface/decl.c (gnat_to_gnu_entity): Only set the TYPE_ALIGN_OK
      	and TYPE_BY_REFERENCE_P flags on types after various promotions.
      	* gcc-interface/trans.c (node_has_volatile_full_access) <N_Identifier>:
      	Consider all kinds of entities.
      
      From-SVN: r251927
      Eric Botcazou committed
    • decl.c: Add decl_type_param_list... · 5bab4c96
      2017-09-09  Paul Thomas  <pault@gcc.gnu.org>
      
      	* decl.c : Add decl_type_param_list, type_param_spec_list as
      	static variables to hold PDT spec lists.
      	(build_sym): Copy 'type_param_spec_list' to symbol spec_list.
      	(build_struct): Copy the 'saved_kind_expr' to the component
      	'kind_expr'. Check that KIND or LEN components appear in the
      	decl_type_param_list. These should appear as symbols in the
      	f2k_derived namespace. If the component is itself a PDT type,
      	copy the decl_type_param_list to the component param_list.
      	(gfc_match_kind_spec): If the KIND expression is parameterized
      	set KIND to zero and store the expression in 'saved_kind_expr'.
      	(insert_parameter_exprs): New function.
      	(gfc_insert_kind_parameter_exprs): New function.
      	(gfc_insert_parameter_exprs): New function.
      	(gfc_get_pdt_instance): New function.
      	(gfc_match_decl_type_spec): Match the decl_type_spec_list if it
      	is present. If it is, call 'gfc_get_pdt_instance' to obtain the
      	specific instance of the PDT.
      	(match_attr_spec): Match KIND and LEN attributes. Check for the
      	standard and for type/kind of the parameter. They are also not
      	allowed outside a derived type definition.
      	(gfc_match_data_decl): Null the decl_type_param_list and the
      	type_param_spec_list on entry and free them on exit.
      	(gfc_match_formal_arglist): If 'typeparam' is true, add the
      	formal symbol to the f2k_derived namespace.
      	(gfc_match_derived_decl): Register the decl_type_param_list
      	if this is a PDT. If this is a type extension, gather up all
      	the type parameters and put them in the right order.
      	*dump-parse-tree.c (show_attr): Signal PDT templates and the
      	parameter attributes.
      	(show_components): Output parameter atrributes and component
      	parameter list.
      	(show_symbol): Show variable parameter lists.
      	* expr.c (expr.c): Copy the expression parameter list.
      	(gfc_is_constant_expr): Pass on symbols representing PDT
      	parameters.
      	(gfc_check_init_expr): Break on PDT KIND parameters and
      	PDT parameter expressions.
      	(gfc_check_assign): Assigning to KIND or LEN components is an
      	error.
      	(derived_parameter_expr): New function.
      	(gfc_derived_parameter_expr): New function.
      	(gfc_spec_list_type): New function.
      	* gfortran.h : Add enum gfc_param_spec_type. Add the PDT attrs
      	to the structure symbol_attr. Add the 'kind_expr' and
      	'param_list' field to the gfc_component structure. Comment on
      	the reuse of the gfc_actual_arglist structure as storage for
      	type parameter spec lists. Add the new field 'spec_type' to
      	this structure. Add 'param_list' fields to gfc_symbol and
      	gfc_expr. Add prototypes for gfc_insert_kind_parameter_exprs,
      	gfc_insert_parameter_exprs, gfc_add_kind, gfc_add_len,
      	gfc_derived_parameter_expr and gfc_spec_list_type.
      	* interface.c (gfc_compare_derived_types): Treat PDTs in the
      	same way as sequence types.
      	* match.c : Add variable 'type_param_spec_list'.
      	(gfc_op2string, gfc_match_member_sep, gfc_match_label): Remove
      	trailing whitespace.
      	(match_derived_type_spec): Match PDTs and find specific
      	instance.
      	(gfc_match_type_spec): Remove more trailing whitespace.
      	(gfc_match_allocate): Assumed or deferred parameters cannot
      	appear here. Copy the type parameter spec list to the expr for
      	the allocatable entity. Free 'type_param_spec_list'.
      	(gfc_match_common, gfc_match_namelist, gfc_match_module): Still
      	more trailing whitespace to remove.
      	(gfc_match_type_is): Allow PDT typespecs.
      	* match.h : Modify prototypes for gfc_match_formal_arglist and
      	gfc_match_actual_arglist.
      	* module.c (ab_attribute, mstring attr_bits): PDT attributes
      	added.
      	(mio_symbol_attribute): PDT attributes handled.
      	(mio_component): Deal with 'kind_expr' field.
      	(mio_full_f2k_derived): For PDT templates, transfer the formal
      	namespace symroot to the f2k_derived namespace.
      	*primary.c (match_keyword_arg, gfc_match_actual_arglist): Add
      	modifications to handle PDT spec lists. These are flagged in
      	both cases by new boolean arguments, whose prototype defaults
      	are false.
      	(gfc_match_structure_constructor, match_variable): Remove yet
      	more trailing whitespace.
      	* resolve.c (get_pdt_spec_expr, get_pdt_constructor): New
      	functions.
      	(resolve_structure_cons): If the constructor is a PDT template,
      	call get_pdt_constructor to build it using the parameter lists
      	and then get the specific instance of the PDT.
      	(resolve_component): PDT strings need a hidden string length
      	component like deferred characters.
      	(resolve_symbol): Dummy PDTs cannot have deferred parameters.
      	* symbol.c (gfc_add_kind, gfc_add_len): New functions.
      	(free_components): Free 'kind_expr' and 'param_list' fields.
      	(gfc_free_symbol): Free the 'param_list' field.
      	(gfc_find_sym_tree): If the current state is a PDT template,
      	look for the symtree in the f2k_derived namspaces.
      	trans-array.c (structure_alloc_comps): Allocate and deallocate
      	PDTs. Check dummy arguments for compliance of LEN parameters.
      	Add the new functions to the preceeding enum.
      	(gfc_allocate_pdt_comp, gfc_deallocate_pdt_comp and
      	gfc_check_pdt_dummy): New functions calling above.
      	* trans-array.h : Add prototypes for these functions.
      	trans-decl.c (gfc_get_symbol_decl): Call gfc_defer_symbol_init
      	as appropriate for PDT symbols.
      	(gfc_trans_deferred_vars): Allocate/deallocate PDT entities as
      	they come into and out of scope. Exclude pdt_types from being
      	'gcc_unreachable'.
      	(gfc_trans_subcomponent_assign): PDT array components must be
      	handles as if they are allocatable.
      	* trans-stmt.c (gfc_trans_allocate): Handle initialization of
      	PDT entities.
      	(gfc_trans_deallocate): Likewise.
      	* trans-types.c (gfc_get_derived_type): PDT templates must not
      	arrive here. PDT string components are handles as if deferred.
      	Similarly, PDT arrays are treated as if allocatable. PDT
      	strings are pointer types.
      	* trans.c (gfc_deferred_strlen): Handle PDT strings in the same
      	way as deferred characters.
      
      
      2017-09-09  Paul Thomas  <pault@gcc.gnu.org>
      
      	* gfortran.dg/pdt_1.f03 : New test.
      	* gfortran.dg/pdt_2.f03 : New test.
      	* gfortran.dg/pdt_3.f03 : New test.
      	* gfortran.dg/pdt_4.f03 : New test.
      	* gfortran.dg/pdt_5.f03 : New test.
      
      From-SVN: r251925
      Paul Thomas committed
    • utils.c (convert): When converting to a padding type... · 66c9b3f5
      	* gcc-interface/utils.c (convert): When converting to a padding type,
      	reuse an existing CONSTRUCTOR if it has got the right size.
      
      From-SVN: r251924
      Eric Botcazou committed
    • re PR bootstrap/81926 (go/parse.o differs between stage2 and stage3) · a49bf6f0
      	PR bootstrap/81926
      	* cp-objcp-common.c (struct debug_type_hasher): New class.
      	(debug_type_hash): New variable.
      	(cp_get_debug_type): Associate the OFFSET_TYPEs with the types.
      
      From-SVN: r251922
      Eric Botcazou committed
    • allocator.xml: Adjust link for Hoard. · 630e912e
      	* doc/xml/manual/allocator.xml: Adjust link for Hoard.
      	* doc/html/manual/memory.html: Regenerate.
      
      From-SVN: r251919
      Gerald Pfeifer committed
    • compiler: guard against implicit double pointer indirection · d46699ac
          
          The code that lowers field references can sometimes introduce a double
          pointer indirection in cases where it is not/safe appropriate. For
          example, in
          
                  var p **struct { f int }
                  p.f = 0
          
          the assignment LHS was being incorrectly lowered to (*(*p)).f.
          Detect this situation and issue an error.
          
          Fixes golang/go#21770
          
          Reviewed-on: https://go-review.googlesource.com/62330
      
      From-SVN: r251918
      Ian Lance Taylor committed
    • Daily bump. · 0f99f8e6
      From-SVN: r251917
      GCC Administrator committed
  4. 08 Sep, 2017 1 commit
    • PR c++/70029 - ICE with ref-qualifier and -flto · 27c825c5
      	PR c++/70029 - ICE with ref-qualifier and -flto
      gcc/
      	* langhooks.h (struct lang_hooks_for_types): Add
      	copy_lang_qualifiers.
      	* attribs.c (build_type_attribute_qual_variant): Use it.
      	* langhooks-def.h (LANG_HOOKS_COPY_LANG_QUALIFIERS): Default to
      	NULL.
      	(LANG_HOOKS_FOR_TYPES_INITIALIZER): Use it.
      	* tree.c (verify_type): Re-enable TYPE_CANONICAL main variant check.
      gcc/cp/
      	* tree.c (cxx_copy_lang_qualifiers): New.
      	* cp-tree.h: Declare it.
      	* cp-objcp-common.h: Define LANG_HOOKS_COPY_LANG_QUALIFIERS.
      
      From-SVN: r251911
      Jason Merrill committed