Commit Graph

153350 Commits

Author SHA1 Message Date
Martin Sebor
0f2c4a8f1d PR translation/80280 - Missing closing quote (%>) c/semantics.c and c/c-typeck.c
gcc/c-family/ChangeLog:

	PR translation/80280
	* c-attribs.c (handle_alias_ifunc_attribute): Quote a %D directive.
	(handle_weakref_attribute): Same.

PR translation/80280 - Missing closing quote (%>) c/semantics.c and c/c-typeck.c

gcc/ChangeLog:

	PR translation/80280
	* config/i386/i386.c (ix86_function_versions): Quote a %D directive.

PR translation/80280 - Missing closing quote (%>) c/semantics.c and c/c-typeck.c

gcc/cp/ChangeLog:

	PR translation/80280
	* call.c (print_z_candidate): Add missing quoting to %D and other
	like directives.
	(build_op_call_1): Same.
	* constraint.cc (diagnose_check_constraint): Same.
	* mangle.c (mangle_decl): Same.
	* name-lookup.c (cp_binding_level_debug): Same.
	(set_decl_namespace): Same.
	* parser.c (cp_parser_tx_qualifier_opt): Same.
	* pt.c (print_candidates_1): Same.
	(check_template_variable): Same.
	(tsubst_default_argument): Same.
	(most_specialized_partial_spec): Same.
	* semantics.c (omp_reduction_lookup): Same.
	* tree.c (check_abi_tag_redeclaration): Same.
	* typeck.c (comptypes): Same.
	* typeck2.c (abstract_virtuals_error_sfinae): Same.

PR translation/80280 - Missing closing quote (%>) c/semantics.c and c/c-typeck.c

gcc/ChangeLog:

	PR translation/80280
	* builtins.c (expand_builtin_object_size): Add missing quoting to
	%D and like directives.
	* hsa-gen.c (hsa_type_for_scalar_tree_type): Same.
	(hsa_type_for_tree_type): Same.
	(verify_function_arguments): Same.
	* symtab.c (symbol_table::change_decl_assembler_name): Same.
	* varasm.c (get_section): Same.
	(mark_weak): Same.

PR translation/80280 - Missing closing quote (%>) c/semantics.c and c/c-typeck.c

gcc/objc/ChangeLog:

	PR translation/80280
	* objc-gnu-runtime-abi-01.c (objc_eh_runtime_type): Add missing
	quoting to directives.
	* objc-next-runtime-abi-01.c (objc_eh_runtime_type): Ditto.
	* objc-next-runtime-abi-02.c (next_runtime_02_eh_type): Ditto.

PR translation/80280 - Missing closing quote (%>) c/semantics.c and c/c-typeck.c

gcc/testsuite/ChangeLog:

	PR translation/80280
	* g++.dg/abi/Wabi-2-3.C: Adjust.
	* g++.dg/abi/Wabi-3-2.C: Ditto.
	* g++.dg/lookup/using17.C: Ditto.
	* gcc.dg/format/gcc_diag-1.c (foo): Ditto.

From-SVN: r247607
2017-05-04 11:40:05 -06:00
Wilco Dijkstra
2fae724a1e All cores which add a cpu_addrcost_table use a non-zero value for HI and TI...
All cores which add a cpu_addrcost_table use a non-zero value for
HI and TI mode shifts (a non-zero value for general indexing also
applies to all shifts).  Given this, it makes no sense to use a
different setting in generic_addrcost_table.  So change it so that
all supported cores, including -mcpu=generic, now generate the same:

int f(short *p, short *q, long x) { return p[x] + q[x]; }

        lsl     x2, x2, 1
        ldrsh   w3, [x0, x2]
        ldrsh   w0, [x1, x2]
        add     w0, w3, w0
        ret

    gcc/
	* config/aarch64/aarch64.c (generic_addrcost_table):
	Change HI/TI mode setting.

From-SVN: r247606
2017-05-04 17:05:28 +00:00
Martin Jambor
8eef60973d [PR 80622] Treat const pools as initialized in SRA
2017-05-04  Martin Jambor  <mjambor@suse.cz>

	PR tree-optimization/80622
	* tree-sra.c (comes_initialized_p): New function.
	(build_accesses_from_assign): Only set write lazily when
	comes_initialized_p is false.
	(analyze_access_subtree): Use comes_initialized_p.
	(propagate_subaccesses_across_link): Assert !comes_initialized_p
	instead of testing for PARM_DECL.

testsuite/
	* gcc.dg/tree-ssa/pr80622.c: New test.

From-SVN: r247604
2017-05-04 18:19:20 +02:00
Kyrylo Tkachov
9bf2f77904 [AArch64] Accept more addressing modes for PRFM
* config/aarch64/aarch64.md (prefetch); Adjust predicate and
	constraint on operand 0 to allow more general addressing modes.
	Adjust output template.
	* config/aarch64/aarch64.c (aarch64_address_valid_for_prefetch_p):
	New function.
	* config/aarch64/aarch64-protos.h
	(aarch64_address_valid_for_prefetch_p): Declare prototype.
	* config/aarch64/constraints.md (Dp): New address constraint.
	* config/aarch64/predicates.md (aarch64_prefetch_operand): New
	predicate.

	* gcc.target/aarch64/prfm_imm_offset_1.c: New test.

From-SVN: r247603
2017-05-04 16:14:37 +00:00
Joseph Myers
928351c3ef Update .po files.
* be.po, da.po, el.po, fi.po, hr.po, id.po, ja.po, nl.po, ru.po,
	sr.po, sv.po, tr.po, uk.po, vi.po, zh_CN.po, zh_TW.po: Update.

From-SVN: r247601
2017-05-04 16:54:08 +01:00
Nathan Sidwell
ad9870f2d5 More global trees.
* cp-tree.h (enum cp_tree_index): Add CPTI_GLOBAL,
	CPTI_GLOBAL_TYPE, CPTI_GLOBAL_IDENTIFIER, CPTI_ANON_IDENTIFIER,
	CPTI_INIT_LIST_IDENTIFIER.
	(global_namespace, global_type_node, global_identifier)
	anon_identifier, init_list_identifier): New.
	* decl.c (global_type_node, global_scope_name): Delete.
	(initialize_predefined_identifiers): Add new identifiers.
	(cxx_init_decl_processing): Adjust.
	* name-lookup.h (global_namespace, global_type_node): Delete.
	* name-lookup.c (global_namespace, anonymous_namespace_name)
	get_anonymous_namespace_name): Delete.
	(namespace_scope_ht_size, begin_scope, pushtag_1)
	push_namespace): Adjust,
	* call.c (type_has_extended_temps): Use init_list_identifier.
	* pt.c (listify): Likewise.
(((--This line, and those below, will be ignored--

M    cp/name-lookup.c
M    cp/name-lookup.h
M    cp/ChangeLog
M    cp/call.c
M    cp/pt.c
M    cp/cp-tree.h
M    cp/decl.c

From-SVN: r247599
2017-05-04 15:39:05 +00:00
Jan Hubicka
26f1a658e6 ipa-cp.c (perform_estimation_of_a_value): Drop base_time parameter; update use of estimate_ipcp_clone_size_and_time.
* ipa-cp.c (perform_estimation_of_a_value): Drop base_time parameter;
	update use of estimate_ipcp_clone_size_and_time.
	(estimate_local_effects): Update use of
	estimate_ipcp_clone_size_and_time and perform_estimation_of_a_value.
	* ipa-inline.h (estimate_ipcp_clone_size_and_time): Update prototype.
	* ipa-inline-analysis.c (estimate_ipcp_clone_size_and_time):
	Return nonspecialized time.

	* gcc.dg/ipa/ipcp-2.c: Decrease ipcp threshold
	* gcc.dg/tree-ssa/ipa-cp-1.c: Likewise.

From-SVN: r247597
2017-05-04 13:57:35 +00:00
Richard Biener
4d147bca3f tree-ssa-alias.c (get_continuation_for_phi): Improve looking for the last VUSE which def dominates the PHI.
2017-05-04  Richard Biener  <rguenther@suse.de>

	* tree-ssa-alias.c (get_continuation_for_phi): Improve looking
	for the last VUSE which def dominates the PHI.  Directly call
	maybe_skip_until.
	(get_continuation_for_phi_1): Remove.

	* gcc.dg/tree-ssa/ssa-fre-58.c: New testcase.

From-SVN: r247596
2017-05-04 13:29:08 +00:00
Nathan Sidwell
b655c31048 name-lookup.c: Reorder functions to make merging from modules branch simpler.
* name-lookup.c: Reorder functions to make merging from modules
	branch simpler.

From-SVN: r247592
2017-05-04 12:35:05 +00:00
Richard Sandiford
3862ef76c6 Cap niter_for_unrolled_loop to upper bound
For the reasons explained in PR77536, niter_for_unrolled_loop assumes 5
iterations in the absence of profiling information, although it doesn't
increase beyond the estimate for the original loop.  This left a hole in
which the new estimate could be less than the old one but still greater
than the limit imposed by CEIL (nb_iterations_upper_bound, unroll factor).

2017-05-04  Richard Sandiford  <richard.sandiford@linaro.org>

gcc/
	* tree-ssa-loop-manip.c (niter_for_unrolled_loop): Add commentary
	to explain the use of truncating division.  Cap the number of
	iterations to the maximum given by nb_iterations_upper_bound,
	if defined.

gcc/testsuite/
	* gcc.dg/vect/vect-profile-1.c: New test.

From-SVN: r247591
2017-05-04 11:37:05 +00:00
Richard Sandiford
6d0da573d2 Fix previous commit
From-SVN: r247589
2017-05-04 11:03:54 +00:00
Thomas Preud'homme
446163e239 configure.ac (--enable-mingw-wildcard): Add new configurable feature.
2017-05-04  Thomas Preud'homme  <thomas.preudhomme@arm.com>

	* configure.ac (--enable-mingw-wildcard): Add new configurable feature.
	* configure: Regenerate.
	* config.in: Regenerate.
	* config/i386/driver-mingw32.c: new file.
	* config/i386/x-mingw32: Add rule to build driver-mingw32.o.
	* config.host: Link driver-mingw32.o on MinGW host.
	* doc/install.texi: Document new --enable-mingw-wildcard configure
	option.

From-SVN: r247588
2017-05-04 11:02:08 +00:00
Richard Sandiford
e1fd916302 Remove bogus top-level ChangeLog commit (sorry!)
From-SVN: r247587
2017-05-04 11:00:48 +00:00
Marek Polacek
c89ffd9997 re PR tree-optimization/80612 (ICE in get_range_info, at tree-ssanames.c:375)
PR tree-optimization/80612
	* calls.c (get_size_range): Check for INTEGRAL_TYPE_P.

	* gcc.dg/torture/pr80612.c: New test.

From-SVN: r247586
2017-05-04 10:35:58 +00:00
Prakhar Bahuguna
261ce1e56f [ARM] Enable Purecode for ARMv8-M Baseline
This patch adds support for purecode to ARMv8-M Baseline, in addition to
the existing support for ARMv7-M and ARMv8-M Mainline.

2017-05-04  Prakhar Bahuguna  <prakhar.bahuguna@arm.com>
            Andre Simoes Dias Vieira  <andre.simoesdiasvieira@arm.com>

    gcc/
    * config/arm/arm.md (movsi): Change TARGET_32BIT to TARGET_HAVE_MOVT.
    (movt splitter): Likewise.
    * config/arm/arm.c (arm_option_check_internal): Change arm_arch_thumb2
    to TARGET_HAVE_MOVT, and merge with -mslow-flash-data check.
    (const_ok_for_arm): Change else to else if (TARGET_THUMB2) and add else
    block for Thumb-1 with MOVT.
    (thumb2_legitimate_address_p): Move code block ...
    (can_avoid_literal_pool_for_label_p): ... into this new function.
    (thumb1_legitimate_address_p): Add check for TARGET_HAVE_MOVT and
    literal pool.
    (thumb_legitimate_constant_p): Add conditional on TARGET_HAVE_MOVT
    * doc/invoke.texi (-mpure-code): Change "ARMv7-M targets" for
    "M-profile targets with the MOVT instruction".

    gcc/testsuite/
    * gcc.target/arm/pure-code/pure-code.exp: Add conditional for
    check_effective_target_arm_thumb1_movt_ok.

Co-Authored-By: Andre Vieira <andre.simoesdiasvieira@arm.com>

From-SVN: r247585
2017-05-04 10:26:25 +00:00
Prakhar Bahuguna
556cf0887e [ARM] Rename FPSCR builtins to correct names
The GCC documentation in section 6.60.8 ARM Floating Point Status and
Control Intrinsics states that the FPSCR register can be read and
written to using the intrinsics __builtin_arm_get_fpscr and
__builtin_arm_set_fpscr. However, these are misnamed within GCC itself
and these intrinsic names are not recognised.

This patch corrects the intrinsic names to match the documentation, and
adds tests to verify these intrinsics generate the correct
instructions.

2017-05-04  Prakhar Bahuguna  <prakhar.bahuguna@arm.com>

    gcc/
    * gcc/config/arm/arm-builtins.c (arm_init_builtins): Rename
    __builtin_arm_ldfscr to __builtin_arm_get_fpscr, and rename
    __builtin_arm_stfscr to __builtin_arm_set_fpscr.

    gcc/testsuite/
    * gcc.target/arm/fpscr.c: New file.

From-SVN: r247584
2017-05-04 10:16:04 +00:00
Martin Liska
cd09e219ce Remove an unused variable.
2017-05-04  Martin Liska  <mliska@suse.cz>

	* tree-vrp.c (simplify_cond_using_ranges_2): Remove unused
	variable cond_code.

From-SVN: r247583
2017-05-04 10:06:54 +00:00
Thomas Preud'homme
010b1cc046 Require c99_runtime for pr78622.c
2017-05-04  Thomas Preud'homme  <thomas.preudhomme@arm.com>

gcc/testsuite/
    * gcc.c-torture/execute/pr78622.c: Require c99_runtime effective
    target.

From-SVN: r247582
2017-05-04 09:36:29 +00:00
Richard Biener
c3e46927e4 tree.c (array_at_struct_end_p): Handle arrays at struct end with flexarrays more conservatively.
2017-05-04  Richard Biener  <rguenther@suse.de>

	* tree.c (array_at_struct_end_p): Handle arrays at struct
	end with flexarrays more conservatively.  Refactor and treat
	arrays of arrays or aggregates more strict.  Fix
	VIEW_CONVERT_EXPR handling.  Remove allow_compref argument.
	* tree.c (array_at_struct_end_p): Adjust prototype.
	* emit-rtl.c (set_mem_attributes_minus_bitpos): Adjust.
	* gimple-fold.c (get_range_strlen): Likewise.
	* tree-chkp.c (chkp_may_narrow_to_field): Likewise.

From-SVN: r247581
2017-05-04 09:08:01 +00:00
Tom de Vries
99b68476de Replace absolute line numbers in g++.dg/warn
2017-05-04  Tom de Vries  <tom@codesourcery.com>

	PR testsuite/80557
	* g++.dg/warn/Wstrict-aliasing-float-ref-int-obj.C: Replace absolute
	line numbers.
	* g++.dg/warn/miss-format-1.C: Same.
	* g++.dg/warn/overflow-warn-1.C: Same.
	* g++.dg/warn/overflow-warn-3.C: Same.
	* g++.dg/warn/overflow-warn-4.C: Same.

From-SVN: r247580
2017-05-04 07:55:11 +00:00
Tom de Vries
09177a4b3c Replace absolute line numbers in gcc.target/i386
2017-05-04  Tom de Vries  <tom@codesourcery.com>

	PR testsuite/80557
	* gcc.target/i386/pr57655.c: Replace absolute line numbers.
	* gcc.target/i386/pr68657.c: Same.
	* gcc.target/i386/pr69255-1.c: Same.
	* gcc.target/i386/pr69255-2.c: Same.
	* gcc.target/i386/pr69255-3.c: Same.

From-SVN: r247579
2017-05-04 07:54:59 +00:00
Richard Biener
02c6414935 re PR tree-optimization/31130 (VRP no longer derives range for division after negation)
2017-05-04  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/31130
	* tree-vrp.c (needs_overflow_infinity): Remove as always returning
	false.
	(supports_overflow_infinity): Likewise.
	(is_negative_overflow_infinity): Likewise.
	(is_positive_overflow_infinity): Likewise.
	(is_overflow_infinity): Likewise.
	(stmt_overflow_infinity): Likewise.
	(overflow_infinity_range_p): Likewise.
	(usable_range_p): Remove as always returning true.
	(make_overflow_infinity): Remove.
	(negative_overflow_infinity): Likewise.
	(positive_overflow_infinity): Likewise.
	(avoid_overflow_infinity): Likewise.
	(set_value_range): Adjust accordingly.
	(set_value_range_to_nonnegative): Likewise, remove now unused
	overflow_infinity arg.
	(vrp_operand_equal_p): Adjust.
	(update_value_range): Likewise.
	(range_int_cst_singleton_p): Likewise.
	(operand_less_p): Likewise.
	(compare_values_warnv): Likewise.
	(extract_range_for_var_from_comparison_expr): Likewise.
	(vrp_int_const_binop): Likewise.
	(zero_nonzero_bits_from_vr): Likewise.
	(extract_range_from_multiplicative_op_1): Likewise.
	(extract_range_from_binary_expr_1): Likewise.
	(extract_range_from_unary_expr): Likewise.
	(extract_range_from_comparison): Likewise.
	(extract_range_basic): Likewise.
	(adjust_range_with_scev): Likewise.
	(compare_ranges): Likewise.
	(compare_range_with_value): Likewise.
	(dump_value_range): Likewise.
	(test_for_singularity): Likewise, remove strict_overflow_p parameter
	never used.
	(simplify_cond_using_ranges): Adjust.

	* gcc.dg/Wstrict-overflow-12.c: XFAIL.
	* gcc.dg/Wstrict-overflow-13.c: Likewise.
	* gcc.dg/Wstrict-overflow-21.c: Likewise.
	* gcc.dg/pr52904.c: Remove XFAIL.
	* gcc.dg/tree-ssa/vrp114.c: New testcase.

From-SVN: r247578
2017-05-04 07:29:55 +00:00
Pekka Jääskeläinen
2b4514101f Removed accidentally committed conflict marker.
From-SVN: r247577
2017-05-04 05:56:32 +00:00
Pekka Jääskeläinen
c6e334cdb1 Minor BRIG/HSAIL frontend updates and bug fixes:
* brig-builtins.def: Added a builtin for class_f64.
* builtin-types.def: Added a builtin type needed by class_f64.
* brigfrontend/brig-code-entry-handler.cc
 (brig_code_entry_handler::build_address_operand): Fix a bug
 with reg+offset addressing on 32b segments. In large mode,
 the offset is treated as 32bits unless it's global, readonly or
 kernarg address space.
* rt/workitems.c: Removed a leftover comment.
* rt/arithmetic.c (__hsail_class_f32, __hsail_class_f64): Fix the
 check for signaling/non-signalling NaN. Add class_f64 default
 implementation.

From-SVN: r247576
2017-05-04 05:50:21 +00:00
GCC Administrator
1738af6048 Daily bump.
From-SVN: r247575
2017-05-04 00:16:25 +00:00
Joseph Myers
17addff89f * de.po: Update.
From-SVN: r247570
2017-05-03 23:24:30 +01:00
Jason Merrill
0cb222fcc8 invoke.texi: Note that -faligned-new is on by default for C++17.
* doc/invoke.texi: Note that -faligned-new is on by default
	for C++17.

From-SVN: r247564
2017-05-03 14:50:25 -04:00
Jason Merrill
8108ea30e6 timevar.def: Add TV_CONSTEXPR.
* timevar.def: Add TV_CONSTEXPR.

	* constexpr.c (cxx_eval_outermost_constant_expr): Use TV_CONSTEXPR.

From-SVN: r247563
2017-05-03 14:50:20 -04:00
David Malcolm
8135a004c2 Fix typo in common.opt
gcc/ChangeLog:
	* common.opt (fdiagnostics-parseable-fixits): Fix typo.

From-SVN: r247562
2017-05-03 18:35:27 +00:00
Martin Jambor
44abeaaa70 Remove ipa_update_after_lto_read
2017-05-03  Martin Jambor  <mjambor@suse.cz>

	* ipa-prop.c (ipa_update_after_lto_read): Removed.
	* ipa-prop.h (ipa_update_after_lto_read): Remove declaration.
	* ipa-cp.c (ipcp_propagate_stage): Do not call
	ipa_update_after_lto_read.
	* ipa-inline.c (ipa_inline): Likewise.

From-SVN: r247559
2017-05-03 18:49:47 +02:00
Martin Jambor
6fe906a33d Use call_summary in ipa-prop and ipa-cp
2017-05-03  Martin Jambor  <mjambor@suse.cz>

	* ipa-prop.h (ipa_edge_args): Make a class.  Mark with for_user GTY
	tag.  Added a default constructor and a destructor.
	(ipa_edge_args_sum_t): New class;
	(ipa_edge_args_sum): Declare.
	(ipa_edge_args_vector): Remove declaration.
	(IPA_EDGE_REF): Use ipa_edge_args_sum.
	(ipa_free_edge_args_substructures): Remove declaration.
	(ipa_check_create_edge_args): Use ipa_edge_args_sum.
	(ipa_edge_args_info_available_for_edge_p): Likewise.
	* ipa-prop.c (ipa_edge_args_vector): Removed.
	(edge_removal_hook_holder): Likewise.
	(edge_duplication_hook_holder): Likewise.
	(ipa_edge_args_sum): New variable.
	(ipa_propagate_indirect_call_infos): Test ipa_edge_args_sum instead of
	ipa_edge_args_vector.
	(ipa_free_edge_args_substructures): Likewise.
	(ipa_free_all_edge_args): Free ipa_edge_args_sum instead of
	ipa_edge_args_vector.
	(ipa_edge_removal_hook): Turned into method
	ipa_edge_args_sum_t::remove.
	(ipa_edge_duplication_hook): Turned into method
	ipa_edge_args_sum_t::duplicate.
	(ipa_register_cgraph_hooks): Create ipa_edge_args_sum instead of
	registering edge hooks.
	(ipa_unregister_cgraph_hooks): Do not unregister edge hooks.
	* ipa-inline-analysis.c (estimate_function_body_sizes): Test
	ipa_edge_args_sum instead of ipa_edge_args_vector.
	* ipa-profile.c (ipa_profile): Likewise.

From-SVN: r247558
2017-05-03 18:48:20 +02:00
Martin Jambor
57e563ac84 call_summary to keep info about cgraph_edges
2017-05-03  Martin Jambor  <mjambor@suse.cz>

	* symbol-summary.h (function_summary): New method exists.
	(function_summary::symtab_removal): Deallocate through release.
	(call_summary): New class.
	(gt_ggc_mx): New overload.
	(gt_pch_nx): Likewise.
	(gt_pch_nx): Likewise.

From-SVN: r247557
2017-05-03 18:41:39 +02:00
Jeff Law
9a26dfc815 re PR tree-optimization/78496 (Missed opportunities for jump threading)
PR tree-optimization/78496
	* tree-vrp.c (simplify_cond_using_ranges_1): Renamed
	from simplify_cond_using_ranges.  Split off code to walk
	backwards through casts into ...
	(simplify_cond_using_ranges_2): New function.
	(simplify_stmt_using_ranges): Call simplify_cond_using_ranges_1.
	(execute_vrp): After identifying jump threads, call
	simplify_cond_using_ranges_2.

	PR tree-optimization/78496
	* gcc.dg/tree-ssa/ssa-thread-15.c: New test.

From-SVN: r247556
2017-05-03 10:33:45 -06:00
Jan Hubicka
5386abe0da re PR ipa/80609 (crash_signal in reset_inline_summary on ia64 bootstrap)
PR bootstrap/80609
	* ipa-inline.h (inline_summary): Add ctor.
	(create_ggc): Do not use ggc_cleared_alloc.

From-SVN: r247555
2017-05-03 16:14:32 +00:00
Jeff Law
f47337aef6 config-list.mk (am33_2.0-linux): Remove from list of targets to build.
2007-05-03  Jeff Law  <law@redhat.com>

	* config-list.mk (am33_2.0-linux): Remove from list of targets
	to build.

From-SVN: r247553
2017-05-03 09:23:35 -06:00
Jeff Downs
31c830503b Support escaping special characters in specs
2017-05-03  Jeff Downs  <heydowns@somuchpressure.net>
	    Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* gcc.c (handle_braces): Support escaping in switch matching
	text.
	* doc/invoke.texi (Spec Files): Document it.
	Remove superfluous @code markup in items.

Co-Authored-By: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>

From-SVN: r247552
2017-05-03 15:22:51 +00:00
Uros Bizjak
4d0e904fbf pr79671_0.C (foo): Fix asm constraints.
* g++.dg/lto/pr79671_0.C (foo): Fix asm constraints.

From-SVN: r247550
2017-05-03 16:54:16 +02:00
David Malcolm
d1b5f5cc3c New fix-it printer
The existing fix-it printer can lead to difficult-to-read output
when fix-it hints are near each other.  For example, in a recent
patch to add fix-it hints to the C++ frontend's -Wold-style-cast,
e.g. for:

  foo *f = (foo *)ptr->field;
                       ^~~~~

the fix-it hints:
 replace the open paren with "const_cast<"
 replace the close paren with "> ("
 insert ")" after the "ptr->field"

would be printed in this odd-looking way:

  foo *f = (foo *)ptr->field;
                       ^~~~~
           -
           const_cast<
                 -
                 > (        )

class rich_location consolidates adjacent fix-it hints, which helps
somewhat, but the underlying problem is that the existing printer
simply walks through the list of hints printing them, starting newlines
as necessary.

This patch reimplements fix-it printing by introducing a planning
stage: a new class line_corrections "plans" how to print the
fix-it hints affecting a line, generating a vec of "correction"
instances.  Hints that are sufficiently close to each other are
consolidated at this stage.

This leads to the much more reasonable output for the above case:

  foo *f = (foo *)ptr->field;
                       ^~~~~
           -----------------
           const_cast<foo *> (ptr->field);

where the 3 hints are consolidated into one "correction" at printing.

gcc/ChangeLog:
	* diagnostic-show-locus.c (struct column_range): New struct.
	(get_affected_columns): New function.
	(get_printed_columns): New function.
	(struct correction): New struct.
	(correction::ensure_capacity): New function.
	(correction::ensure_terminated): New function.
	(struct line_corrections): New struct.
	(line_corrections::~line_corrections): New dtor.
	(line_corrections::add_hint): New function.
	(layout::print_trailing_fixits): Reimplement in terms of the new
	classes.
	(selftest::test_overlapped_fixit_printing): New function.
	(selftest::diagnostic_show_locus_c_tests): Call it.

From-SVN: r247548
2017-05-03 13:11:21 +00:00
Nathan Sidwell
5bb64c4183 cp-tree.h (enum cp_tree_index, [...]): Move earlier, along with #defines, to before name-lookup include.
* cp-tree.h (enum cp_tree_index, cp_global_trees): Move earlier,
	along with #defines, to before name-lookup include.

From-SVN: r247547
2017-05-03 12:54:56 +00:00
Nathan Sidwell
6fe63fb43f Canonicalize canonical type hashing
Canonicalize canonical type hashing
	gcc/
	* tree.h (type_hash_canon_hash): Declare.
	* tree.c (type_hash_list, attribute_hash_list): Move into
	type_hash_canon_hash.
	(build_type_attribute_qual_variant): Break out hash code calc into
	type_hash_canon_hash.
	(type_hash_canon_hash): New.  Generic type hash computation.
	(build_range_type_1, build_array_type_1, build_function_type)
	build_method_type_directly, build_offset_type, build_complex_type,
	make_vector_type): Call it.
	gcc/c-family/
	* c-common.c (complete_array_type): Use type_hash_canon.
(--This line, and those below, will be ignored--

M    gcc/tree.c
M    gcc/tree.h
M    gcc/c-family/ChangeLog
M    gcc/c-family/c-common.c
M    gcc/ChangeLog

From-SVN: r247546
2017-05-03 12:15:05 +00:00
Richard Biener
49ab46214e tree-vect-data-refs.c (vect_enhance_data_refs_alignment): When all DRs have unknown misaligned do not always peel when...
2017-05-03  Richard Biener  <rguenther@suse.de>

	* tree-vect-data-refs.c (vect_enhance_data_refs_alignment):
	When all DRs have unknown misaligned do not always peel
	when there is a store but apply the same costing model as if
	there were only loads.

	* gcc.dg/vect/costmodel/x86_64/costmodel-alignpeel.c: New testcase.

From-SVN: r247544
2017-05-03 11:01:06 +00:00
Richard Biener
8d5f521a5c revert: re PR tree-optimization/80492 (Wrong code when unrolling a loop with inline asm and local regs)
2017-05-03  Richard Biener  <rguenther@suse.de>

	Revert
	PR tree-optimization/80492
	* tree-ssa-alias.c (decl_refs_may_alias_p): Handle
	compare_base_decls returning dont-know properly.

From-SVN: r247543
2017-05-03 10:59:25 +00:00
Thomas Preud'homme
3cff0135a6 [ARM] Set mode for success result of atomic compare and swap
2017-05-03  Thomas Preud'homme  <thomas.preudhomme@arm.com>

gcc/
    * config/arm/iterators.md (CCSI): New mode iterator.
    (arch): New mode attribute.
    * config/arm/sync.md (atomic_compare_and_swap<mode>_1): Rename into ...
    (atomic_compare_and_swap<CCSI:arch><NARROW:mode>_1): This and ...
    (atomic_compare_and_swap<CCSI:arch><SIDI:mode>_1): This.  Use CCSI
    code iterator for success result mode.
    * config/arm/arm.c (arm_expand_compare_and_swap): Adapt code to use
    the corresponding new insn generators.

From-SVN: r247542
2017-05-03 10:11:44 +00:00
Bin Cheng
0ec5af39bd Revert r247509 2017-05-02 Bin Cheng <bin.cheng@arm.com>
Revert r247509
	2017-05-02  Bin Cheng  <bin.cheng@arm.com>
	* rtlanal.c (rtx_cost): Handle TRUNCATE between tieable modes.

From-SVN: r247541
2017-05-03 10:10:43 +00:00
Richard Sandiford
45d9341420 Wrap tree-data-ref.h macro arguments
gcc/
2016-05-03  Richard Sandiford  <richard.sandiford@linaro.org>

	* tree-data-ref.h (SUB_CONFLICTS_IN_A): Wrap SUB argument in brackets.
	(SUB_CONFLICTS_IN_B, SUB_LAST_CONFLICT, SUB_DISTANCE): Likewise.
	(DDR_A): Wrap DDR argument in brackets.
	(DDR_B, DDR_AFFINE_P, DDR_ARE_DEPENDENT, DDR_SUBSCRIPTS): Likewise.
	(DDR_LOOP_NEST, DDR_INNER_LOOP, DDR_SELF_REFERENCE): Likewise.
	(DDR_REVERSED_P): Likewise.

From-SVN: r247539
2017-05-03 07:51:08 +00:00
Jakub Jelinek
18bfe94032 re PR tree-optimization/79472 (x86-64: Switch table generation fails if default case has different code)
PR tree-optimization/79472
	* tree-switch-conversion.c (struct switch_conv_info): Add
	contiguous_range and default_case_nonstandard fields.
	(collect_switch_conv_info): Compute contiguous_range and
	default_case_nonstandard fields, don't clear final_bb if
	contiguous_range and only the default case doesn't have the required
	structure.
	(check_all_empty_except_final): Set default_case_nonstandard instead
	of failing if contiguous_range and the default case doesn't have empty
	block.
	(check_final_bb): Add SWTCH argument, don't fail if contiguous_range
	and only the default case doesn't have the required constants.  Skip
	virtual phis.
	(gather_default_values): Skip virtual phis.  Allow non-NULL CASE_LOW
	if default_case_nonstandard.
	(build_constructors): Build constant 1 just once.  Assert that default
	values aren't inserted in between cases if contiguous_range.  Skip
	virtual phis.
	(build_arrays): Skip virtual phis.
	(prune_bbs): Add DEFAULT_BB argument, don't remove that bb.
	(fix_phi_nodes): Don't add e2f phi arg if default_case_nonstandard.
	Handle virtual phis.
	(gen_inbound_check): Handle default_case_nonstandard case.
	(process_switch): Adjust check_final_bb caller.  Call
	gather_default_values with the first non-default case instead of
	default case if default_case_nonstandard.

	* gcc.dg/tree-ssa/vrp40.c: Add -fno-tree-switch-conversion to dg-options.
	* gcc.dg/tree-ssa/vrp113.c: New test.
	* gcc.dg/tree-ssa/cswtch-3.c: New test.
	* gcc.dg/tree-ssa/cswtch-4.c: New test.
	* gcc.dg/tree-ssa/cswtch-5.c: New test.

From-SVN: r247538
2017-05-03 09:49:43 +02:00
Tom de Vries
53e62089fb Replace absolute line numbers in c-c++-common
2017-05-03  Tom de Vries  <tom@codesourcery.com>

	PR testsuite/80557
	* c-c++-common/Wshift-negative-value-1.c: Replace absolute line numbers.
	* c-c++-common/Wshift-negative-value-2.c: Same.
	* c-c++-common/Wshift-negative-value-3.c: Same.
	* c-c++-common/Wshift-negative-value-4.c: Same.
	* c-c++-common/cilk-plus/AN/pr57541.c: Same.
	* c-c++-common/cpp/pr60400.c: Same.
	* c-c++-common/fmax-errors.c: Same.
	* c-c++-common/goacc/data-2.c: Same.
	* c-c++-common/goacc/host_data-2.c: Same.
	* c-c++-common/gomp/simd4.c: Same.
	* c-c++-common/pr28656.c: Same.
	* c-c++-common/pr43395.c: Same.
	* c-c++-common/torture/pr57945.c: Same.

From-SVN: r247537
2017-05-03 07:33:01 +00:00
Tom de Vries
962913a561 Add quotes to numerical comment arg of dg directive
2017-05-03  Tom de Vries  <tom@codesourcery.com>

	* c-c++-common/goacc/data-default-1.c: Add quotes to numerical comment
	arg of dg directive.
	* c-c++-common/goacc/routine-3.c: Same.
	* c-c++-common/goacc/routine-4.c: Same.

From-SVN: r247536
2017-05-03 07:32:49 +00:00
GCC Administrator
3fe691c509 Daily bump.
From-SVN: r247533
2017-05-03 00:16:23 +00:00
Nathan Sidwell
3608eff93d ggc-page.c (move_ptes_to_front): Replace unsigned >0 with i-- check.
* ggc-page.c (move_ptes_to_front): Replace unsigned >0 with i--
	check.  Fix formatting.

From-SVN: r247529
2017-05-02 22:39:23 +00:00