Commit Graph

149687 Commits

Author SHA1 Message Date
David Edelsohn
1b1d9303bc * gfortran.dg/pr70937.f90: require-effective-target lto.
From-SVN: r241761
2016-11-01 19:31:44 -04:00
Mark Wielaard
a3f3eec079 libiberty: Fix memory leak in ada_demangle when symbol cannot be demangled.
When a symbol cannot be demangled in ada_demangle a new demangled VEC
will be allocated without deleting the demangled VEC already in use.

Running testsuite/test-demangle under valgrind will show the leak for
this entry in testsuite/demangle-expected:

    # Elaborated flag (not demangled)
    --format=gnat
    x_E
    <x_E>

 11 bytes in 1 blocks are definitely lost in loss record 1 of 1
    at 0x4C27BE3: malloc (vg_replace_malloc.c:299)
    by 0x413FE7: xmalloc (xmalloc.c:148)
    by 0x4025EC: ada_demangle (cplus-dem.c:930)
    by 0x402C59: cplus_demangle (cplus-dem.c:892)
    by 0x400FEC: main (test-demangle.c:317)

libiberty/ChangeLog:

	* cplus-dem.c (ada_demangle): Initialize demangled to NULL and
	XDELETEVEC demangled when unknown.

From-SVN: r241760
2016-11-01 23:13:10 +00:00
Jakub Jelinek
be6218568d dwarf2out.c (gen_variable_die): Remove again origin_die variable and its initialization.
* dwarf2out.c (gen_variable_die): Remove again origin_die variable
	and its initialization.

From-SVN: r241759
2016-11-01 23:56:48 +01:00
Rainer Orth
04ec7059b5 Fix dwarf2out.c non-HAVE_AS_LEB128 bootstrap failure
* dwarf2out.c (output_rnglists): Wrap basebuf, len in
	HAVE_AS_LEB128.

From-SVN: r241758
2016-11-01 22:20:58 +00:00
Ian Lance Taylor
307dde6fcc libgo: fix GOARCH_PHYSPAGESIZE for ia64
From Andreas Schwab.
    
    Reviewed-on: https://go-review.googlesource.com/32537

From-SVN: r241757
2016-11-01 21:45:32 +00:00
Thomas Koenig
5b7c051940 re PR fortran/78178 (ICE in WHERE statement with diagnostic)
2016-11-01  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/78178
	* match.c (match_simple_where):  Fill in locus for assigment
	in simple WHERE statement.

2016-11-01  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/69544
	* gfortran.dg/where_6.f90:  New test.

From-SVN: r241756
2016-11-01 21:16:46 +00:00
Jakub Jelinek
70d288130f dwarf2out.c (add_name_and_src_coords_attributes): Add NO_LINKAGE_NAME argument, don't call add_linkage_name if it is true.
* dwarf2out.c (add_name_and_src_coords_attributes): Add NO_LINKAGE_NAME
	argument, don't call add_linkage_name if it is true.
	(gen_variable_die): For C++ inline static data members, consider the
	initial call when old_die is NULL to be declaration and call
	add_name_and_src_coords_attributes in that case with true as
	NO_LINKAGE_NAME.  Add DW_AT_inline attribute if needed.
	(gen_member_die): For C++ inline static data members, emit a
	definition DIE right away in DW_TAG_compile_unit context.
cp/
	* cp-objcp-common.c (cp_decl_dwarf_attribute): Handle DW_AT_inline.
testsuite/
	* g++.dg/debug/dwarf2/inline-var-1.C: New test.

From-SVN: r241753
2016-11-01 19:35:06 +01:00
John David Anglin
e592dd625d re PR target/78166 (hash.c:1887:1: error: unrecognizable insn)
PR target/78166
	* config/pa/pa.md: Add new shift/add patterns to handle
	(plus (mult (reg) (mem_shadd_operand)) (reg)) source operand.

From-SVN: r241749
2016-11-01 18:15:57 +00:00
Max Filippov
ad89d820bf xtensa: Fix PR target/78118
It started failing after the following commit: 32e90dc6a0cda45 ("PR
rtl-optimization/61047").

The change that made xtensa backend go ICE looks completely unrelated,
and indeed, the issue is caused by the side effect of
compute_frame_size() function call hidden in the
INITIAL_ELIMINATION_OFFSET macro. This call updates the value of the
xtensa_current_frame_size static variable, used in "return" instruction
predicate. Prior to the change the value of xtensa_current_frame_size was
set to 0 after the end of epilogue generation, which enabled the "return"
instruction for the CALL0 ABI, but after the change the additional
INITIAL_ELIMINATION_OFFSET calls make xtensa_current_frame_size non-zero
and "return" pattern unavailable.

Get rid of the global xtensa_current_frame_size and
xtensa_callee_save_size variables by moving them into the
machine_function structure. Implement predicate for the "return" pattern
as a function. Don't communicate completion of epilogue generation
through zeroing of xtensa_current_frame_size, add explicit epilogue_done
variable to the machine_function structure. Don't update stack frame
layout after the completion of reload.

2016-11-01  Max Filippov  <jcmvbkbc@gmail.com>
gcc/
	* config/xtensa/xtensa-protos.h
	(xtensa_use_return_instruction_p): New prototype.
	* config/xtensa/xtensa.c (xtensa_current_frame_size,
	xtensa_callee_save_size): Remove.
	(struct machine_function): Add new fields: current_frame_size,
	callee_save_size, frame_laid_out and epilogue_done.
	(compute_frame_size, xtensa_expand_prologue,
	xtensa_expand_epilogue): Replace xtensa_callee_save_size with
	cfun->machine->callee_save_size and xtensa_current_frame_size
	with cfun->machine->current_frame_size.
	(compute_frame_size): Update cfun->machine->frame_laid_out and
	don't update frame layout after reload completion.
	(xtensa_expand_epilogue): Set cfun->machine->epilogue_done
	instead of zeroing xtensa_current_frame_size.
	(xtensa_use_return_instruction_p): New function.
	* config/xtensa/xtensa.h (xtensa_current_frame_size): Remove
	declaration.
	(INITIAL_ELIMINATION_OFFSET): Use return value of
	compute_frame_size instead of xtensa_current_frame_size value.
	* config/xtensa/xtensa.md ("return" pattern): Use new predicate
	function xtensa_use_return_instruction_p instead of inline code.

From-SVN: r241748
2016-11-01 17:16:33 +00:00
Jakub Jelinek
aaec3d850a tree.h (BLOCK_IN_COLD_SECTION_P): Define.
* tree.h (BLOCK_IN_COLD_SECTION_P): Define.
	* final.c (final_scan_insn): Set BLOCK_IN_COLD_SECTION_P.
	* dwarf2out.c (rnglist_idx): New variable.
	(struct dw_ranges): Add label, idx and maybe_new_sec fields.
	(DEBUG_RNGLISTS_SECTION): Define.
	(ranges_base_label): New variable.
	(size_of_die) <case dw_val_class_range_list>: If using
	DW_FORM_rnglistx, count size of uleb128 of range list index.
	(value_format) <case dw_val_class_range_list>: For
	-gdwarf-5 -gsplit-dwarf return DW_FORM_rnglistx.
	(output_range_list_offset): Handle -gdwarf-5 .debug_rnglists
	offsets.  Multiply dwarf < 5 offsets by 2 * DWARF_ADDR_SIZE.
	(add_ranges_num): Remove useless prototype.  Don't multiply
	by 2 * DWARF2_ADDR_SIZE.  Add maybe_new_sec argument, adjust
	for new fields added to dw_ranges struct.
	(add_ranges): Add maybe_new_sec argument and pass it
	through to add_ranges_num.
	(note_rnglist_head): New function.
	(add_ranges_by_labels): Pass true as maybe_new_sec to
	add_ranges_num, call note_rnglist_head on the head of the list.
	(output_ranges): Add function comment.  Switch to
	.debug_ranges section here and emit .Ldebug_ranges0 label.
	(index_rnglists, output_rnglists): New functions.
	(gen_subprogram_die): Formatting fixes.
	(add_high_low_attributes): Don't divide offsets
	by 2 * DWARF2_ADDR_SIZE.  Call note_rnglist_head on the
	first list element or when pointing into the middle of
	a list.  Pass true as second argument to add_ranges on the
	first block fragment after cold/hot section switch.
	(init_sections_and_labels): For -gdwarf-5 use .debug_rnglists
	section instead of .debug_ranges.  Initialize
	ranges_base_label if -gdwarf-5 -gsplit-dwarf.
	(dwarf2out_finish): For -gdwarf-5 -gsplit-dwarf call
	index_rnglists and add DW_AT_rnglists_base attr.  Don't switch
	to dwarf_ranges_section here or emit .Ldebug_ranges0 label.
	Call output_rnglists for -gdwarf-5.
	(dwarf2out_c_finalize): Clear rnglist_idx.

From-SVN: r241747
2016-11-01 17:54:49 +01:00
Jakub Jelinek
f10e37a1c1 hashtab.h: Use standard GPLv3 with runtime exception boilerplate.
* hashtab.h: Use standard GPLv3 with runtime exception
	boilerplate.

From-SVN: r241746
2016-11-01 17:47:50 +01:00
Thomas Koenig
7f4266d4fd re PR fortran/69544 (Internal compiler error with -Wall and where)
2016-11-01  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/69544
	* match.c (gfc_match_where):  Fill in locus for assigment
	in simple WHERE statement.

2016-11-01  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/69544
	* gfortran.dg/where_5.f90:  New test.

From-SVN: r241745
2016-11-01 16:18:18 +00:00
Fritz Reese
a14b1c1c11 Mark fallthrough cases with gcc_fallthrough.
* gcc/combine.c (simplify_compare_const): Add gcc_fallthrough.

From-SVN: r241744
2016-11-01 15:29:51 +00:00
Ian Lance Taylor
69907c4ad5 runtime: recreate function called by cgo -gccgo
When using cgo -gccgo calls to C.GoString, C.GoStringN, and C.GoBytes
    are turned into calls to __go_byte_array_to_string and
    __go_string_to_byte_array.  Those functions were removed when the string
    code was copied from Go 1.7, but we still need them for cgo.  While cgo
    should be updated, old versions will exist for some time.
    
    Reviewed-on: https://go-review.googlesource.com/32474

From-SVN: r241743
2016-11-01 14:07:43 +00:00
Ian Lance Taylor
f94a3edc6e libgo: only rebuild package if dependent .gox has changed
Use mvifdiff and stamp files to track whether a .gox file has changed.
    When package A depends on package B, and we rebuild package B, only
    rebuild package A if package B's .gox file changes.  This is safe
    because when package A imports package B it only reads package B's .gox
    file.  This means that changes that do not affect export information
    will not cause dependent packages to be recompiled.
    
    Reviewed-on: https://go-review.googlesource.com/32476

From-SVN: r241742
2016-11-01 13:54:21 +00:00
Ian Lance Taylor
380f39b91b libgo: minor Makefile improvements
Suggested by Ralph Corderoy.
    
    Reviewed-on: https://go-review.googlesource.com/32414

From-SVN: r241741
2016-11-01 13:50:03 +00:00
Ian Lance Taylor
d32e800618 re PR go/78145 (Several go.test tests fail with error: integer constant overflow on 32bit targets)
PR go/78145
    compiler: don't put print/println constants into temporaries
    
    It's not necessary, and it breaks setting their type to int64/uint64
    when appropriate.
    
    This fixes GCC PR 78145.
    
    Reviewed-on: https://go-review.googlesource.com/32475

From-SVN: r241740
2016-11-01 13:46:10 +00:00
Jason Merrill
cc656415cf * class.c (declared_access): Split out from handle_using_decl.
From-SVN: r241739
2016-11-01 09:41:50 -04:00
Joseph Myers
3ec82f68d1 * es.po: Update.
From-SVN: r241737
2016-11-01 12:52:49 +00:00
Bilyan Borisov
9fc158eb34 arm-c.c (arm_cpu_builtins): New macro definition.
gcc/

2016-09-30  Bilyan Borisov  <bilyan.borisov@arm.com>
	    Tamar Christina <tamar.christina@arm.com>

	* config/arm/arm-c.c (arm_cpu_builtins): New macro definition.
	* config/arm/arm_neon.h (vmaxnm_f32): New intrinsinc.
	(vmaxnmq_f32): Likewise.
	(vminnm_f32): Likewise.
	(vminnmq_f32): Likewise.
	* config/arm/arm_neon_builtins.def (vmaxnm): New builtin.
	(vminnm): Likewise.
	* config/arm/neon.md (neon_<fmaxmin_op><mode>, VCVTF): New
	expander.

gcc/testsuite/

2016-09-30  Bilyan Borisov  <bilyan.borisov@arm.com>

	* gcc.target/arm/simd/vmaxnm_f32_1.c: New.
	* gcc.target/arm/simd/vmaxnmq_f32_1.c: Likewise.
	* gcc.target/arm/simd/vminnm_f32_1.c: Likewise.
	* gcc.target/arm/simd/vminnmq_f32_1.c: Likewise.


Co-Authored-By: Tamar Christina <tamar.christina@arm.com>

From-SVN: r241736
2016-11-01 12:48:32 +00:00
Eric Botcazou
ea4249cb24 Minor tweaks
From-SVN: r241734
2016-11-01 09:36:04 +00:00
Uros Bizjak
baeb7b5ce5 target-supports.exp: Normalize order of i?86 and x86_64 targets.
* lib/target-supports.exp: Normalize order of i?86 and x86_64 targets.
	Whitespace fixes.
	(check_effective_target_vect_cmdline_needed): Check
	is-effective-target ia32 for x86 targets.
	(check_effective_target_vect_simd_clones): Simplify condition.
	(check_effective_target_vect_double): Ditto.
	(check_effective_target_vect_aligned_arrays): Check
	is-effective-target ia32 for x86 targets.  Simplify condition.
	(check_effective_target_vect_multiple_sizes): Simplify condition.
	(check_effective_target_sqrt_insn): Add i?86-*-* target.
	(check_effective_target_sync_int_128): Simplify condition.
	(check_effective_target_sync_int_128_runtime): Ditto.
	(check_effective_target_sync_long_long_runtime): Ditto.
	(check_effective_target_divmod): Add i?86-*-* target.

From-SVN: r241733
2016-11-01 10:03:21 +01:00
Michael Meissner
156b5ccae7 vsx.md (VSX_EXTRACT_FL): New iterator for all binary floating point types supported by the hardware...
[gcc]
2016-10-31  Michael Meissner  <meissner@linux.vnet.ibm.com>

	* config/rs6000/vsx.md (VSX_EXTRACT_FL): New iterator for all
	binary floating point types supported by the hardware except for
	double.
	(vsx_xvcvsxwdp_df): Provide scalar result alternative to the
	vector instruction for optimizing extracting a SImode from a
	V4SImode vector and converting it to floating point.
	(vsx_xvcvuxwdp_df): Likewise.
	(vsx_extract_si): On ISA 3.0, allow extract target and temporary
	registers to be any VSX register.  Move stores to the end of the
	constraints.
	(vsx_extract_si_<uns>float_df): New combiner pattern and splitter
	to optimize extracting a SImode from a V4SImode vector and
	converting it to a binary floating point type supported by the
	hardware.  Use the vector converts instead of extracting the
	element, sign extending it, and then converting it to double.
	Other floating point types  than double first convert to double,
	then the double is converted to that type.
	(vsx_extract_si_<uns>float_<mode>): Likewise.

[gcc/testsuite]
2016-10-31  Michael Meissner  <meissner@linux.vnet.ibm.com>

	* gcc.target/powerpc/vsx-extract-4.c: New test.
	* gcc.target/powerpc/vsx-extract-5.c: Likewise.

From-SVN: r241731
2016-11-01 00:41:30 +00:00
GCC Administrator
fb4c92aabc Daily bump.
From-SVN: r241730
2016-11-01 00:16:20 +00:00
Andrew Pinski
bd5849af5d driver-aarch64.c (host_detect_local_cpu): Rewrite handling of part num to handle the case where multiple implementers...
2016-10-31  Andrew Pinski  <apinski@cavium.com>

        * config/aarch64/driver-aarch64.c (host_detect_local_cpu):
        Rewrite handling of part num to handle the case where
        multiple implementers share the same part num.

From-SVN: r241726
2016-10-31 15:20:52 -07:00
Jan Kratochvil
8628bc67f1 dwarf2out.c (DWARF_COMPILE_UNIT_HEADER_SIZE): Adjust for -gdwarf-5.
* dwarf2out.c (DWARF_COMPILE_UNIT_HEADER_SIZE): Adjust for -gdwarf-5.
	(DWARF_COMDAT_TYPE_UNIT_HEADER_SIZE): Likewise.

Co-Authored-By: Jakub Jelinek <jakub@redhat.com>

From-SVN: r241725
2016-10-31 22:46:33 +01:00
Jakub Jelinek
13c21337f8 dwarf2out.c (dwarf_AT): Handle DW_AT_dwo_name.
* dwarf2out.c (dwarf_AT): Handle DW_AT_dwo_name.
	(use_debug_types): Adjust comment for DWARF5 DW_UT_type units.
	(new_die): Handle DW_TAG_skeleton_unit like DW_TAG_compile_unit.
	(is_cu_die, is_unit_die): Likewise.
	(should_move_die_to_comdat, break_out_comdat_types): Adjust
	comments for DWARF5 DW_UT_type units.
	(output_compilation_unit_header): Add UT argument, output
	start of DWARF5 .debug_info section header.
	(output_comp_unit): Add dwo_id argument.  Adjust
	output_compilation_unit_header caller, for DW_UT_split_compile
	emit dwo_id field, otherwise padding1.  Emit padding2 field.
	(add_top_level_skeleton_die_attrs): Add DW_AT_dwo_name
	rather than DW_AT_GNU_dwo_name attr for -gdwarf-5.
	(output_skeleton_debug_sections): Add dwo_id argument, for
	-gdwarf-5 emit DWARF 5 DW_UT_skeleton header.
	(output_comdat_type_unit): For -gdwarf-5 emit .debug_info
	DW_UT_type or DW_UT_split_type units rather than .debug_types.
	(dwarf2out_finish): Use DW_TAG_skeleton_unit rather than
	DW_TAG_compile_unit for skeleton unit die.  Don't add
	DW_AT_GNU_dwo_id attributes for -gdwarf-5, instead pass checksum
	address to output_comp_unit and output_skeleton_debug_sections.

From-SVN: r241724
2016-10-31 22:45:51 +01:00
Jakub Jelinek
3aa46b47b2 dwarf2out.c (debug_line_str_section): New variable.
* dwarf2out.c (debug_line_str_section): New variable.
	(debug_line_str_hash): Likewise.
	(DEBUG_LINE_STR_SECTION): Define.
	(set_indirect_string): Handle DW_FORM_line_strp like
	DW_FORM_strp.
	(find_string_form): Fix up formatting.
	(size_of_die): Handle DW_FORM_line_strp like DW_FORM_strp.
	Fix up indentation.
	(output_die): Handle DW_FORM_line_strp.
	(DWARF5_USE_DEBUG_LINE_STR): Define.
	(output_line_string): New function.
	(output_file_names): Add -gdwarf-5 support.
	(output_line_info): Likewise.
	(init_sections_and_labels): Initialize debug_line_str_section.
	(output_indirect_string): Change 2nd argument from void *
	to enum dwarf_form form, compare with form rather than
	DW_FORM_strp.
	(output_indirect_strings): Pass DW_FORM_strp to
	output_indirect_string traversion.
	(dwarf2out_finish): Output .debug_line_str strings.
	(dwarf2out_c_finalize): Clear debug_line_str_section and
	debug_line_str_hash.

From-SVN: r241723
2016-10-31 22:44:53 +01:00
Tom Tromey
f3a5a02f63 re PR debug/77315 (emit DW_OP_form_tls_address)
PR debug/77315:
	* dwarf2out.c (mem_loc_descriptor): Use DW_OP_form_tls_address.
	(resolve_args_picking_1): Move DW_OP_form_tls_address case next to
	DW_OP_GNU_push_tls_address case.
	(loc_list_from_tree_1): Use DW_OP_form_tls_address.

From-SVN: r241721
2016-10-31 20:08:44 +00:00
Jerry DeLisle
120a4c4573 re PR fortran/54679 (Erroneous "Expected P edit descriptor" in conjunction with L descriptor)
2016-10-31  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/54679
	* io.c (check_format): Adjust checks for FMT_L to treat a zero
	width as an extension, giving warnings or error as appropriate.
	Improve messages.
	PR libgfortran/54679
	* io/format.c (parse_format_list): Adjust checks for FMT_L to
	treat a zero width as an extension, giving warnings or error
	as appropriate. Improve messages.
	PR fortran/54679
	* gfortran.dg/fmt_l.f90: Update test.
	* gfortran.dg/fmt_l0.f90: New test.

From-SVN: r241720
2016-10-31 19:59:04 +00:00
Jakub Jelinek
5cea3ad6b5 dwarf2out.h (struct dw_loc_descr_node): Adjust comment for frame_offset_rel bit.
* dwarf2out.h (struct dw_loc_descr_node): Adjust comment
	for frame_offset_rel bit.
	(struct array_descr_info): Add rank field.
	* dwarf2out.c (struct loc_descr_context): Add placeholder_arg
	and placeholder_seen fields.
	(resolve_args_picking_1): Handle also frame_offset_rel DW_OP_dup
	and DW_OP_over.  Optimize DW_OP_pick 0 into DW_OP_dup and
	DW_OP_pick 1 into DW_OP_over.
	(function_to_dwarf_procedure, type_byte_size, field_byte_offset,
	gen_variant_part): Clear placeholder_{arg,seen}.
	(loc_list_from_tree_1): Drop const from context argument.
	Handle integral PLACEHOLDER_EXPR if context->placeholder_arg.
	(loc_list_for_address_of_addr_expr_of_indirect_ref,
	loc_list_from_tree, loc_descriptor_from_tree): Drop const from
	context argument.
	(add_scalar_info): Drop const from context argument.  Handle
	context->placeholder_arg.
	(add_bound_info): Drop const from context argument.
	(gen_descr_array_type_die): Drop const from ctx variable.
	Initialize placeholder_arg and placeholder_seen.  Add DW_AT_rank
	attribute and use a single DW_TAG_generic_subrange instead of
	7 DW_TAG_subrange_type for assumed rank arrays.
fortran/
	* trans-types.c (gfc_get_array_descr_info): For -gdwarf-5 or
	-gno-strict-dwarf, handle assumed rank arrays the way dwarf2out
	expects.
ada/
	* gcc-interface/misc.c (gnat_get_array_descr_info): Clear rank
	field.

From-SVN: r241719
2016-10-31 20:35:47 +01:00
Jakub Jelinek
2a3d56bfc4 dwarf2out.h (enum dw_val_class): Add dw_val_class_loclistsptr.
* dwarf2out.h (enum dw_val_class): Add dw_val_class_loclistsptr.
	* dwarf2out.c (struct dw_loc_list_struct): Change emitted field
	from bool to 1-bit uchar bitfield.  Add num_assigned and
	offset_emitted bitfields.
	(dw_val_equal_p): Compare v.val_lbl_id rather than v.val_unsigned
	for dw_val_class_lineptr and dw_val_class_macptr.  Handle
	dw_val_class_loclistsptr.
	(new_addr_loc_descr): Fix up formatting.
	(DEBUG_LOCLISTS_SECTION, DEBUG_DWO_LOCLISTS_SECTION): Define.
	(add_AT_low_high_pc): Fix up formatting.
	(add_AT_loclistsptr): New function.
	(AT_lbl): Allow dw_val_class_loclistsptr.
	(print_dw_val, attr_checksum, attr_checksum_ordered, same_dw_val_p):
	Handle dw_val_class_loclistsptr.
	(loc_list_idx): New variable.
	(output_loclists_offsets, assign_location_list_indexes): New
	functions.
	(size_of_die): For dw_val_class_loc_list -gsplit-dwarf -gdwarf-5
	add size_of_uleb128 of the index.  Drop never used
	dwarf_split_debug_info AT_index handling.  Handle
	dw_val_class_loclistsptr.
	(value_format): Return DW_FORM_loclistsx for dw_val_class_loc_list
	if -gsplit-dwarf -gdwarf-5.  Handle dw_val_class_loclistsptr.
	(output_loc_list): Handle DWARF 5 .debug_loclists* format.
	(output_loc_list_offset): Handle -gsplit-dwarf -gdwarf-5
	DW_FORM_loclistx indexes.
	(output_attr_index_or_value): Fix up formatting.  Don't handle
	dw_val_class_loc_list here.
	(output_die): Formatting fixes.  Handle dw_val_class_loclistsptr.
	For dw_val_class_loc_list call output_loc_list_offset rather than
	output_attr_index_or_value.
	(init_sections_and_labels): For -gdwarf-5 use .debug_loclists
	or .debug_loclists.dwo section name for debug_loc_section.
	(resolve_addr_in_expr): Formatting fix.
	(index_location_lists): Likewise.
	(dwarf2out_finish): If there are any location lists, for
	-gsplit-dwarf -gdwarf-5 add DW_AT_loclists_base attribute.  Call
	index_location_lists only if have_location_lists.  Call
	assign_location_list_indexes for -gsplit-dwarf -gdwarf-5.  Emit
	.debug_loclists{,.dwo} section header for -gdwarf-5, for -gdwarf-5
	-gsplit-dwarf also emit offset table.

From-SVN: r241718
2016-10-31 20:25:40 +01:00
Jakub Jelinek
25f409344c dwarf2out.c (DWARF_LARGEST_DATA_FORM_BITS): Define.
* dwarf2out.c (DWARF_LARGEST_DATA_FORM_BITS): Define.
	(size_of_die, value_format, output_die): Use
	DW_FORM_data16 for 128-bit dw_val_class_const_double or
	dw_val_class_wide_int.

From-SVN: r241714
2016-10-31 18:22:30 +01:00
Jakub Jelinek
7786b6aca2 dwarf2out.c (dwarf_op): Renamed to ...
* dwarf2out.c (dwarf_op): Renamed to ...
	(dwarf_OP): ... this.
	(convert_descriptor_to_mode, scompare_loc_descriptor,
	minmax_loc_descriptor, typed_binop, mem_loc_descriptor,
	implicit_ptr_descriptor, optimize_one_addr_into_implicit_ptr): Adjust
	callers.
	(dwarf_AT, dwarf_TAG): New functions.
	(check_die): Disallow DW_AT_call_all_calls next to
	DW_AT_GNU_all_call_sites.
	(gen_call_site_die): Use dwarf_TAG and dwarf_AT with DWARF 5 tag
	and attributes instead of the corresponding GNU tag and attributes.
	(gen_subprogram_die): Likewise.  Emit call site information even
	for -gdwarf-5 -gstrict-dwarf.  Replace DW_AT_GNU_defaulted with
	DW_AT_defaulted in comment.
	(resolve_addr): Handle DW_AT_call_origin attribute on
	DW_TAG_call_site DIE like DW_AT_abstract_origin on
	DW_TAG_GNU_call_site DIE.

From-SVN: r241713
2016-10-31 18:14:29 +01:00
Jakub Jelinek
23157abc1c dwarf2out.c (dwarf_op): New function.
* dwarf2out.c (dwarf_op): New function.
	(size_of_loc_descr): Handle DW_OP_{implicit_pointer,entry_value},
	DW_OP_{const,regval,deref}_type and DW_OP_{convert,reinterpret}.
	(output_loc_operands, output_loc_operands_raw): Likewise.
	(resolve_args_picking_1, prune_unused_types_walk_loc_descr,
	mark_base_types, hash_loc_operands, compare_loc_operands): Likewise.
	(resolve_addr_in_expr): Likewise.  Only punt for !dwarf_strict
	if dwarf_version < 5.
	(convert_descriptor_to_mode): Use dwarf_op (DW_OP_xxx) instead of
	DW_OP_GNU_xxx.
	(scompare_loc_descriptor, ucompare_loc_descriptor,
	minmax_loc_descriptor, typed_binop, mem_loc_descriptor,
	implicit_ptr_descriptor, optimize_one_addr_into_implicit_ptr,
	optimize_location_into_implicit_ptr): Likewise.  Only punt for
	!dwarf_strict if dwarf_version < 5.
	(string_cst_pool_decl): Adjust comment.
	(non_dwarf_expression): Handle DW_OP_implicit_pointer.

From-SVN: r241712
2016-10-31 18:12:56 +01:00
Jakub Jelinek
9782e1ec0a re PR c++/77886 (-Wimplicit-fallthrough: breaks duff's device (in function templates))
PR c++/77886
	* pt.c (tsubst_expr) <case CASE_LABEL_EXPR> Copy over
	FALLTHROUGH_LABEL_P flag to the new LABEL_DECL.
	(tsubst_expr) <case LABEL_EXPR>: Likewise.

	* g++.dg/warn/Wimplicit-fallthrough-2.C: New test.

From-SVN: r241711
2016-10-31 18:10:30 +01:00
Jakub Jelinek
c5fed5c6f2 re PR c++/78089 (__builtin_shuffle parsing bug)
PR c++/78089
	* parser.c (cp_parser_postfix_expression): Replace return statement in
	the first switch with setting postfix_expression to the return
	expression and break;.

	* c-c++-common/builtin-shuffle-1.c: New test.
	* g++.dg/cpp0x/addressof3.C: New test.

From-SVN: r241710
2016-10-31 18:08:36 +01:00
Jakub Jelinek
f04c1e0a56 dwarf2out.h (enum dw_val_class): Add dw_val_class_const_implicit...
* dwarf2out.h (enum dw_val_class): Add dw_val_class_const_implicit,
	dw_val_class_unsigned_const_implicit and dw_val_class_file_implicit.
	(struct dw_val_node): Add val_file_implicit field.
	* dwarf2out.c (dw_val_equal_p, print_dw_val, attr_checksum,
	attr_checksum_ordered, same_dw_val_p, size_of_die, value_format,
	output_die): Handle dw_val_class_const_implicit,
	dw_val_class_unsigned_const_implicit and dw_val_class_file_implicit.
	(abbrev_die_table): Change into va_gc vec.
	(abbrev_die_table_allocated, abbrev_die_table_in_use,
	ABBREV_DIE_TABLE_INCREMENT): Remove.
	(AT_int, AT_unsigned, AT_file): Allow dw_val_class_*_implicit.
	(abbrev_opt_start, abbrev_usage_count, sorted_abbrev_dies): New
	variables.
	(build_abbrev_table): Adjust for abbrev_die_table being a va_gc vec.
	If abbrev_opt_start, fill in abbrev_usage_count and abbrev_dies
	vectors.
	(die_abbrev_cmp, optimize_implicit_const, optimize_abbrev_table): New
	functions.
	(output_die_abbrevs): For DW_FORM_implicit_const emit sleb128 with
	the implicit value.
	(output_abbrev_section): Adjust for abbrev_die_table being a va_gc
	vec.
	(output_comp_unit): Initialize abbrev_opt_start if emitting the main
	unit.  Call optimize_abbrev_table.
	(dwarf2out_init, dwarf2out_finish, dwarf2out_c_finalize): Adjust for
	abbrev_die_table being a va_gc vec.

From-SVN: r241709
2016-10-31 17:59:21 +01:00
Ville Voutilainen
aee69156da Add tests for a const member and a reference member for launder.
* g++.dg/cpp1z/launder3.C: New.
* g++.dg/cpp1z/launder4.C: Likewise.
* g++.dg/cpp1z/launder5.C: Likewise.
* g++.dg/cpp1z/launder5.cc: Likewise.
* g++.dg/cpp1z/launder5.h: Likewise.
* g++.dg/cpp1z/launder6.C: Likewise.
* g++.dg/cpp1z/launder6.cc: Likewise.
* g++.dg/cpp1z/launder6.h: Likewise.

From-SVN: r241708
2016-10-31 18:52:23 +02:00
Jakub Jelinek
dcb466eca3 re PR c++/77948 (Option processing of -std=c++11 -std=gnu++11 doesn't reset ext_numeric_literals)
PR c++/77948
	* c.opt (fext-numeric-literals): Add Var and Init.
	* c-opts.c (c_common_handle_option): Don't clear
	cpp_opts->ext_numeric_literals for -std=c++{11,14,1z}.
	(c_common_post_options): Clear it here if not set
	explicitly.

	* g++.dg/cpp0x/pr77948-1.C: New test.
	* g++.dg/cpp0x/pr77948-2.C: New test.
	* g++.dg/cpp0x/pr77948-3.C: New test.
	* g++.dg/cpp0x/pr77948-4.C: New test.
	* g++.dg/cpp0x/pr77948-5.C: New test.
	* g++.dg/cpp0x/pr77948-6.C: New test.

From-SVN: r241707
2016-10-31 17:38:21 +01:00
Jakub Jelinek
1e4fa9b112 re PR tree-optimization/77860 (ICE in gimple_build_assign_1, at gimple.c:420)
PR tree-optimization/77860
	* tree-ssa-reassoc.c (eliminate_using_constants): Handle
	also integral complex and vector constants.

	* gcc.dg/pr77860.c: New test.

From-SVN: r241706
2016-10-31 17:36:53 +01:00
Jakub Jelinek
520c47e803 dwarf2out.c (dwarf2out_define, [...]): Replace DW_MACRO_GNU_* constants with corresponding DW_MACRO_* constants.
* dwarf2out.c (dwarf2out_define, dwarf2out_undef, output_macinfo_op,
	optimize_macinfo_range, save_macinfo_strings): Replace
	DW_MACRO_GNU_* constants with corresponding DW_MACRO_* constants.
	(output_macinfo): Likewise.  Emit .debug_macro* rather than
	.debug_macinfo* even for -gstrict-dwarf -gdwarf-5.
	(init_sections_and_labels): Use .debug_macro* labels rather than
	.debug_macinfo* labels even for -gstrict-dwarf -gdwarf-5.
	(dwarf2out_finish): Use DW_AT_macros instead of DW_AT_macro_info
	or DW_AT_GNU_macros for -gdwarf-5.

From-SVN: r241705
2016-10-31 17:32:20 +01:00
Waldemar Brodkorb
c667cdd736 linux.h (UCLIBC_DYNAMIC_LINKER): Define.
2016-10-31  Waldemar Brodkorb  <wbx@openadk.org>

	* config/microblaze/linux.h (UCLIBC_DYNAMIC_LINKER): Define.

From-SVN: r241704
2016-10-31 09:04:21 -06:00
Carl Love
457cc672cb Index...
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 241702)
+++ ChangeLog	(working copy)
@@ -1,5 +1,10 @@
 2016-10-27  Carl Love  <cel@us.ibm.com>
 
+	* MAINTAINERS (Write After Approval): Fix my entry in the Write After
+	Approval list to make it alphabetical.
+
+2016-10-27  Carl Love  <cel@us.ibm.com>
+
 	* MAINTAINERS (Write After Approval): Add myself.
 
 2016-10-27  Andrew Burgess  <andrew.burgess@embecosm.com>
Index: MAINTAINERS
===================================================================
--- MAINTAINERS	(revision 241702)
+++ MAINTAINERS	(working copy)
@@ -477,9 +477,9 @@
 Gabor Loki					<loki@inf.u-szeged.hu>
 Sandra Loosemore				<sandra@codesourcery.com>
 Manuel López-Ibáñez				<manu@gcc.gnu.org>
+Carl Love					<cel@us.ibm.com>
 Martin v. Löwis					<loewis@informatik.hu-berlin.de>
 H.J. Lu						<hjl.tools@gmail.com>
-Carl Love					<cel@us.ibm.com>
 Christophe Lyon					<christophe.lyon@st.com>
 Luis Machado					<luisgpm@br.ibm.com>
 Ziga Mahkovec					<ziga.mahkovec@klika.si>

From-SVN: r241703
2016-10-31 15:01:13 +00:00
Uros Bizjak
85771f28c8 alpha-passes.def: Swap pass_convert_to_eh_region_ranges and pass_shorten_branches positions.
* config/alpha/alpha-passes.def: Swap pass_convert_to_eh_region_ranges
	  and pass_shorten_branches positions.

From-SVN: r241702
2016-10-31 15:56:49 +01:00
Senthil Kumar Selvaraj
dd57b05e96 Skip gcc.dg/lto/pr60449_0.c for avr
The testcase requires gettimeofday to be available for the target. The avr
target doesn't have an implementation, so the test always fails with a
linker error.

gcc/testsuite

2016-10-31  Senthil Kumar Selvaraj  <senthil_kumar.selvaraj@atmel.com>

	* gcc.dg/lto/pr60449_0.c: Skip for avr.

From-SVN: r241701
2016-10-31 14:06:04 +00:00
Jakub Jelinek
e8d8d3c8bf re PR c++/77886 (-Wimplicit-fallthrough: breaks duff's device (in function templates))
PR c++/77886
	* pt.c (tsubst_expr) <case CASE_LABEL_EXPR> Copy over
	FALLTHROUGH_LABEL_P flag to the new LABEL_DECL.
	(tsubst_expr) <case LABEL_EXPR>: Likewise.

	* g++.dg/warn/Wimplicit-fallthrough-2.C: New test.

From-SVN: r241700
2016-10-31 14:39:49 +01:00
Le-Chun Wu
84ff4775d4 Add -Wshadow=global -Wshadow=local and -Wshadow=compatible-local.
This patch from Le-Chun Wu adds two new shadow warning flags for
C and C++:

  -Wshadow=local which warns if a local variable shadows another local
  variable or parameter,

  -Wshadow=compatible-local which warns if a local variable shadows
  another local variable or parameter whose type is compatible with
  that of the shadowing variable.

It is already on the google/main branch (Google ref 39127) and was
previously submitted by Diego Novillo and reviewed on
http://codereview.appspot.com/4452058

I addressed the review comments and made the following changes:
- Add -Wshadow=global (the default alias for -Wshadow).
- Make the documented options -Wshadow=global, -Wshadow=local
  and -Wshadow=compatible-local (with hidden undocumented aliases
  -Wshadow-local and -Wshadow-compatible-local for compatibility).
- The -Wshadow=global, -Wshadow=local and -Wshadow=compatible-local
  relationships are expressed in common.opt instead of in opts.c
  and documented in invoke.texi.
- The "previous declaration" warnings were turned into notes and use
  the (now) existing infrastructure instead of duplicating the warnings.
  The testcases have been adjusted to expect the notes.
- The conditional change in name-lookup.c for non-locals (where we
  don't want to change the warnings, but just check the global ones)
  has been dropped.
- Use warning_at in c-decl.c (warn_if_shadowing).

gcc/ChangeLog:
2016-10-30  Le-Chun Wu  <lcwu@google.com>
            Mark Wielaard  <mjw@redhat.com>

       * doc/invoke.texi: Document Wshadow-local and Wshadow-compatible-local.
       * common.opt (Wshadow=global): New option. Default for -Wshadow.
       (Wshadow=local): New option.
       (Wshadow-local): Hidden alias for -Wshadow=local.
       (Wshadow=compatible-local): New option.
       (Wshadow-compatible-local): Hidden alias for
       -Wshadow=compatible-local.
       * doc/invoke.texi: Document Wshadow=global, Wshadow=local and
       Wshadow=compatible-local.

gcc/c/ChangeLog:
2016-10-30  Le-Chun Wu  <lcwu@google.com>
            Mark Wielaard  <mjw@redhat.com>

       * c-decl.c (warn_if_shadowing): Use the warning code corresponding
       to the given -Wshadow= variant. Use warning_at.

gcc/cp/ChangeLog:
2016-10-30  Le-Chun Wu  <lcwu@google.com>
            Mark Wielaard  <mjw@redhat.com>

       * name-lookup.c (pushdecl_maybe_friend): When emitting a
       shadowing warning, use the code corresponding to the
       given -Wshadow= variant.

gcc/testsuite/ChangeLog
2016-10-30  Le-Chun Wu  <lcwu@google.com>
            Mark Wielaard  <mjw@redhat.com>

       * gcc.dg/Wshadow-compatible-local-1.c: New test.
       * gcc.dg/Wshadow-local-1.c: Likewise.
       * gcc.dg/Wshadow-local-2.c: Likewise.
       * g++.dg/warn/Wshadow-compatible-local-1.C: Likewise.
       * g++.dg/warn/Wshadow-local-1.C: Likewise.
       * g++.dg/warn/Wshadow-local-2.C: Likewise.

Co-Authored-By: Mark Wielaard <mjw@redhat.com>

From-SVN: r241699
2016-10-31 13:21:59 +00:00
Richard Biener
6517958578 re PR lto/78129 (-Werror=suggest-final-types leads to -ENOSPC.)
2016-10-31  Richard Biener  <rguenther@suse.de>

	PR lto/78129
	* lto.c (do_whole_program_analysis): Bail out after errors
	from WPA analysis.

From-SVN: r241698
2016-10-31 12:52:23 +00:00
Bin Cheng
4cecd65999 tree-vect-slp.c (vect_get_and_check_slp_defs): New parameter SWAP.
* tree-vect-slp.c (vect_get_and_check_slp_defs): New parameter SWAP.
	Check slp defs for COND_EXPR by swapping/inverting operands if the
	new parameter SWAP indicates so.
	(vect_build_slp_tree_1): New parameter SWAP.  Check COND_EXPR stmt
	is isomorphic to the first stmt via swapping/inverting.  Store swap
	information in the new parameter SWAP.
	(vect_build_slp_tree): New local array SWAP and pass it to function
	vect_build_slp_tree_1.  Cleanup result handling code for function
	call to vect_get_and_check_slp_defs.  Skip operand swapping if the
	order of operands has been fixed as indicated by SWAP[i].

From-SVN: r241697
2016-10-31 09:30:47 +00:00