1. 16 Dec, 2015 36 commits
  2. 15 Dec, 2015 4 commits
    • struct-layout-1_generate.c: Avoid generating further fields after the first flexible array member. · 7e9a3ad3
      gcc/testsuite/ChangeLog:
      2015-12-15  Martin Sebor  <msebor@redhat.com>
      
      	c++/42121
      	c++/68478
      	c++/68613
      	c++/68689
      	c++/68710
      	* g++.dg/compat/struct-layout-1_generate.c: Avoid generating
      	further fields after the first flexible array member.
      	* g++.dg/ext/flexary2.C: Expect a sole flexible array member
      	to be rejected.  Add a test case exercising zero-length array.
      	* g++.dg/ext/flexary3.C: Expect a sole flexible array member
      	to be rejected.
      	* g++.dg/ext/flexary.h: New file.
      	* g++.dg/ext/flexary4.C: New file.
      	* g++.dg/ext/flexary5.C: New file.
      	* g++.dg/ext/flexary6.C: New file.
      	* g++.dg/ext/flexary7.C: New file.
      	* g++.dg/ext/flexary8.C: New file.
      	* g++.dg/other/dump-ada-spec-2.C: Adjust to reflect flexible
      	array members.
      	* g++.dg/parse/pr43765.C: Add a member to make a struct with
      	a flexible array member valid.  Adjust expected error message.
      	* g++.dg/torture/pr64280.C: Expect a sole flexible array member
      	to be rejected.
      	* g++.dg/torture/pr64312.C: Add a member to make a struct with
      	a flexible array member valid.
      	* g++.dg/ubsan/object-size-1.C: Adjust expected diagnostic.
      
      gcc/cp/ChangeLog:
      2015-12-15  Martin Sebor  <msebor@redhat.com>
      
      	c++/42121
      	c++/68478
      	c++/68613
      	c++/68689
      	c++/68710
      	* class.c (walk_subobject_offsets): Avoid assuming type domain
      	is non-null or has an upper bound.
      	(layout_class_type): Include type size in error message.
      	(flexmems_t): New type.
      	(field_nonempty_p, find_flexarrays, diagnose_flexarrays)
      	(check_flexarrays): New	functions.
      	(finish_struct_1): Call check_flexarrays.
      	* decl.c (compute_array_index_type): Distinguish flexible array
      	members from zero-length arrays.
      	(grokdeclarator): Reject flexible array members in unions.  Avoid
      	rejecting members of incomplete types that are flexible array members.
      	* error.c (dump_type_suffix): Handle flexible array members with null
      	upper bound.
      	* init.c (perform_member_init): Same.
      	* pt.c (instantiate_class_template_1): Allow flexible array members.
      	(tsubst): Handle flexible array members with null upper bound.
      	* typeck2.c (digest_init_r): Warn for initialization of flexible
      	array members.
      	(process_init_constructor_record): Handle flexible array members.
      
      gcc/ChangeLog:
      2015-12-15  Martin Sebor  <msebor@redhat.com>
      
      	c++/42121
      	* tree-chkp.c (chkp_find_bound_slots_1): Handle flexible array
      	members.
      	* tree.c (type_contains_placeholder_1): Avoid assuming type has
      	a non-null domain or an upper bound to handle flexible array
      	members.
      	* varasm.c (output_constructor_regular_field):  Same.
      	(output_constructor): Set min_index to integer_zero_node rather
      	than null when a type has no domain to avoid crashing later.
      
      From-SVN: r231665
      Martin Sebor committed
    • nvptx.c (write_one_arg): Rename to ... · 1f065954
      	* config/nvptx/nvptx.c (write_one_arg): Rename to ...
      	(write_arg_mode): ... here.  Update callers.
      	(write_arg): Rename to ...
      	(write__arg_type): ... here.  Update callers.
      	(write_return_mode): New fn, broken out of ...
      	(write_return): ... here.  Rename to ...
      	(write_return_type): ... here.  Call it. Update callers.
      	(write_fn_proto_from_insn): Use write_arg_mode and
      	write_return_mode.
      	(init_frame): New fn.
      	(nvptx_declare_function_name): Call it for frame and varargs. Only
      	emit outgoing static chain, if it's live.
      	(nvptx_output_return): Use reg_names for return reg name.
      	(nvptx_output_call_insn): Likewise.
      	(nvptx_reorg): Mark unused hard regs too.
      
      From-SVN: r231663
      Nathan Sidwell committed
    • Restore accidentally-removed volatile qualifier · b110e777
      	* include/std/functional (_Mu<_Arg, false, false>::operator()): Restore
      	accidentally-removed volatile qualifier.
      
      From-SVN: r231660
      Jonathan Wakely committed
    • nvptx.md (nvptx_register_operand): Don't accept and then reject subregs. · bd5d4b65
      	* config/nvptx/nvptx.md (nvptx_register_operand): Don't accept and
      	then reject subregs.
      	(nvptx_reg_or_mem_operand): Likewise.
      	(nvptx_nonmemory_operand): Likewise.
      	(call_insn_operand): A regular predicate, check	SYMBOL_REF_FUNCTION_P.
      	(call_insn, call_value_insn): Address is not SImode.
      	* config/nvptx/nvptx.h (FIXED_REGISTERS): Make return reg fixed.
      	(enum reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS): Remove
      	RETURN_REG class.
      	(REGNO_REG_CLASS): Alwaus ALL_REGS.
      	(PROMOTE_MODE): QI and HI are the only smaller than SI int modes.
      	(HARD_FRAME_POINTER_REGNUM): Delete.
      	(REGISTER_NAMES): Move earlier.
      	(struct nvptx_args): Remove 'off'.
      	(INIT_CUMULATIVE_ARGS): Don't initialize 'off'.
      	(ELIMINABLE_REGS): Remove HARD_FRAME_POINTER_REGNUM.
      	* config/nvptx/nvptx.c (arg_promotion): Delete.
      	(nvptx_expand_call): Remove check for funtype being an fntype.
      
      From-SVN: r231659
      Nathan Sidwell committed