2018-04-10 Martin Liska <mliska@suse.cz>
PR lto/85248
* lto-symtab.c (lto_symtab_merge_p): Do not check for
TREE_VALUES of error attributes.
From-SVN: r259274
PR target/85177
PR target/85255
* config/i386/sse.md
(<extract_type>_vinsert<shuffletype><extract_suf>_mask): Fix
computation of the VEC_MERGE selector from mask.
(<extract_type>_vinsert<shuffletype><extract_suf>_1<mask_name>):
Fix decoding of the VEC_MERGE selector into mask.
* gcc.target/i386/avx512f-pr85177.c: New test.
* gcc.target/i386/avx512f-pr85255.c: New test.
From-SVN: r259269
In this PR we used WIDEN_SUM_EXPR to vectorise:
short i, y;
int sum;
[...]
for (i = x; i > 0; i--)
sum += y;
with 4 ints and 8 shorts per vector. The problem was that we set
the VF based only on the ints, then calculated the number of vector
copies based on the shorts, giving 4/8. Previously that led to
ncopies==0, but after r249897 we pick it up as an ICE.
In this particular case we could vectorise the reduction by setting
ncopies based on the output type rather than the input type, but it
doesn't seem worth adding a special "optimisation" for such a
pathological case. I think it's really an instance of the more general
problem that we can't vectorise using combinations of (say) 64-bit and
128-bit vectors on targets that support both.
2018-04-10 Richard Sandiford <richard.sandiford@linaro.org>
gcc/
PR tree-optimization/85286
* tree-vect-data-refs.c (vect_get_smallest_scalar_type):
gcc/testsuite/
PR tree-optimization/85286
* gcc.dg/vect/pr85286.c: New test.
From-SVN: r259268
final_1 already sets insn_current_address for each instruction, making
it possible to use some of the address functions in final.c during
assembly generation. This patch also sets insn_last_address, since
as the comment says, we can treat final as a shorten_branches pass that
does nothing. It's then possible to use insn_current_reference_address
during final as well.
This is needed for the aarch64.md definitions of far_branch to work:
(set (attr "far_branch")
(if_then_else (and (ge (minus (match_dup 2) (pc)) (const_int -1048576))
(lt (minus (match_dup 2) (pc)) (const_int 1048572)))
(const_int 0)
(const_int 1)))]
This value (tested only during final) uses the difference between
the INSN_ADDRESSES of operand 2 and insn_current_reference_address
to calculate a conservatively-correct estimate of the branch distance.
It takes into account the worst-case gap due to alignment, whereas
a direct comparison of INSN_ADDRESSES would give an unreliable,
optimistic result.
2018-04-10 Richard Sandiford <richard.sandiford@linaro.org>
gcc/
* final.c (final_1): Set insn_last_address as well as
insn_current_address.
From-SVN: r259267
In this PR the expansion code emits an invalid memory address for the stack probe, which the backend fails to recognise.
The address is created explicitly in anti_adjust_stack_and_probe_stack_clash in explow.c and passed down to gen_probe_stack
without any validation in emit_stack_probe.
This patch fixes the ICE by calling validize_mem on the memory location before passing it down to the target.
Jakub pointed out that we also want to create valid addresses for the probe_stack_address case, so this patch
creates an expand operand and legitimizes it before passing it down to the probe_stack_address expander.
This patch passes bootstrap and testing on arm-none-linux-gnueabihf and aarch64-none-linux-gnu
and ppc64le-redhat-linux on gcc112 in the compile farm.
PR target/85173
* explow.c (emit_stack_probe): Call validize_mem on memory location
before passing it to gen_probe_stack. Create address operand and
legitimize it for the probe_stack_address case.
* gcc.target/arm/pr85173.c: New test.
From-SVN: r259266
/cp
2018-04-09 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/85227
* decl.c (cp_finish_decomp): In a template, if the type is incomplete
issue a pedwarn and defer trying to do bindings.
/testsuite
2018-04-09 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/85227
* g++.dg/cpp1z/decomp44.C: New.
* g++.dg/cpp1z/decomp45.C: Likewise.
From-SVN: r259259
2018-04-09 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/51260
* resolve.c (resolve_variable): Simplify cases where access to a
parameter array results in a single constant.
2018-04-09 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/51260
* gfortran.dg/parameter_array_element_3.f90: New test.
From-SVN: r259256
PR c++/85194
* parser.c (cp_parser_simple_declaration): For structured bindings,
if *maybe_range_for_decl is NULL after parsing it, set it to
error_mark_node.
* g++.dg/cpp1z/decomp43.C: New test.
From-SVN: r259252
PR rtl/84058
* cfgcleanup.c (try_forward_edges): Do not give up on crossing
jumps; choose last target that matches the criteria (i.e.
no partition changes for non-crossing jumps).
* cfgrtl.c (cfg_layout_redirect_edge_and_branch): Add basic
support for redirecting crossing jumps to non-crossing.
From-SVN: r259244
gcc/
2018-04-09 Alexey Brodkin <abrodkin@synopsys.com>
* config/arc/arc.c (arc_expand_prologue): Set stack usage info
also for naked functions.
From-SVN: r259238
2018-04-09 Richard Biener <rguenther@suse.de>
PR tree-optimization/85284
* tree-ssa-loop-niter.c (number_of_iterations_exit_assumptions):
Only use the niter constraining form of simple_iv when the exit
is always executed.
* gcc.dg/torture/pr85284.c: New testcase.
From-SVN: r259234
PR rtl-optimization/80463
PR rtl-optimization/83972
PR rtl-optimization/83480
* sel-sched-ir.c (has_dependence_note_mem_dep): Take into account the
correct producer for the insn.
(tidy_control_flow): Fixup seqnos in case of debug insns.
* gcc.dg/pr80463.c: New test.
* g++.dg/pr80463.C: Likewise.
* gcc.dg/pr83972.c: Likewise.
From-SVN: r259231
PR rtl-optimization/83913
* sel-sched-ir.c (merge_expr_data): Choose the middle between two
different sched-times when merging exprs.
* gcc.dg/pr83913.c: New test.
From-SVN: r259230
PR rtl-optimization/83962
* sel-sched-ir.c (tidy_control_flow): Correct the order in which we call
tidy_fallthru_edge and tidy_control_flow.
* gcc.dg/pr83962.c: New test.
From-SVN: r259229
PR rtl-optimization/83530
* sel-sched.c (force_next_insn): New global variable.
(remove_insn_for_debug): When force_next_insn is true, also leave only
next insn in the ready list.
(sel_sched_region): When the region wasn't scheduled, make another pass
over it with force_next_insn set to 1.
* gcc.dg/pr83530.c: New test.
From-SVN: r259228
gcc/
* config.gcc (nds32*): Add nds32-utils.o into extra_objs.
* config/nds32/nds32-n9-2r1w.md: New file.
* config/nds32/nds32-n9-3r2w.md: New file.
* config/nds32/nds32-opts.h (nds32_cpu_type, nds32_mul_type,
nds32_register_ports): New or modify for cpu n9.
* config/nds32/nds32-pipelines-auxiliary.c: Implementation for n9
pipeline.
* config/nds32/nds32-protos.h: More declarations for n9 pipeline.
* config/nds32/nds32-utils.c: New file.
* config/nds32/nds32.h (TARGET_PIPELINE_N9, TARGET_PIPELINE_SIMPLE,
TARGET_MUL_SLOW): Define.
* config/nds32/nds32.md (pipeline_model): New attribute.
* config/nds32/nds32.opt (mcpu, mconfig-mul, mconfig-register-ports):
New options that support cpu n9.
* config/nds32/pipelines.md: Include n9 settings.
* config/nds32/t-nds32 (nds32-utils.o): Add dependency.
Co-Authored-By: Chung-Ju Wu <jasonwucj@gmail.com>
From-SVN: r259218
2018-04-07 Thomas Koenig <tkoenig@gcc.gnu.org>
Andrew Pinski <pinsika@gcc.gnu.org>
PR middle-end/82976
* match.pd: Use constant_boolean_node of correct type instead of
boolean_true_node or boolean_false_node for simplifying
pointer comparisons to zero.
2018-04-07 Thomas Koenig <tkoenig@gcc.gnu.org>
PR middle-end/82976
* gfortran.dg/realloc_on_assign_16a.f90: New test.
Co-Authored-By: Andrew Pinski <pinskia@gcc.gnu.org>
From-SVN: r259212
PR tree-optimization/80021
* tree.c (verify_type_variant): Make error call in verify_variant_match
translatable and remove final full stop.
From-SVN: r259211
PR tree-optimization/85257
* fold-const.c (native_encode_vector): If not all elts could fit
and off is -1, return 0 rather than offset.
* tree-ssa-sccvn.c (vn_reference_lookup_3): Pass
(offseti - offset2) / BITS_PER_UNIT as 4th argument to
native_encode_expr. Verify len * BITS_PER_UNIT >= maxsizei. Don't
adjust buffer in native_interpret_expr call.
* gcc.dg/pr85257.c: New test.
From-SVN: r259206