gcc/ChangeLog:
PR other/69554
* diagnostic-show-locus.c (struct line_span): New struct.
(layout::get_first_line): Delete.
(layout::get_last_line): Delete.
(layout::get_num_line_spans): New member function.
(layout::get_line_span): Likewise.
(layout::print_heading_for_line_span_index_p): Likewise.
(layout::get_expanded_location): Likewise.
(layout::calculate_line_spans): Likewise.
(layout::m_first_line): Delete.
(layout::m_last_line): Delete.
(layout::m_line_spans): New field.
(layout::layout): Update comment. Replace m_first_line and
m_last_line with m_line_spans, replacing their initialization
with a call to calculate_line_spans.
(diagnostic_show_locus): When printing source lines and
annotations, rather than looping over a single span
of lines, instead loop over each line_span within
the layout, with an inner loop over the lines within them.
Call the context's start_span callback when changing line spans.
* diagnostic.c (diagnostic_initialize): Initialize start_span.
(diagnostic_build_prefix): Break out the building of the location
part of the string into...
(diagnostic_get_location_text): ...this new function, rewriting
it from nested ternary expressions to a sequence of "if"
statements.
(default_diagnostic_start_span_fn): New function.
* diagnostic.h (diagnostic_start_span_fn): New typedef.
(diagnostic_context::start_span): New field.
(default_diagnostic_start_span_fn): New prototype.
gcc/fortran/ChangeLog:
PR other/69554
* error.c (gfc_diagnostic_start_span): New function.
(gfc_diagnostics_init): Initialize global_dc's start_span.
gcc/testsuite/ChangeLog:
PR other/69554
* gcc.dg/pr69554-1.c: New test.
* gfortran.dg/pr69554-1.F90: New test.
* gfortran.dg/pr69554-2.F90: New test.
* lib/gcc-dg.exp (proc dg-locus): New function.
* lib/gfortran-dg.exp (proc gfortran-dg-test): Update comment to
distinguish between the caret-printing and non-caret-printing
cases. If caret-printing has been explicitly enabled, bail out
without attempting to fix up the output.
From-SVN: r233386
gcc/ChangeLog:
PR driver/69265
PR driver/69453
* gcc.c (driver::driver): Initialize m_option_suggestions.
(driver::~driver): Clean up m_option_suggestions.
(suggest_option): Convert to...
(driver::suggest_option): ...this, and split out into
driver::build_option_suggestions and find_closest_string.
(driver::build_option_suggestions): New function, from
first half of suggest_option. Special-case
OPT_fsanitize_ and OPT_fsanitize_recover_, making use of
the sanitizer_opts array. For options of enum types, add the
various enum values to the candidate strings.
(driver::handle_unrecognized_options): Remove "const".
* gcc.h (driver::handle_unrecognized_options): Likewise.
(driver::build_option_suggestions): New decl.
(driver::suggest_option): New decl.
(driver::m_option_suggestions): New field.
* opts-common.c (add_misspelling_candidates): New function.
* opts.c (sanitizer_opts): Remove decl of struct sanitizer_opts_s
and make non-static.
* opts.h (sanitizer_opts): New array decl.
(add_misspelling_candidates): New function decl.
* spellcheck.c (find_closest_string): New function.
* spellcheck.h (find_closest_string): New function decl.
gcc/testsuite/ChangeLog:
PR driver/69265
PR driver/69453
* gcc.dg/spellcheck-options-3.c: New test case.
* gcc.dg/spellcheck-options-4.c: New test case.
* gcc.dg/spellcheck-options-5.c: New test case.
* gcc.dg/spellcheck-options-6.c: New test case.
* gcc.dg/spellcheck-options-7.c: New test case.
* gcc.dg/spellcheck-options-8.c: New test case.
* gcc.dg/spellcheck-options-9.c: New test case.
* gcc.dg/spellcheck-options-10.c: New test case.
From-SVN: r233382
PR rtl-optimization/69764
PR rtl-optimization/69771
* optabs.c (expand_binop_directly): For shift_optab_p, force
convert_modes with VOIDmode if xop1 has VOIDmode.
* c-c++-common/pr69764.c: New test.
* gcc.dg/torture/pr69771.c: New test.
From-SVN: r233381
PR ipa/69241
* ipa-split.c (split_function): If split part returns TREE_ADDRESSABLE
type by reference, force lhs on the call.
* g++.dg/ipa/pr69241-4.C: New test.
From-SVN: r233375
PR ipa/68672
* ipa-split.c (split_function): Don't compute/use main_part_return_p.
Compute retval and retbnd early in all cases if split_part_return_p
and return_bb is not EXIT. Remove all clobber stmts and reset
all debug stmts that refer to SSA_NAMEs defined in split part,
except if it is retval, in that case replace the old retval with the
lhs of the call to the split part.
* g++.dg/ipa/pr68672-1.C: New test.
* g++.dg/ipa/pr68672-2.C: New test.
* g++.dg/ipa/pr68672-3.C: New test.
From-SVN: r233374
c/
PR c/69522
* c-parser.c (c_parser_braced_init): New arg outer_obstack. All
callers changed. If nested_p is true, use it to call
finish_implicit_inits.
* c-tree.h (finish_implicit_inits): Declare.
* c-typeck.c (finish_implicit_inits): New function. Move code
from ...
(push_init_level): ... here.
(set_designator, process_init_element): Call finish_implicit_inits.
testsuite/
PR c/69522
gcc.dg/pr69522.c: New test.
From-SVN: r233366
gcc/cp/ChangeLog:
PR c++/69098
* pt.c (lookup_and_finish_template_variable): New function,
extracted from ...
(tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: ... here.
(tsubst_qualified_id): Consider that EXPR might be a variable
template.
* typeck.c (check_template_keyword): Don't emit an error
if DECL is a variable template.
gcc/testsuite/ChangeLog:
PR c++/69098
* g++.dg/cpp1y/69098.C: New test.
* g++.dg/cpp1y/69098-2.C: New test.
From-SVN: r233365
PR64682 is a problem in distribute_notes, where it has trouble putting
a REG_DEAD note for a reg that is set twice in the right spot. My fix
for that did the wrong thing for PR69567. And then my attempted fix
for that one made PR64682 fail again.
Instead, let's just lose the note in such complicated cases, like we
already do in certain similar cases.
PR rtl-optimization/64682
PR rtl-optimization/69567
PR rtl-optimization/69737
* combine.c (distribute_notes) <REG_DEAD>: If the register is set
in I2 as well, just lose it.
From-SVN: r233356
gcc/fortran/ChangeLog:
2016-02-11 Andre Vehreschild <vehre@gcc.gnu.org>
PR fortran/69296
* gfortran.h: Added flag to gfc_association_list indicating that
the rank of an associate variable has been guessed only.
* parse.c (parse_associate): Set the guess flag mentioned above
when guessing the rank of an expression.
* resolve.c (resolve_assoc_var): When the rank has been guessed,
make sure, that the guess was correct else overwrite with the actual
rank.
* trans-stmt.c (trans_associate_var): For subref_array_pointers in
class objects, take the span from the _data component.
gcc/testsuite/ChangeLog:
2016-02-11 Andre Vehreschild <vehre@gcc.gnu.org>
PR fortran/69296
* gfortran.dg/associate_19.f03: New test.
* gfortran.dg/associate_20.f03: New test.
From-SVN: r233351
* config/aarch64/aarch64.c (aarch64_last_printed_arch_string):
New variable.
(aarch64_last_printed_tune_string): Likewise.
(aarch64_declare_function_name): Only output .arch assembler
directive if it will be different from the previously output
directive. Same for .tune comment but only if -dA is set.
(aarch64_start_file): New function.
(TARGET_ASM_FILE_START): Define.
* gcc.target/aarch64/target_attr_15.c: Scan assembly for
.arch armv8-a\n. Add -dA to dg-options.
* gcc.target/aarch64/assembler_arch_1.c: New test.
* gcc.target/aarch64/target_attr_7.c: Add -dA to dg-options.
From-SVN: r233342
2016-02-11 Richard Biener <rguenther@suse.de>
PR rtl-optimization/69291
* ifcvt.c (noce_try_store_flag_constants): Do not allow
subexpressions affected by changing the result.
From-SVN: r233316
PR go/66904
cmd/go: fix "#cgo pkg-config:" comments with gccgo
Copy of https://golang.org/cl/18790 by Michael Hudson-Doyle.
The unique difficulty of #cgo pkg-config is that the linker flags are recorded
when the package is compiled but (obviously) must be used when the package is
linked into an executable -- so the flags need to be stored on disk somewhere.
As it happens cgo already writes out a _cgo_flags file: nothing uses it
currently, but this change adds it to the lib$pkg.a file when compiling a
package, reads it out when linking (and passes a version of the .a file with
_cgo_flags stripped out of it to the linker). It's all fairly ugly but it works
and I can't really think of any way of reducing the essential level of
ugliness.
Update golang/go#11739.
GCC PR 66904.
Reviewed-on: https://go-review.googlesource.com/19431
From-SVN: r233290
PR c++/10200
* parser.c (cp_parser_lookup_name): When looking for a template
after . or ->, only consider class templates.
(cp_parser_postfix_dot_deref_expression): Handle the current
instantiation. Remember a dependent object expression.
* typeck2.c (build_x_arrow): Handle the current instantiation.
From-SVN: r233277
PR ipa/69241
PR c++/69649
* gimplify.c (gimplify_modify_expr): Set lhs even for noreturn
calls if the return type is TREE_ADDRESSABLE.
* cgraphunit.c (cgraph_node::expand_thunk): Likewise.
* ipa-split.c (split_function): Fix doubled "we" in comment.
Use void return type for the split part even if
!split_point->split_part_set_retval.
* g++.dg/ipa/pr69241-1.C: New test.
* g++.dg/ipa/pr69241-2.C: New test.
* g++.dg/ipa/pr69241-3.C: New test.
* g++.dg/ipa/pr69649.C: New test.
Co-Authored-By: Patrick Palka <ppalka@gcc.gnu.org>
From-SVN: r233271
PR tree-optimization/68021
* tree-ssa-loop-ivopts.c (get_computation_aff): Set ratio to 1 if
when computing the value of biv cand by itself.
gcc/testsuite/ChangeLog
PR tree-optimization/68021
* gcc.dg/tree-ssa/pr68021.c: New test.
From-SVN: r233269
This can give up to 2x speedup on many AArch64 implementations. Also model
the crypto instructions on Cortex-A57 according to the Optimization Guide.
gcc/
* config/aarch64/aarch64.c (cortexa53_tunings): Enable AES fusion.
(cortexa57_tunings): Likewise.
(cortexa72_tunings): Likewise.
(arch_macro_fusion_pair_p): Add support for AES fusion.
* config/aarch64/aarch64-fusion-pairs.def: Add AES_AESMC entry.
* config/arm/aarch-common.c (aarch_crypto_can_dual_issue):
Allow virtual registers before reload so early scheduling works.
* config/arm/cortex-a57.md (cortex_a57_crypto_simple): Use
correct latency and pipeline.
(cortex_a57_crypto_complex): Likewise.
(cortex_a57_crypto_xor): Likewise.
(define_bypass): Add AES bypass.
From-SVN: r233268
2016-02-10 Richard Biener <rguenther@suse.de>
PR tree-optimization/69726
* passes.def: Add DCE pass before late uninit.
* match.pd: Add A ? B : (!A ? C : X) -> A ? B : C patterns to
really fixup if-conversions job.
* gcc.dg/uninit-22.c: New testcase.
From-SVN: r233267