PR target/84064
[official-gcc.git] / gcc / ChangeLog
blob4b18ca160db2f623a620519973b41f2520220ffc
1 2017-01-30  Jeff Law  <law@redhat.com>
3         PR target/84064
4         * i386.c (ix86_adjust_stack_and_probe_stack_clash): New argument
5         INT_REGISTERS_SAVED.  Check it prior to calling
6         get_scratch_register_on_entry.
7         (ix86_adjust_stack_and_probe): Similarly.
8         (ix86_emit_probe_stack_range): Similarly.
9         (ix86_expand_prologue): Corresponding changes.
11 2018-01-30  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
13         PR target/40411
14         * config/sol2.h (STARTFILE_ARCH_SPEC): Use -std=c*,
15         -std=iso9899:199409 instead of -pedantic to select values-Xc.o.
17 2018-01-30  Vladimir Makarov  <vmakarov@redhat.com>
19         PR target/84112
20         * lra-constraints.c (curr_insn_transform): Process AND in the
21         address.
23 2018-01-30  Jakub Jelinek  <jakub@redhat.com>
25         PR rtl-optimization/83986
26         * sched-deps.c (sched_analyze_insn): For frame related insns, add anti
27         dependence against last_pending_memory_flush in addition to
28         pending_jump_insns.
30 2018-01-30  Alexandre Oliva <aoliva@redhat.com>
32         PR tree-optimization/81611
33         * tree-ssa-dom.c (simple_iv_increment_p): Skip intervening
34         copies.
36 2018-01-30  Aaron Sawdey  <acsawdey@linux.vnet.ibm.com>
38         * config/rs6000/rs6000.c (rs6000_internal_arg_pointer): Only return
39         a reg rtx.
41 2018-01-30  Richard Biener  <rguenther@suse.de>
42             Jakub Jelinek  <jakub@redhat.com>
44         PR tree-optimization/84111
45         * tree-ssa-loop-ivcanon.c (tree_unroll_loops_completely_1): Skip
46         inner loops added during recursion, as they don't have up-to-date
47         SSA form.
49 2018-01-30  Jan Hubicka  <hubicka@ucw.cz>
51         PR ipa/81360
52         * ipa-inline.c (can_inline_edge_p): Break out late tests to...
53         (can_inline_edge_by_limits_p): ... here.
54         (can_early_inline_edge_p, check_callers,
55         update_caller_keys, update_callee_keys, recursive_inlining,
56         add_new_edges_to_heap, speculation_useful_p,
57         inline_small_functions,
58         inline_small_functions, flatten_function,
59         inline_to_all_callers_1): Update.
61 2018-01-30  Jan Hubicka  <hubicka@ucw.cz>
63         * profile-count.c (profile_count::combine_with_ipa_count): Handle
64         zeros correctly.
66 2018-01-30  Richard Biener  <rguenther@suse.de>
68         PR tree-optimization/83008
69         * tree-vect-slp.c (vect_analyze_slp_cost_1): Properly cost
70         invariant and constant vector uses in stmts when they need
71         more than one stmt.
73 2018-01-30  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
75         PR bootstrap/84017
76         * configure.ac (gcc_cv_as_shf_merge): Disable on Solaris 10/x86.
77         * configure: Regenerate.
79 2018-01-30  Richard Sandiford  <richard.sandiford@linaro.org>
81         * config/aarch64/aarch64-sve.md (*vec_extract<mode><Vel>_0): New
82         pattern.
83         (*vec_extract<mode><Vel>_v128): Require a nonzero lane number.
84         Use gen_rtx_REG rather than gen_lowpart.
86 2018-01-30  Richard Sandiford  <richard.sandiford@linaro.org>
88         * lra-constraints.c (match_reload): Use subreg_lowpart_offset
89         rather than 0 when creating partial subregs.
91 2018-01-30  Richard Sandiford  <richard.sandiford@linaro.org>
93         * vec-perm-indices.c (vec_perm_indices::series_p): Give examples
94         of usage.
96 2018-01-29  Michael Meissner  <meissner@linux.vnet.ibm.com>
98         PR target/81550
99         * config/rs6000/rs6000.c (rs6000_setup_reg_addr_masks): If DFmode
100         and SFmode can go in Altivec registers (-mcpu=power7 for DFmode,
101         -mcpu=power8 for SFmode) don't set the PRE_INCDEC or PRE_MODIFY
102         flags.  This restores the settings used before the 2017-07-24.
103         Turning off pre increment/decrement/modify allows IVOPTS to
104         optimize DF/SF loops where the index is an int.
106 2018-01-29  Richard Biener <rguenther@suse.de>
107             Kelvin Nilsen  <kelvin@gcc.gnu.org>
109         PR bootstrap/80867
110         * tree-vect-stmts.c (vectorizable_call): Don't call
111         targetm.vectorize_builtin_md_vectorized_function if callee is
112         NULL.
114 2018-01-22 Carl Love <cel@us.ibm.com>
116         * doc/extend.tex: Fix typo in second arg in
117         __builtin_bcdadd_{lt|eq|gt|ov} and __builtin_bcdsub_{lt|eq|gt|ov}.
119 2018-01-29  Richard Biener  <rguenther@suse.de>
121         PR tree-optimization/84086
122         * tree-ssanames.c: Include cfgloop.h and tree-scalar-evolution.h.
123         (flush_ssaname_freelist): When SSA names were released reset
124         the SCEV hash table.
126 2018-01-29  Richard Biener  <rguenther@suse.de>
128         PR tree-optimization/84057
129         * tree-ssa-loop-ivcanon.c (unloop_loops): Deal with already
130         removed paths when removing edges.
132 2018-01-27  H.J. Lu  <hongjiu.lu@intel.com>
134         * doc/invoke.texi: Replace -mfunction-return==@var{choice} with
135         -mfunction-return=@var{choice}.
137 2018-01-27  Bernd Edlinger  <bernd.edlinger@hotmail.de>
139         PR diagnostic/84034
140         * diagnostic-show-locus.c (get_line_width_without_trailing_whitespace):
141         Handle CR like TAB.
142         (layout::print_source_line): Likewise.
143         (test_get_line_width_without_trailing_whitespace): Add test cases.
145 2018-01-27  Jakub Jelinek  <jakub@redhat.com>
147         PR middle-end/84040
148         * sched-deps.c (sched_macro_fuse_insns): Return immediately for
149         debug insns.
151 2018-01-26  Jim Wilson  <jimw@sifive.com>
153         * config/riscv/riscv.h (MAX_FIXED_MODE_SIZE): New.
155         * config/riscv/elf.h (LIB_SPEC): Don't include -lgloss when nosys.specs
156         specified.
158 2018-01-26  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
160         * config/aarch64/aarch64.md: Add peepholes for CMP + SUB -> SUBS
161         and CMP + SUB-immediate -> SUBS.
163 2018-01-26  Martin Sebor  <msebor@redhat.com>
165         PR tree-optimization/83896
166         * tree-ssa-strlen.c (get_string_len): Rename...
167         (get_string_cst_length): ...to this.  Return HOST_WIDE_INT.
168         Avoid assuming length is constant.
169         (handle_char_store): Use HOST_WIDE_INT for string length.
171 2018-01-26  Uros Bizjak  <ubizjak@gmail.com>
173         PR target/81763
174         * config/i386/i386.md (*andndi3_doubleword): Add earlyclobber
175         to (=&r,r,rm) alternative. Add (=r,0,rm) and (=r,r,0) alternatives.
177 2018-01-26  Richard Biener  <rguenther@suse.de>
179         PR rtl-optimization/84003
180         * dse.c (record_store): Only record redundant stores when
181         the earlier store aliases at least all accesses the later one does.
183 2018-01-26  Jakub Jelinek  <jakub@redhat.com>
185         PR rtl-optimization/83985
186         * dce.c (deletable_insn_p): Return false for separate shrink wrapping
187         REG_CFA_RESTORE insns.
188         (delete_unmarked_insns): Don't ignore separate shrink wrapping
189         REG_CFA_RESTORE insns here.
191         PR c/83989
192         * gimple-ssa-warn-restrict.c (builtin_memref::builtin_memref): Don't
193         use SSA_NAME_VAR as base for SSA_NAMEs with non-NULL SSA_NAME_VAR.
195 2018-01-26  Claudiu Zissulescu  <claziss@synopsys.com>
197         * config/arc/arc-arch.h (arc_tune_attr): Add ARC_TUNE_CORE_3.
198         * config/arc/arc.c (arc_sched_issue_rate): Use ARC_TUNE_... .
199         (arc_init): Likewise.
200         (arc_override_options): Likewise.
201         (arc_file_start): Choose Tag_ARC_CPU_variation based on arc_tune
202         value.
203         (hwloop_fail): Use TARGET_DBNZ when we want to check for dbnz insn
204         support.
205         * config/arc/arc.h (TARGET_DBNZ): Define.
206         * config/arc/arc.md (attr tune): Add core_3, use ARC_TUNE_... to
207         properly set the tune attribute.
208         (dbnz): Use TARGET_DBNZ guard.
209         * config/arc/arc.opt (mtune): Add core3 option.
211 2018-01-26  Claudiu Zissulescu  <claziss@synopsys.com>
213         * config/arc/arc.c (arc_delegitimize_address_0): Refactored to
214         recognize new pic like addresses.
215         (arc_delegitimize_address): Clean up.
217 2018-01-26  Claudiu Zissulescu  <claziss@synopsys.com>
219         * config/arc/arc-arches.def: Option mrf16 valid for all
220         architectures.
221         * config/arc/arc-c.def (__ARC_RF16__): New predefined macro.
222         * config/arc/arc-cpus.def (em_mini): New cpu with rf16 on.
223         * config/arc/arc-options.def (FL_RF16): Add mrf16 option.
224         * config/arc/arc-tables.opt: Regenerate.
225         * config/arc/arc.c (arc_conditional_register_usage): Handle
226         reduced register file case.
227         (arc_file_start): Set must have build attributes.
228         * config/arc/arc.h (MAX_ARC_PARM_REGS): Conditional define using
229         mrf16 option value.
230         * config/arc/arc.opt (mrf16): Add new option.
231         * config/arc/elf.h (ATTRIBUTE_PCS): Define.
232         * config/arc/genmultilib.awk: Handle new mrf16 option.
233         * config/arc/linux.h (ATTRIBUTE_PCS): Define.
234         * config/arc/t-multilib: Regenerate.
235         * doc/invoke.texi (ARC Options): Document mrf16 option.
237 2018-01-26  Claudiu Zissulescu  <claziss@synopsys.com>
239         * config/arc/arc-protos.h: Add arc_is_secure_call_p proto.
240         * config/arc/arc.c (arc_handle_secure_attribute): New function.
241         (arc_attribute_table): Add 'secure_call' attribute.
242         (arc_print_operand): Print secure call operand.
243         (arc_function_ok_for_sibcall): Don't optimize tail calls when
244         secure.
245         (arc_is_secure_call_p): New function.  * config/arc/arc.md
246         (call_i): Add support for sjli instruction.
247         (call_value_i): Likewise.
248         * config/arc/constraints.md (Csc): New constraint.
250 2018-01-26  Claudiu Zissulescu  <claziss@synopsys.com>
251             John Eric Martin <John.Martin@emmicro-us.com>
253         * config/arc/arc-protos.h: Add arc_is_jli_call_p proto.
254         * config/arc/arc.c (_arc_jli_section): New struct.
255         (arc_jli_section): New type.
256         (rc_jli_sections): New static variable.
257         (arc_handle_jli_attribute): New function.
258         (arc_attribute_table): Add jli_always and jli_fixed attribute.
259         (arc_file_end): New function.
260         (TARGET_ASM_FILE_END): Define.
261         (arc_print_operand): Reuse 'S' letter for JLI output instruction.
262         (arc_add_jli_section): New function.
263         (jli_call_scan): Likewise.
264         (arc_reorg): Call jli_call_scan.
265         (arc_output_addsi): Remove 'S' from printing asm operand.
266         (arc_is_jli_call_p): New function.
267         * config/arc/arc.md (movqi_insn): Remove 'S' from printing asm
268         operand.
269         (movhi_insn): Likewise.
270         (movsi_insn): Likewise.
271         (movsi_set_cc_insn): Likewise.
272         (loadqi_update): Likewise.
273         (load_zeroextendqisi_update): Likewise.
274         (load_signextendqisi_update): Likewise.
275         (loadhi_update): Likewise.
276         (load_zeroextendhisi_update): Likewise.
277         (load_signextendhisi_update): Likewise.
278         (loadsi_update): Likewise.
279         (loadsf_update): Likewise.
280         (movsicc_insn): Likewise.
281         (bset_insn): Likewise.
282         (bxor_insn): Likewise.
283         (bclr_insn): Likewise.
284         (bmsk_insn): Likewise.
285         (bicsi3_insn): Likewise.
286         (cmpsi_cc_c_insn): Likewise.
287         (movsi_ne): Likewise.
288         (movsi_cond_exec): Likewise.
289         (clrsbsi2): Likewise.
290         (norm_f): Likewise.
291         (normw): Likewise.
292         (swap): Likewise.
293         (divaw): Likewise.
294         (flag): Likewise.
295         (sr): Likewise.
296         (kflag): Likewise.
297         (ffs): Likewise.
298         (ffs_f): Likewise.
299         (fls): Likewise.
300         (call_i): Remove 'S' asm letter, add jli instruction.
301         (call_value_i): Likewise.
302         * config/arc/arc.op (mjli-always): New option.
303         * config/arc/constraints.md (Cji): New constraint.
304         * config/arc/fpx.md (addsf3_fpx): Remove 'S' from printing asm
305         operand.
306         (subsf3_fpx): Likewise.
307         (mulsf3_fpx): Likewise.
308         * config/arc/simdext.md (vendrec_insn): Remove 'S' from printing
309         asm operand.
310         * doc/extend.texi (ARC): Document 'jli-always' and 'jli-fixed'
311         function attrbutes.
312         * doc/invoke.texi (ARC): Document mjli-always option.
314 2018-01-26  Sebastian Perta  <sebastian.perta@renesas.com>
316         * config/rl78/rl78.c: if operand 2 is const avoid addition with 0
317         and use incw and decw where possible
318         * testsuite/gcc.target/rl78/test_addsi3_internal.c: new file
320 2018-01-26  Richard Biener  <rguenther@suse.de>
322         PR tree-optimization/81082
323         * fold-const.c (fold_plusminus_mult_expr): Do not perform the
324         association if it requires casting to unsigned.
325         * match.pd ((A * C) +- (B * C) -> (A+-B)): New patterns derived
326         from fold_plusminus_mult_expr to catch important cases late when
327         range info is available.
329 2018-01-26  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
331         * config/i386/sol2.h (USE_HIDDEN_LINKONCE): Remove.
332         * configure.ac (hidden_linkonce): New test.
333         * configure: Regenerate.
334         * config.in: Regenerate.
336 2018-01-26  Julia Koval  <julia.koval@intel.com>
338         * config/i386/avx512bitalgintrin.h (_mm512_bitshuffle_epi64_mask,
339         _mm512_mask_bitshuffle_epi64_mask, _mm256_bitshuffle_epi64_mask,
340         _mm256_mask_bitshuffle_epi64_mask, _mm_bitshuffle_epi64_mask,
341         _mm_mask_bitshuffle_epi64_mask): Fix type.
342         * config/i386/i386-builtin-types.def (UHI_FTYPE_V2DI_V2DI_UHI,
343         USI_FTYPE_V4DI_V4DI_USI): Remove.
344         * config/i386/i386-builtin.def (__builtin_ia32_vpshufbitqmb512_mask,
345         __builtin_ia32_vpshufbitqmb256_mask,
346         __builtin_ia32_vpshufbitqmb128_mask): Fix types.
347         * config/i386/i386.c (ix86_expand_args_builtin): Remove old types.
348         * config/i386/sse.md (VI1_AVX512VLBW): Change types.
350 2018-01-26  Alan Modra  <amodra@gmail.com>
352         PR target/84033
353         * config/rs6000/rs6000-p8swap.c (rtx_is_swappable_p): Exclude
354         UNSPEC_VBPERMQ.  Sort other unspecs.
356 2018-01-25  David Edelsohn  <dje.gcc@gmail.com>
358         * doc/invoke.texi (PowerPC Options): Document 'native' cpu type.
360 2018-01-25  Jan Hubicka  <hubicka@ucw.cz>
362         PR middle-end/83055
363         * predict.c (drop_profile): Do not push/pop cfun; update also
364         node->count.
365         (handle_missing_profiles): Fix logic looking for zero profiles.
367 2018-01-25  Jakub Jelinek  <jakub@redhat.com>
369         PR middle-end/83977
370         * ipa-fnsummary.c (compute_fn_summary): Clear can_change_signature
371         on functions with #pragma omp declare simd or functions with simd
372         attribute.
373         * omp-simd-clone.c (expand_simd_clones): Revert 2018-01-24 change.
374         * config/i386/i386.c (ix86_simd_clone_compute_vecsize_and_simdlen):
375         Remove trailing \n from warning_at calls.
377 2018-01-25  Tom de Vries  <tom@codesourcery.com>
379         PR target/84028
380         * config/nvptx/nvptx.c (nvptx_single): Add exit insn after noreturn call
381         for neutered workers.
383 2018-01-24  Joseph Myers  <joseph@codesourcery.com>
385         PR target/68467
386         * config/m68k/m68k.c (m68k_promote_function_mode): New function.
387         (TARGET_PROMOTE_FUNCTION_MODE): New macro.
389 2017-01-24  Jeff Law  <law@redhat.com>
391         PR target/83994
392         * i386.c (get_probe_interval): Move to earlier point.
393         (ix86_compute_frame_layout): If -fstack-clash-protection and
394         the frame is larger than the probe interval, then use pushes
395         to save registers rather than reg->mem moves.
396         (ix86_expand_prologue): Remove conditional for int_registers_saved
397         assertion.
399 2018-01-24  Vladimir Makarov  <vmakarov@redhat.com>
401         PR target/84014
402         * ira-build.c (setup_min_max_allocno_live_range_point): Set up
403         min/max for never referenced object.
405 2018-01-24  Jakub Jelinek  <jakub@redhat.com>
407         PR middle-end/83977
408         * tree.c (free_lang_data_in_decl): Don't clear DECL_ABSTRACT_ORIGIN
409         here.
410         * omp-low.c (create_omp_child_function): Remove "omp declare simd"
411         attributes from DECL_ATTRIBUTES (decl) without affecting
412         DECL_ATTRIBUTES (current_function_decl).
413         * omp-simd-clone.c (expand_simd_clones): Ignore DECL_ARTIFICIAL
414         functions with non-NULL DECL_ABSTRACT_ORIGIN.
416 2018-01-24  Richard Sandiford  <richard.sandiford@linaro.org>
418         PR tree-optimization/83979
419         * fold-const.c (fold_comparison): Use constant_boolean_node
420         instead of boolean_{true,false}_node.
422 2018-01-24  Jan Hubicka  <hubicka@ucw.cz>
424         * ipa-profile.c (ipa_propagate_frequency_1): Fix logic skipping calls
425         with zero counts.
427 2018-01-24  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
429         * config/rs6000/rs6000.md (*call_indirect_nonlocal_sysv<mode>):
430         Simplify the clause that sets the length attribute.
431         (*call_value_indirect_nonlocal_sysv<mode>): Likewise.
432         (*sibcall_nonlocal_sysv<mode>): Clean up code block; simplify the
433         clause that sets the length attribute.
434         (*sibcall_value_nonlocal_sysv<mode>): Likewise.
436 2018-01-24  Tom de Vries  <tom@codesourcery.com>
438         PR target/83589
439         * config/nvptx/nvptx.c (WORKAROUND_PTXJIT_BUG_2): Define to 1.
440         (nvptx_pc_set, nvptx_condjump_label): New function. Copy from jump.c.
441         Add strict parameter.
442         (prevent_branch_around_nothing): Insert dummy insn between branch to
443         label and label with no ptx insn inbetween.
444         * config/nvptx/nvptx.md (define_insn "fake_nop"): New insn.
446 2018-01-24  Tom de Vries  <tom@codesourcery.com>
448         PR target/81352
449         * config/nvptx/nvptx.c (nvptx_single): Add exit insn after noreturn call
450         for neutered threads in warp.
451         * config/nvptx/nvptx.md (define_insn "exit"): New insn.
453 2018-01-24  Richard Biener  <rguenther@suse.de>
455         PR tree-optimization/83176
456         * tree-chrec.c (chrec_fold_plus_1): Handle (signed T){(T) .. }
457         operands.
459 2018-01-24  Richard Biener  <rguenther@suse.de>
461         PR tree-optimization/82819
462         * graphite-isl-ast-to-gimple.c (binary_op_to_tree): Avoid
463         code generating pluses that are no-ops in the target precision.
465 2018-01-24  Richard Biener  <rguenther@suse.de>
467         PR middle-end/84000
468         * tree-cfg.c (replace_loop_annotate): Handle annot_expr_parallel_kind.
470 2018-01-23  Jan Hubicka  <hubicka@ucw.cz>
472         * cfgcleanup.c (try_crossjump_to_edge): Use combine_with_count
473         to merge probabilities.
474         * predict.c (probably_never_executed): Also mark as cold functions
475         with global 0 profile and guessed local profile.
476         * profile-count.c (profile_probability::combine_with_count): New
477         member function.
478         * profile-count.h (profile_probability::operator*,
479         profile_probability::operator*=, profile_probability::operator/,
480         profile_probability::operator/=): Reduce precision to adjusted
481         and set value to guessed on contradictory divisions.
482         (profile_probability::combine_with_freq): Remove.
483         (profile_probability::combine_wiht_count): Declare.
484         (profile_count::force_nonzero):: Set to adjusted.
485         (profile_count::probability_in):: Set quality to adjusted.
486         * tree-ssa-tail-merge.c (replace_block_by): Use
487         combine_with_count.
489 2018-01-23  Andrew Waterman  <andrew@sifive.com>
490             Jim Wilson  <jimw@sifive.com>
492         * config/riscv/riscv.c (riscv_stack_boundary): New.
493         (riscv_option_override): Set riscv_stack_boundary.  Handle
494         riscv_preferred_stack_boundary_arg.
495         * config/riscv/riscv.h (MIN_STACK_BOUNDARY, ABI_STACK_BOUNDARY): New.
496         (BIGGEST_ALIGNMENT): Set to STACK_BOUNDARY.
497         (STACK_BOUNDARY): Set to riscv_stack_boundary.
498         (RISCV_STACK_ALIGN): Use STACK_BOUNDARY.
499         * config/riscv/riscv.opt (mpreferred-stack-boundary): New.
500         * doc/invoke.tex (RISC-V Options): Add -mpreferred-stack-boundary.
502 2018-01-23  H.J. Lu  <hongjiu.lu@intel.com>
504         PR target/83905
505         * config/i386/i386.c (ix86_expand_prologue): Use cost reference
506         of struct ix86_frame.
507         (ix86_expand_epilogue): Likewise.  Add a local variable for
508         the reg_save_offset field in struct ix86_frame.
510 2018-01-23  Bin Cheng  <bin.cheng@arm.com>
512         PR tree-optimization/82604
513         * tree-loop-distribution.c (enum partition_kind): New enum item
514         PKIND_PARTIAL_MEMSET.
515         (partition_builtin_p): Support above new enum item.
516         (generate_code_for_partition): Ditto.
517         (compute_access_range): Differentiate cases that equality can be
518         proven at all loops, the innermost loops or no loops.
519         (classify_builtin_st, classify_builtin_ldst): Adjust call to above
520         function.  Set PKIND_PARTIAL_MEMSET for partition appropriately.
521         (finalize_partitions, distribute_loop): Don't fuse partition of
522         PKIND_PARTIAL_MEMSET kind when distributing 3-level loop nest.
523         (prepare_perfect_loop_nest): Distribute 3-level loop nest only if
524         parloop is enabled.
526 2018-01-23  Martin Liska  <mliska@suse.cz>
528         * predict.def (PRED_INDIR_CALL): Set probability to PROB_EVEN in
529         order to ignore the predictor.
530         (PRED_POLYMORPHIC_CALL): Likewise.
531         (PRED_RECURSIVE_CALL): Likewise.
533 2018-01-23  Martin Liska  <mliska@suse.cz>
535         * tree-profile.c (tree_profiling): Print function header to
536         aware reader which function we are working on.
537         * value-prof.c (gimple_find_values_to_profile): Do not print
538         not interesting value histograms.
540 2018-01-23  Martin Liska  <mliska@suse.cz>
542         * profile-count.h (enum profile_quality): Add
543         profile_uninitialized as the first value. Do not number values
544         as they are zero based.
545         (profile_count::verify): Update sanity check.
546         (profile_probability::verify): Likewise.
548 2018-01-23  Nathan Sidwell  <nathan@acm.org>
550         * doc/invoke.texi (ffor-scope): Deprecate.
552 2018-01-23  David Malcolm  <dmalcolm@redhat.com>
554         PR tree-optimization/83510
555         * domwalk.c (set_all_edges_as_executable): New function.
556         (dom_walker::dom_walker): Convert bool param
557         "skip_unreachable_blocks" to enum reachability.  Move setup of
558         edge flags to set_all_edges_as_executable and only do it when
559         reachability is REACHABLE_BLOCKS.
560         * domwalk.h (enum dom_walker::reachability): New enum.
561         (dom_walker::dom_walker): Convert bool param
562         "skip_unreachable_blocks" to enum reachability.
563         (set_all_edges_as_executable): New decl.
564         * graphite-scop-detection.c  (gather_bbs::gather_bbs): Convert
565         from false for "skip_unreachable_blocks" to ALL_BLOCKS for
566         "reachability".
567         * tree-ssa-dom.c (dom_opt_dom_walker::dom_opt_dom_walker): Likewise,
568         but converting true to REACHABLE_BLOCKS.
569         * tree-ssa-sccvn.c (sccvn_dom_walker::sccvn_dom_walker): Likewise.
570         * tree-vrp.c
571         (check_array_bounds_dom_walker::check_array_bounds_dom_walker):
572         Likewise, but converting it to REACHABLE_BLOCKS_PRESERVING_FLAGS.
573         (vrp_dom_walker::vrp_dom_walker): Likewise, but converting it to
574         REACHABLE_BLOCKS.
575         (vrp_prop::vrp_finalize): Call set_all_edges_as_executable
576         if check_all_array_refs will be called.
578 2018-01-23  David Malcolm  <dmalcolm@redhat.com>
580         * tree.c (selftest::test_location_wrappers): Add more test
581         coverage.
583 2018-01-23  David Malcolm  <dmalcolm@redhat.com>
585         * sbitmap.c (selftest::test_set_range): Fix memory leaks.
586         (selftest::test_bit_in_range): Likewise.
588 2018-01-23  Richard Sandiford  <richard.sandiford@linaro.org>
590         PR testsuite/83888
591         * doc/sourcebuild.texi (vect_float): Say that the selector
592         only describes the situation when -funsafe-math-optimizations is on.
593         (vect_float_strict): Document.
595 2018-01-23  Richard Sandiford  <richard.sandiford@linaro.org>
597         PR tree-optimization/83965
598         * tree-vect-patterns.c (vect_reassociating_reduction_p): New function.
599         (vect_recog_dot_prod_pattern, vect_recog_sad_pattern): Use it
600         instead of checking only for a reduction.
601         (vect_recog_widen_sum_pattern): Likewise.
603 2018-01-23  Jan Hubicka  <hubicka@ucw.cz>
605         * predict.c (probably_never_executed): Only use precise profile info.
606         (compute_function_frequency): Skip after inlining hack since we now
607         have quality checking.
609 2018-01-23  Jan Hubicka  <hubicka@ucw.cz>
611         * profile-count.h (profile_probability::very_unlikely,
612         profile_probability::unlikely, profile_probability::even): Set
613         precision to guessed.
615 2018-01-23  Richard Biener  <rguenther@suse.de>
617         PR tree-optimization/83963
618         * graphite-scop-detection.c (scop_detection::harmful_loop_in_region):
619         Properly terminate dominator walk when crossing the exit edge not
620         when visiting its source block.
622 2018-01-23  Jakub Jelinek  <jakub@redhat.com>
624         PR c++/83918
625         * tree.c (maybe_wrap_with_location): Use NON_LVALUE_EXPR rather than
626         VIEW_CONVERT_EXPR to wrap CONST_DECLs.
628 2018-01-22  Jakub Jelinek  <jakub@redhat.com>
630         PR tree-optimization/83957
631         * omp-expand.c (expand_omp_for_generic): Ignore virtual PHIs.  Remove
632         semicolon after for body surrounded by braces.
634         PR tree-optimization/83081
635         * profile-count.h (profile_probability::split): New method.
636         * dojump.c (do_jump_1) <case TRUTH_ANDIF_EXPR, case TRUTH_ORIF_EXPR>:
637         Use profile_probability::split.
638         (do_compare_rtx_and_jump): Fix adjustment of probabilities
639         when splitting a single conditional jump into 2.
641 2018-01-22  David Malcolm  <dmalcolm@redhat.com>
643         PR tree-optimization/69452
644         * tree-ssa-loop-im.c (class move_computations_dom_walker): Remove
645         decl.
647 2018-01-22  Sebastian Perta  <sebastian.perta@renesas.com>
649         * config/rl78/rl78-expand.md: New define_expand "bswaphi2"
650         * config/rl78/rl78-virt.md: New define_insn "*bswaphi2_virt"
651         * config/rl78/rl78-real.md: New define_insn "*bswaphi2_real"
653 2018-01-22  Sebastian Perta  <sebastian.perta@renesas.com>
655         * config/rl78/rl78-protos.h: New function declaration rl78_split_movdi
656         * config/rl78/rl78.md: New define_expand "movdi"
657         * config/rl78/rl78.c: New function definition rl78_split_movdi
659 2018-01-22  Michael Meissner  <meissner@linux.vnet.ibm.com>
661         PR target/83862
662         * config/rs6000/rs6000-protos.h (rs6000_split_signbit): Delete,
663         no longer used.
664         * config/rs6000/rs6000.c (rs6000_split_signbit): Likewise.
665         * config/rs6000/rs6000.md (signbit<mode>2): Change code for IEEE
666         128-bit to produce an UNSPEC move to get the double word with the
667         signbit and then a shift directly to do signbit.
668         (signbit<mode>2_dm): Replace old IEEE 128-bit signbit
669         implementation with a new version that just does either a direct
670         move or a regular move.  Move memory interface to separate insns.
671         Move insns so they are next to the expander.
672         (signbit<mode>2_dm_mem_be): New combiner insns to combine load
673         with signbit move.  Split big and little endian case.
674         (signbit<mode>2_dm_mem_le): Likewise.
675         (signbit<mode>2_dm_<su>ext): Delete, no longer used.
676         (signbit<mode>2_dm2): Likewise.
678 2018-01-22  Sebastian Perta  <sebastian.perta@renesas.com>
680         * config/rl78/rl78.md: New define_expand "anddi3".
682 2018-01-22  Sebastian Perta  <sebastian.perta@renesas.com>
684         * config/rl78/rl78.md: New define_expand "umindi3".
686 2018-01-22  Sebastian Perta  <sebastian.perta@renesas.com>
688         * config/rl78/rl78.md: New define_expand "smindi3".
690 2018-01-22  Sebastian Perta  <sebastian.perta@renesas.com>
692         * config/rl78/rl78.md: New define_expand "smaxdi3".
694 2018-01-22 Carl Love <cel@us.ibm.com>
696         * config/rs6000/rs6000-builtin.def (ST_ELEMREV_V1TI, LD_ELEMREV_V1TI,
697         LVX_V1TI): Add macro expansion.
698         * config/rs6000/rs6000-c.c (altivec_builtin_types): Add argument
699         definitions for VSX_BUILTIN_VEC_XST_BE, VSX_BUILTIN_VEC_ST,
700         VSX_BUILTIN_VEC_XL, LD_ELEMREV_V1TI builtins.
701         * config/rs6000/rs6000-p8swap.c (insn_is_swappable_p);
702         Change check to determine if the instruction is a byte reversing
703         entry.  Fix typo in comment.
704         * config/rs6000/rs6000.c (altivec_expand_builtin): Add case entry
705         for VSX_BUILTIN_ST_ELEMREV_V1TI and VSX_BUILTIN_LD_ELEMREV_V1TI.
706         Add def_builtin calls for new builtins.
707         * config/rs6000/vsx.md (vsx_st_elemrev_v1ti, vsx_ld_elemrev_v1ti):
708         Add define_insn expansion.
710 2018-01-22  Sebastian Perta  <sebastian.perta@renesas.com>
712         * config/rl78/rl78.md: New define_expand "umaxdi3".
714 2018-01-22  Sebastian Perta  <sebastian.perta@renesas.com>
716         * config/rl78/rl78.c (rl78_note_reg_set): fixed dead reg check
717         for non-QImode registers
719 2018-01-22  Richard Biener  <rguenther@suse.de>
721         PR tree-optimization/83963
722         * graphite-scop-detection.c (scop_detection::get_sese): Delay
723         including the loop exit block.
724         (scop_detection::merge_sese): Likewise.
725         (scop_detection::add_scop): Do it here instead.
727 2018-01-22  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
729         * doc/sourcebuild.texi (arm_softfloat): Document.
731 2018-01-21  John David Anglin  <danglin@gcc.gnu.org>
733         PR gcc/77734
734         * config/pa/pa.c (pa_function_ok_for_sibcall): Use
735         targetm.binds_local_p instead of TREE_PUBLIC to check local binding.
736         Move TARGET_PORTABLE_RUNTIME check after TARGET_64BIT check.
738 2018-01-21  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
739             David Edelsohn <dje.gcc@gmail.com>
741         PR target/83946
742         * config/rs6000/rs6000.md (*call_indirect_nonlocal_sysv<mode>):
743         Change "crset eq" to "crset 2".
744         (*call_value_indirect_nonlocal_sysv<mode>): Likewise.
745         (*call_indirect_aix<mode>_nospec): Likewise.
746         (*call_value_indirect_aix<mode>_nospec): Likewise.
747         (*call_indirect_elfv2<mode>_nospec): Likewise.
748         (*call_value_indirect_elfv2<mode>_nospec): Likewise.
749         (*sibcall_nonlocal_sysv<mode>): Change "crset eq" to "crset 2";
750         change assembly output from . to $.
751         (*sibcall_value_nonlocal_sysv<mode>): Likewise.
752         (indirect_jump<mode>_nospec): Change assembly output from . to $.
753         (*tablejump<mode>_internal1_nospec): Likewise.
755 2018-01-21  Oleg Endo  <olegendo@gcc.gnu.org>
757         PR target/80870
758         * config/sh/sh_optimize_sett_clrt.cc:
759         Use INCLUDE_ALGORITHM and INCLUDE_VECTOR instead of direct includes.
761 2018-01-20  Richard Sandiford  <richard.sandiford@linaro.org>
763         PR tree-optimization/83940
764         * tree-vect-stmts.c (vect_truncate_gather_scatter_offset): Set
765         offset_dt to vect_constant_def rather than vect_unknown_def_type.
766         (vect_check_load_store_mask): Add a mask_dt_out parameter and
767         use it to pass back the definition type.
768         (vect_check_store_rhs): Likewise rhs_dt_out.
769         (vect_build_gather_load_calls): Add a mask_dt argument and use
770         it instead of a call to vect_is_simple_use.
771         (vectorizable_store): Update calls to vect_check_load_store_mask
772         and vect_check_store_rhs.  Use the dt returned by the latter instead
773         of scatter_src_dt.  Use the cached mask_dt and gs_info.offset_dt
774         instead of calls to vect_is_simple_use.  Pass the scalar rather
775         than the vector operand to vect_is_simple_use when handling
776         second and subsequent copies of an rhs value.
777         (vectorizable_load): Update calls to vect_check_load_store_mask
778         and vect_build_gather_load_calls.  Use the cached mask_dt and
779         gs_info.offset_dt instead of calls to vect_is_simple_use.
781 2018-01-20  Jakub Jelinek  <jakub@redhat.com>
783         PR middle-end/83945
784         * tree-emutls.c: Include gimplify.h.
785         (lower_emutls_2): New function.
786         (lower_emutls_1): If ADDR_EXPR is a gimple invariant and walk_tree
787         with lower_emutls_2 callback finds some TLS decl in it, unshare_expr
788         it before further processing.
790         PR target/83930
791         * simplify-rtx.c (simplify_binary_operation_1) <case UMOD>: Use
792         UINTVAL (trueop1) instead of INTVAL (op1).
794 2018-01-19  Jakub Jelinek  <jakub@redhat.com>
796         PR debug/81570
797         PR debug/83728
798         * dwarf2cfi.c (DEFAULT_INCOMING_FRAME_SP_OFFSET): Define to
799         INCOMING_FRAME_SP_OFFSET if not defined.
800         (scan_trace): Add ENTRY argument.  If true and
801         DEFAULT_INCOMING_FRAME_SP_OFFSET != INCOMING_FRAME_SP_OFFSET,
802         emit a note to adjust the CFA offset.
803         (create_cfi_notes): Adjust scan_trace callers.
804         (create_cie_data): Use DEFAULT_INCOMING_FRAME_SP_OFFSET rather than
805         INCOMING_FRAME_SP_OFFSET in the CIE.
806         * config/i386/i386.h (DEFAULT_INCOMING_FRAME_SP_OFFSET): Define.
807         * config/stormy16/stormy16.h (DEFAULT_INCOMING_FRAME_SP_OFFSET):
808         Likewise.
809         * doc/tm.texi.in (DEFAULT_INCOMING_FRAME_SP_OFFSET): Document.
810         * doc/tm.texi: Regenerated.
812 2018-01-19  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
814         PR rtl-optimization/83147
815         * lra-constraints.c (remove_inheritance_pseudos): Use
816         lra_substitute_pseudo_within_insn.
818 2018-01-19  Tom de Vries  <tom@codesourcery.com>
819             Cesar Philippidis  <cesar@codesourcery.com>
821         PR target/83920
822         * config/nvptx/nvptx.c (nvptx_single): Fix jit workaround.
824 2018-01-19  Cesar Philippidis  <cesar@codesourcery.com>
826         PR target/83790
827         * config/nvptx/nvptx.c (output_init_frag): Don't use generic address
828         spaces for function labels.
830 2018-01-19  Martin Liska  <mliska@suse.cz>
832         * predict.def (PRED_LOOP_EXIT): Change from 85 to 89.
833         (PRED_LOOP_EXIT_WITH_RECURSION): Change from 72 to 78.
834         (PRED_LOOP_EXTRA_EXIT): Change from 83 to 67.
835         (PRED_OPCODE_POSITIVE): Change from 64 to 59.
836         (PRED_TREE_OPCODE_POSITIVE): Change from 64 to 59.
837         (PRED_CONST_RETURN): Change from 69 to 65.
838         (PRED_NULL_RETURN): Change from 91 to 71.
839         (PRED_LOOP_IV_COMPARE_GUESS): Change from 98 to 64.
840         (PRED_LOOP_GUARD): Change from 66 to 73.
842 2018-01-19  Martin Liska  <mliska@suse.cz>
844         * predict.c (predict_insn_def): Add new assert.
845         (struct branch_predictor): Change type to signed integer.
846         (test_prediction_value_range): Amend test to cover
847         PROB_UNINITIALIZED.
848         * predict.def (PRED_LOOP_ITERATIONS): Use the new constant.
849         (PRED_LOOP_ITERATIONS_GUESSED): Likewise.
850         (PRED_LOOP_ITERATIONS_MAX): Likewise.
851         (PRED_LOOP_IV_COMPARE): Likewise.
852         * predict.h (PROB_UNINITIALIZED): Define new constant.
854 2018-01-19  Martin Liska  <mliska@suse.cz>
856         * predict.c (dump_prediction): Add new format for
857         analyze_brprob.py script which is enabled with -details
858         suboption.
859         * profile-count.h (precise_p): New function.
861 2018-01-19  Richard Sandiford  <richard.sandiford@linaro.org>
863         PR tree-optimization/83922
864         * tree-vect-loop.c (vect_verify_full_masking): Return false if
865         there are no statements that need masking.
866         (vect_active_double_reduction_p): New function.
867         (vect_analyze_loop_operations): Use it when handling phis that
868         are not in the loop header.
870 2018-01-19  Richard Sandiford  <richard.sandiford@linaro.org>
872         PR tree-optimization/83914
873         * tree-vect-loop.c (vectorizable_induction): Don't convert
874         init_expr or apply the peeling adjustment for inductions
875         that are nested within the vectorized loop.
877 2018-01-19  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
879         * config/arm/thumb2.md (*thumb2_negsi2_short): Use RSB mnemonic
880         instead of NEG.
882 2018-01-18  Jakub Jelinek  <jakub@redhat.com>
884         PR sanitizer/81715
885         PR testsuite/83882
886         * function.h (gimplify_parameters): Add gimple_seq * argument.
887         * function.c: Include gimple.h and options.h.
888         (gimplify_parameters): Add cleanup argument, add CLOBBER stmts
889         for the added local temporaries if needed.
890         * gimplify.c (gimplify_body): Adjust gimplify_parameters caller,
891         if there are any parameter cleanups, wrap whole body into a
892         try/finally with the cleanups.
894 2018-01-18  Wilco Dijkstra  <wdijkstr@arm.com>
896         PR target/82964
897         * config/aarch64/aarch64.c (aarch64_legitimate_constant_p):
898         Use GET_MODE_CLASS for scalar floating point.
900 2018-01-18  Jan Hubicka  <hubicka@ucw.cz>
902         PR ipa/82256
903         patch by PaX Team
904         * cgraphclones.c (cgraph_node::create_version_clone_with_body):
905         Fix call of call_cgraph_insertion_hooks.
907 2018-01-18  Martin Sebor  <msebor@redhat.com>
909         * doc/invoke.texi (-Wclass-memaccess): Tweak text.
911 2018-01-18  Jan Hubicka  <hubicka@ucw.cz>
913         PR ipa/83619
914         * cgraph.c (cgraph_edge::redirect_call_stmt_to_callee): Update edge
915         frequencies.
917 2018-01-18  Boris Kolpackov  <boris@codesynthesis.com>
919         PR other/70268
920         * common.opt: (-ffile-prefix-map): New option.
921         * opts.c (common_handle_option): Defer it.
922         * opts-global.c (handle_common_deferred_options): Handle it.
923         * debug.h (remap_debug_filename, add_debug_prefix_map): Move to...
924         * file-prefix-map.h: New file.
925         (remap_debug_filename, add_debug_prefix_map): ...here.
926         (add_macro_prefix_map, add_file_prefix_map, remap_macro_filename): New.
927         * final.c (debug_prefix_map, add_debug_prefix_map
928         remap_debug_filename): Move to...
929         * file-prefix-map.c: New file.
930         (file_prefix_map, add_prefix_map, remap_filename) ...here and rename,
931         generalize, get rid of alloca(), use strrchr() instead of strchr().
932         (add_macro_prefix_map, add_debug_prefix_map, add_file_prefix_map):
933         Implement in terms of add_prefix_map().
934         (remap_macro_filename, remap_debug_filename): Implement in term of
935         remap_filename().
936         * Makefile.in (OBJS, PLUGIN_HEADERS): Add new files.
937         * builtins.c (fold_builtin_FILE): Call remap_macro_filename().
938         * dbxout.c: Include file-prefix-map.h.
939         * varasm.c: Likewise.
940         * vmsdbgout.c: Likewise.
941         * xcoffout.c: Likewise.
942         * dwarf2out.c: Likewise plus omit new options from DW_AT_producer.
943         * doc/cppopts.texi (-fmacro-prefix-map): Document.
944         * doc/invoke.texi (-ffile-prefix-map): Document.
945         (-fdebug-prefix-map): Update description.
947 2018-01-18  Martin Liska  <mliska@suse.cz>
949         * config/i386/i386.c (indirect_thunk_name): Document that also
950         lfence is emitted.
951         (output_indirect_thunk): Document why both instructions
952         (pause and lfence) are generated.
954 2018-01-18  Richard Biener  <rguenther@suse.de>
956         PR tree-optimization/83887
957         * graphite-scop-detection.c
958         (scop_detection::get_nearest_dom_with_single_entry): Remove.
959         (scop_detection::get_nearest_pdom_with_single_exit): Likewise.
960         (scop_detection::merge_sese): Re-implement with a flood-fill
961         algorithm that properly finds a SESE region if it exists.
963 2018-01-18  Jakub Jelinek  <jakub@redhat.com>
965         PR c/61240
966         * match.pd ((P + A) - P, P - (P + A), (P + A) - (P + B)): For
967         pointer_diff optimizations use view_convert instead of convert.
969 2018-01-17  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
971         * config/rs6000/rs6000.md (*call_indirect_nonlocal_sysv<mode>):
972         Generate different code for -mno-speculate-indirect-jumps.
973         (*call_value_indirect_nonlocal_sysv<mode>): Likewise.
974         (*call_indirect_aix<mode>): Disable for
975         -mno-speculate-indirect-jumps.
976         (*call_indirect_aix<mode>_nospec): New define_insn.
977         (*call_value_indirect_aix<mode>): Disable for
978         -mno-speculate-indirect-jumps.
979         (*call_value_indirect_aix<mode>_nospec): New define_insn.
980         (*sibcall_nonlocal_sysv<mode>): Generate different code for
981         -mno-speculate-indirect-jumps.
982         (*sibcall_value_nonlocal_sysv<mode>): Likewise.
984 2018-01-17  Michael Meissner  <meissner@linux.vnet.ibm.com>
986         * config/rs6000/rs6000.c (rs6000_emit_move): If we load or store a
987         long double type, set the flags for noting the default long double
988         type, even if we don't pass or return a long double type.
990 2018-01-17  Jan Hubicka  <hubicka@ucw.cz>
992         PR ipa/83051
993         * ipa-inline.c (flatten_function): Do not overwrite final inlining
994         failure.
996 2018-01-17  Will Schmidt  <will_schmidt@vnet.ibm.com>
998         * config/rs6000/rs6000.c (rs6000_gimple_builtin): Add gimple folding
999         support for merge[hl].
1000         (fold_mergehl_helper): New helper function.
1001         (tree-vector-builder.h): New #include for tree_vector_builder usage.
1002         * config/rs6000/altivec.md (altivec_vmrghw_direct): Add xxmrghw insn.
1003         (altivec_vmrglw_direct): Add xxmrglw insn.
1005 2018-01-17  Andrew Waterman  <andrew@sifive.com>
1007         * config/riscv/riscv.c (riscv_conditional_register_usage): If
1008         UNITS_PER_FP_ARG is 0, set call_used_regs to 1 for all FP regs.
1010 2018-01-17  David Malcolm  <dmalcolm@redhat.com>
1012         PR lto/83121
1013         * ipa-devirt.c (add_type_duplicate): When comparing memory layout,
1014         call the lto_location_cache before reading the
1015         DECL_SOURCE_LOCATION of the types.
1017 2018-01-17  Wilco Dijkstra  <wdijkstr@arm.com>
1018             Richard Sandiford  <richard.sandiford@linaro.org>
1020         * config/aarch64/aarch64.md (movti_aarch64): Use Uti constraint.
1021         * config/aarch64/aarch64.c (aarch64_mov128_immediate): New function.
1022         (aarch64_legitimate_constant_p): Just support CONST_DOUBLE
1023         SF/DF/TF mode to avoid creating illegal CONST_WIDE_INT immediates.
1024         * config/aarch64/aarch64-protos.h (aarch64_mov128_immediate):
1025         Add declaration.
1026         * config/aarch64/constraints.md (aarch64_movti_operand):
1027         Limit immediates.
1028         * config/aarch64/predicates.md (Uti): Add new constraint.
1030 2018-01-17 Carl Love  <cel@us.ibm.com>
1031         * config/rs6000/vsx.md (define_expand xl_len_r,
1032         define_expand stxvl, define_expand *stxvl): Add match_dup argument.
1033         (define_insn): Add, match_dup 1 argument to define_insn stxvll and
1034         lxvll.
1035         (define_expand, define_insn): Move the shift left from  the
1036         define_insn to the define_expand for lxvl and stxvl instructions.
1037         * config/rs6000/rs6000-builtin.def (BU_P9V_64BIT_VSX_2): Change LXVL
1038         and XL_LEN_R definitions to PURE.
1040 2018-01-17  Uros Bizjak  <ubizjak@gmail.com>
1042         * config/i386/i386.c (indirect_thunk_name): Declare regno
1043         as unsigned int.  Compare regno with INVALID_REGNUM.
1044         (output_indirect_thunk): Ditto.
1045         (output_indirect_thunk_function): Ditto.
1046         (ix86_code_end): Declare regno as unsigned int.  Use INVALID_REGNUM
1047         in the call to output_indirect_thunk_function.
1049 2018-01-17  Richard Sandiford  <richard.sandiford@linaro.org>
1051         PR middle-end/83884
1052         * expr.c (expand_expr_real_1): Use the size of GET_MODE (op0)
1053         rather than the size of inner_type to determine the stack slot size
1054         when handling VIEW_CONVERT_EXPRs on strict-alignment targets.
1056 2018-01-16  Sebastian Peryt  <sebastian.peryt@intel.com>
1058         PR target/83546
1059         * config/i386/i386.c (ix86_option_override_internal): Add PTA_RDRND
1060         to PTA_SILVERMONT.
1062 2018-01-16  Michael Meissner  <meissner@linux.vnet.ibm.com>
1064         * config.gcc (powerpc*-linux*-*): Add support for 64-bit little
1065         endian Linux systems to optionally enable multilibs for selecting
1066         the long double type if the user configured an explicit type.
1067         * config/rs6000/rs6000.h (TARGET_IEEEQUAD_MULTILIB): Indicate we
1068         have no long double multilibs if not defined.
1069         * config/rs6000/rs6000.c (rs6000_option_override_internal): Do not
1070         warn if the user used -mabi={ieee,ibm}longdouble and we built
1071         multilibs for long double.
1072         * config/rs6000/linux64.h (MULTILIB_DEFAULTS_IEEE): Define as the
1073         appropriate multilib option.
1074         (MULTILIB_DEFAULTS): Add MULTILIB_DEFAULTS_IEEE to the default
1075         multilib options.
1076         * config/rs6000/t-ldouble-linux64le-ibm: New configuration files
1077         for building long double multilibs.
1078         * config/rs6000/t-ldouble-linux64le-ieee: Likewise.
1080 2018-01-16  John David Anglin  <danglin@gcc.gnu.org>
1082         * config.gcc (hppa*-*-linux*): Change callee copies ABI to caller
1083         copies.
1085         * config/pa.h (MALLOC_ABI_ALIGNMENT): Set 32-bit alignment default to
1086         64 bits.
1087         * config/pa/pa32-linux.h (MALLOC_ABI_ALIGNMENT): Set alignment to
1088         128 bits.
1090         * config/pa/som.h (ASM_DECLARE_FUNCTION_NAME): Cleanup type and mode
1091         variables.
1093         * config/pa/pa.c (pa_function_arg_size): Apply CEIL to GET_MODE_SIZE
1094         return value.
1096 2018-01-16  Eric Botcazou  <ebotcazou@adacore.com>
1098         * gimple-ssa-warn-restrict.c (builtin_memref::builtin_memref): For an
1099         ADDR_EXPR, do not count the offset of a COMPONENT_REF twice.
1101 2018-01-16  Kelvin Nilsen  <kelvin@gcc.gnu.org>
1103         * config/rs6000/rs6000-p8swap.c (rs6000_gen_stvx): Generate
1104         different rtl trees depending on TARGET_64BIT.
1105         (rs6000_gen_lvx): Likewise.
1107 2018-01-16  Eric Botcazou  <ebotcazou@adacore.com>
1109         * config/visium/visium.md (nop): Tweak comment.
1110         (hazard_nop): Likewise.
1112 2018-01-16  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
1114         * config/rs6000/rs6000.c (rs6000_opt_vars): Add entry for
1115         -mspeculate-indirect-jumps.
1116         * config/rs6000/rs6000.md (*call_indirect_elfv2<mode>): Disable
1117         for -mno-speculate-indirect-jumps.
1118         (*call_indirect_elfv2<mode>_nospec): New define_insn.
1119         (*call_value_indirect_elfv2<mode>): Disable for
1120         -mno-speculate-indirect-jumps.
1121         (*call_value_indirect_elfv2<mode>_nospec): New define_insn.
1122         (indirect_jump): Emit different RTL for
1123         -mno-speculate-indirect-jumps.
1124         (*indirect_jump<mode>): Disable for
1125         -mno-speculate-indirect-jumps.
1126         (*indirect_jump<mode>_nospec): New define_insn.
1127         (tablejump): Emit different RTL for
1128         -mno-speculate-indirect-jumps.
1129         (tablejumpsi): Disable for -mno-speculate-indirect-jumps.
1130         (tablejumpsi_nospec): New define_expand.
1131         (tablejumpdi): Disable for -mno-speculate-indirect-jumps.
1132         (tablejumpdi_nospec): New define_expand.
1133         (*tablejump<mode>_internal1): Disable for
1134         -mno-speculate-indirect-jumps.
1135         (*tablejump<mode>_internal1_nospec): New define_insn.
1136         * config/rs6000/rs6000.opt (mspeculate-indirect-jumps): New
1137         option.
1139 2018-01-16  Artyom Skrobov tyomitch@gmail.com
1141         * caller-save.c (insert_save): Drop unnecessary parameter.  All
1142         callers updated.
1144 2018-01-16  Jakub Jelinek  <jakub@redhat.com>
1145             Richard Biener  <rguenth@suse.de>
1147         PR libgomp/83590
1148         * gimplify.c (gimplify_one_sizepos): For is_gimple_constant (expr)
1149         return early, inline manually is_gimple_sizepos.  Make sure if we
1150         call gimplify_expr we don't end up with a gimple constant.
1151         * tree.c (variably_modified_type_p): Don't return true for
1152         is_gimple_constant (_t).  Inline manually is_gimple_sizepos.
1153         * gimplify.h (is_gimple_sizepos): Remove.
1155 2018-01-16  Richard Sandiford  <richard.sandiford@linaro.org>
1157         PR tree-optimization/83857
1158         * tree-vect-loop.c (vect_analyze_loop_operations): Don't call
1159         vectorizable_live_operation for pure SLP statements.
1160         (vectorizable_live_operation): Handle PHIs.
1162 2018-01-16  Richard Biener  <rguenther@suse.de>
1164         PR tree-optimization/83867
1165         * tree-vect-stmts.c (vect_transform_stmt): Precompute
1166         nested_in_vect_loop_p since the scalar stmt may get invalidated.
1168 2018-01-16  Jakub Jelinek  <jakub@redhat.com>
1170         PR c/83844
1171         * stor-layout.c (handle_warn_if_not_align): Use byte_position and
1172         multiple_of_p instead of unchecked tree_to_uhwi and UHWI check.
1173         If off is not INTEGER_CST, issue a may not be aligned warning
1174         rather than isn't aligned.  Use isn%'t rather than isn't.
1175         * fold-const.c (multiple_of_p) <case BIT_AND_EXPR>: Don't fall through
1176         into MULT_EXPR.
1177         <case MULT_EXPR>: Improve the case when bottom and one of the
1178         MULT_EXPR operands are INTEGER_CSTs and bottom is multiple of that
1179         operand, in that case check if the other operand is multiple of
1180         bottom divided by the INTEGER_CST operand.
1182 2018-01-16  Richard Sandiford  <richard.sandiford@linaro.org>
1184         PR target/83858
1185         * config/pa/pa.h (FUNCTION_ARG_SIZE): Delete.
1186         * config/pa/pa-protos.h (pa_function_arg_size): Declare.
1187         * config/pa/som.h (ASM_DECLARE_FUNCTION_NAME): Use
1188         pa_function_arg_size instead of FUNCTION_ARG_SIZE.
1189         * config/pa/pa.c (pa_function_arg_advance): Likewise.
1190         (pa_function_arg, pa_arg_partial_bytes): Likewise.
1191         (pa_function_arg_size): New function.
1193 2018-01-16  Richard Sandiford  <richard.sandiford@linaro.org>
1195         * fold-const.c (fold_ternary_loc): Construct the vec_perm_indices
1196         in a separate statement.
1198 2018-01-16  Richard Sandiford  <richard.sandiford@linaro.org>
1200         PR tree-optimization/83847
1201         * tree-vect-data-refs.c (vect_analyze_data_ref_accesses): Don't
1202         group gathers and scatters.
1204 2018-01-16  Jakub Jelinek  <jakub@redhat.com>
1206         PR rtl-optimization/86620
1207         * params.def (max-sched-ready-insns): Bump minimum value to 1.
1209         PR rtl-optimization/83213
1210         * recog.c (peep2_attempt): Copy over CROSSING_JUMP_P from peepinsn
1211         to last if both are JUMP_INSNs.
1213         PR tree-optimization/83843
1214         * gimple-ssa-store-merging.c
1215         (imm_store_chain_info::output_merged_store): Handle bit_not_p on
1216         store_immediate_info for bswap/nop orig_stores.
1218 2018-01-15  Andrew Waterman  <andrew@sifive.com>
1220         * config/riscv/riscv.c (riscv_rtx_costs) <MULT>: Increase cost if
1221         !TARGET_MUL.
1222         <UDIV>: Increase cost if !TARGET_DIV.
1224 2018-01-15  Segher Boessenkool  <segher@kernel.crashing.org>
1226         * config/rs6000/rs6000.md (define_attr "type"): Remove delayed_cr.
1227         (define_attr "cr_logical_3op"): New.
1228         (cceq_ior_compare): Adjust.
1229         (cceq_ior_compare_complement): Adjust.
1230         (*cceq_rev_compare): Adjust.
1231         * config/rs6000/rs6000.c (rs6000_adjust_cost): Adjust.
1232         (is_cracked_insn): Adjust.
1233         (insn_must_be_first_in_group): Adjust.
1234         * config/rs6000/40x.md: Adjust.
1235         * config/rs6000/440.md: Adjust.
1236         * config/rs6000/476.md: Adjust.
1237         * config/rs6000/601.md: Adjust.
1238         * config/rs6000/603.md: Adjust.
1239         * config/rs6000/6xx.md: Adjust.
1240         * config/rs6000/7450.md: Adjust.
1241         * config/rs6000/7xx.md: Adjust.
1242         * config/rs6000/8540.md: Adjust.
1243         * config/rs6000/cell.md: Adjust.
1244         * config/rs6000/e300c2c3.md: Adjust.
1245         * config/rs6000/e500mc.md: Adjust.
1246         * config/rs6000/e500mc64.md: Adjust.
1247         * config/rs6000/e5500.md: Adjust.
1248         * config/rs6000/e6500.md: Adjust.
1249         * config/rs6000/mpc.md: Adjust.
1250         * config/rs6000/power4.md: Adjust.
1251         * config/rs6000/power5.md: Adjust.
1252         * config/rs6000/power6.md: Adjust.
1253         * config/rs6000/power7.md: Adjust.
1254         * config/rs6000/power8.md: Adjust.
1255         * config/rs6000/power9.md: Adjust.
1256         * config/rs6000/rs64.md: Adjust.
1257         * config/rs6000/titan.md: Adjust.
1259 2018-01-15  H.J. Lu  <hongjiu.lu@intel.com>
1261         * config/i386/predicates.md (indirect_branch_operand): Rewrite
1262         ix86_indirect_branch_register logic.
1264 2018-01-15  H.J. Lu  <hongjiu.lu@intel.com>
1266         * config/i386/constraints.md (Bs): Update
1267         ix86_indirect_branch_register check.  Don't check
1268         ix86_indirect_branch_register with GOT_memory_operand.
1269         (Bw): Likewise.
1270         * config/i386/predicates.md (GOT_memory_operand): Don't check
1271         ix86_indirect_branch_register here.
1272         (GOT32_symbol_operand): Likewise.
1274 2018-01-15  H.J. Lu  <hongjiu.lu@intel.com>
1276         * config/i386/predicates.md (constant_call_address_operand):
1277         Rewrite ix86_indirect_branch_register logic.
1278         (sibcall_insn_operand): Likewise.
1280 2018-01-15  H.J. Lu  <hongjiu.lu@intel.com>
1282         * config/i386/constraints.md (Bs): Replace
1283         ix86_indirect_branch_thunk_register with
1284         ix86_indirect_branch_register.
1285         (Bw): Likewise.
1286         * config/i386/i386.md (indirect_jump): Likewise.
1287         (tablejump): Likewise.
1288         (*sibcall_memory): Likewise.
1289         (*sibcall_value_memory): Likewise.
1290         Peepholes of indirect call and jump via memory: Likewise.
1291         * config/i386/i386.opt: Likewise.
1292         * config/i386/predicates.md (indirect_branch_operand): Likewise.
1293         (GOT_memory_operand): Likewise.
1294         (call_insn_operand): Likewise.
1295         (sibcall_insn_operand): Likewise.
1296         (GOT32_symbol_operand): Likewise.
1298 2018-01-15  Jakub Jelinek  <jakub@redhat.com>
1300         PR middle-end/83837
1301         * omp-expand.c (expand_omp_atomic_pipeline): Use loaded_val
1302         type rather than type addr's type points to.
1303         (expand_omp_atomic_mutex): Likewise.
1304         (expand_omp_atomic): Likewise.
1306 2018-01-15  H.J. Lu  <hongjiu.lu@intel.com>
1308         PR target/83839
1309         * config/i386/i386.c (output_indirect_thunk_function): Use
1310         ASM_OUTPUT_LABEL, instead of ASM_OUTPUT_DEF, for TARGET_MACHO
1311         for  __x86_return_thunk.
1313 2018-01-15  Richard Biener  <rguenther@suse.de>
1315         PR middle-end/83850
1316         * expmed.c (extract_bit_field_1): Fix typo.
1318 2018-01-15  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
1320         PR target/83687
1321         * config/arm/iterators.md (VF): New mode iterator.
1322         * config/arm/neon.md (neon_vabd<mode>_2): Use the above.
1323         Remove integer-related logic from pattern.
1324         (neon_vabd<mode>_3): Likewise.
1326 2018-01-15  Jakub Jelinek  <jakub@redhat.com>
1328         PR middle-end/82694
1329         * common.opt (fstrict-overflow): No longer an alias.
1330         (fwrapv-pointer): New option.
1331         * tree.h (TYPE_OVERFLOW_WRAPS, TYPE_OVERFLOW_UNDEFINED): Define
1332         also for pointer types based on flag_wrapv_pointer.
1333         * opts.c (common_handle_option) <case OPT_fstrict_overflow>: Set
1334         opts->x_flag_wrap[pv] to !value, clear opts->x_flag_trapv if
1335         opts->x_flag_wrapv got set.
1336         * fold-const.c (fold_comparison, fold_binary_loc): Revert 2017-08-01
1337         changes, just use TYPE_OVERFLOW_UNDEFINED on pointer type instead of
1338         POINTER_TYPE_OVERFLOW_UNDEFINED.
1339         * match.pd: Likewise in address comparison pattern.
1340         * doc/invoke.texi: Document -fwrapv and -fstrict-overflow.
1342 2018-01-15  Richard Biener  <rguenther@suse.de>
1344         PR lto/83804
1345         * tree.c (free_lang_data_in_type): Always unlink TYPE_DECLs
1346         from TYPE_FIELDS.  Free TYPE_BINFO if not used by devirtualization.
1347         Reset type names to their identifier if their TYPE_DECL doesn't
1348         have linkage (and thus is used for ODR and devirt).
1349         (save_debug_info_for_decl): Remove.
1350         (save_debug_info_for_type): Likewise.
1351         (add_tree_to_fld_list): Adjust.
1352         * tree-pretty-print.c (dump_generic_node): Make dumping of
1353         type names more robust.
1355 2018-01-15  Richard Biener  <rguenther@suse.de>
1357         * BASE-VER: Bump to 8.0.1.
1359 2018-01-14  Martin Sebor  <msebor@redhat.com>
1361         PR other/83508
1362         * builtins.c (check_access): Avoid warning when the no-warning bit
1363         is set.
1365 2018-01-14  Cory Fields  <cory-nospam-@coryfields.com>
1367         * tree-ssa-loop-im.c (sort_bbs_in_loop_postorder_cmp): Stabilize sort.
1368         * ira-color (allocno_hard_regs_compare): Likewise.
1370 2018-01-14  Nathan Rossi  <nathan@nathanrossi.com>
1372         PR target/83013
1373         * config/microblaze/microblaze.c (microblaze_asm_output_ident):
1374         Use .pushsection/.popsection.
1376 2018-01-14  Martin Sebor  <msebor@redhat.com>
1378         PR c++/81327
1379         * doc/invoke.texi (-Wlass-memaccess): Document suppression by casting.
1381 2018-01-14  Jakub Jelinek  <jakub@redhat.com>
1383         * config.gcc (i[34567]86-*-*): Remove one duplicate gfniintrin.h
1384         entry from extra_headers.
1385         (x86_64-*-*): Remove two duplicate gfniintrin.h entries from
1386         extra_headers, make the list bitwise identical to the i?86-*-* one.
1388 2018-01-14  H.J. Lu  <hongjiu.lu@intel.com>
1390         * config/i386/i386.c (ix86_set_indirect_branch_type): Disallow
1391         -mcmodel=large with -mindirect-branch=thunk,
1392         -mindirect-branch=thunk-extern, -mfunction-return=thunk and
1393         -mfunction-return=thunk-extern.
1394         * doc/invoke.texi: Document -mcmodel=large is incompatible with
1395         -mindirect-branch=thunk, -mindirect-branch=thunk-extern,
1396         -mfunction-return=thunk and -mfunction-return=thunk-extern.
1398 2018-01-14  H.J. Lu  <hongjiu.lu@intel.com>
1400         * config/i386/i386.c (print_reg): Print the name of the full
1401         integer register without '%'.
1402         (ix86_print_operand): Handle 'V'.
1403          * doc/extend.texi: Document 'V' modifier.
1405 2018-01-14  H.J. Lu  <hongjiu.lu@intel.com>
1407         * config/i386/constraints.md (Bs): Disallow memory operand for
1408         -mindirect-branch-register.
1409         (Bw): Likewise.
1410         * config/i386/predicates.md (indirect_branch_operand): Likewise.
1411         (GOT_memory_operand): Likewise.
1412         (call_insn_operand): Likewise.
1413         (sibcall_insn_operand): Likewise.
1414         (GOT32_symbol_operand): Likewise.
1415         * config/i386/i386.md (indirect_jump): Call convert_memory_address
1416         for -mindirect-branch-register.
1417         (tablejump): Likewise.
1418         (*sibcall_memory): Likewise.
1419         (*sibcall_value_memory): Likewise.
1420         Disallow peepholes of indirect call and jump via memory for
1421         -mindirect-branch-register.
1422         (*call_pop): Replace m with Bw.
1423         (*call_value_pop): Likewise.
1424         (*sibcall_pop_memory): Replace m with Bs.
1425         * config/i386/i386.opt (mindirect-branch-register): New option.
1426         * doc/invoke.texi: Document -mindirect-branch-register option.
1428 2018-01-14  H.J. Lu  <hongjiu.lu@intel.com>
1430         * config/i386/i386-protos.h (ix86_output_function_return): New.
1431         * config/i386/i386.c (ix86_set_indirect_branch_type): Also
1432         set function_return_type.
1433         (indirect_thunk_name): Add ret_p to indicate thunk for function
1434         return.
1435         (output_indirect_thunk_function): Pass false to
1436         indirect_thunk_name.
1437         (ix86_output_indirect_branch_via_reg): Likewise.
1438         (ix86_output_indirect_branch_via_push): Likewise.
1439         (output_indirect_thunk_function): Create alias for function
1440         return thunk if regno < 0.
1441         (ix86_output_function_return): New function.
1442         (ix86_handle_fndecl_attribute): Handle function_return.
1443         (ix86_attribute_table): Add function_return.
1444         * config/i386/i386.h (machine_function): Add
1445         function_return_type.
1446         * config/i386/i386.md (simple_return_internal): Use
1447         ix86_output_function_return.
1448         (simple_return_internal_long): Likewise.
1449         * config/i386/i386.opt (mfunction-return=): New option.
1450         (indirect_branch): Mention -mfunction-return=.
1451         * doc/extend.texi: Document function_return function attribute.
1452         * doc/invoke.texi: Document -mfunction-return= option.
1454 2018-01-14  H.J. Lu  <hongjiu.lu@intel.com>
1456         * config/i386/i386-opts.h (indirect_branch): New.
1457         * config/i386/i386-protos.h (ix86_output_indirect_jmp): Likewise.
1458         * config/i386/i386.c (ix86_using_red_zone): Disallow red-zone
1459         with local indirect jump when converting indirect call and jump.
1460         (ix86_set_indirect_branch_type): New.
1461         (ix86_set_current_function): Call ix86_set_indirect_branch_type.
1462         (indirectlabelno): New.
1463         (indirect_thunk_needed): Likewise.
1464         (indirect_thunk_bnd_needed): Likewise.
1465         (indirect_thunks_used): Likewise.
1466         (indirect_thunks_bnd_used): Likewise.
1467         (INDIRECT_LABEL): Likewise.
1468         (indirect_thunk_name): Likewise.
1469         (output_indirect_thunk): Likewise.
1470         (output_indirect_thunk_function): Likewise.
1471         (ix86_output_indirect_branch_via_reg): Likewise.
1472         (ix86_output_indirect_branch_via_push): Likewise.
1473         (ix86_output_indirect_branch): Likewise.
1474         (ix86_output_indirect_jmp): Likewise.
1475         (ix86_code_end): Call output_indirect_thunk_function if needed.
1476         (ix86_output_call_insn): Call ix86_output_indirect_branch if
1477         needed.
1478         (ix86_handle_fndecl_attribute): Handle indirect_branch.
1479         (ix86_attribute_table): Add indirect_branch.
1480         * config/i386/i386.h (machine_function): Add indirect_branch_type
1481         and has_local_indirect_jump.
1482         * config/i386/i386.md (indirect_jump): Set has_local_indirect_jump
1483         to true.
1484         (tablejump): Likewise.
1485         (*indirect_jump): Use ix86_output_indirect_jmp.
1486         (*tablejump_1): Likewise.
1487         (simple_return_indirect_internal): Likewise.
1488         * config/i386/i386.opt (mindirect-branch=): New option.
1489         (indirect_branch): New.
1490         (keep): Likewise.
1491         (thunk): Likewise.
1492         (thunk-inline): Likewise.
1493         (thunk-extern): Likewise.
1494         * doc/extend.texi: Document indirect_branch function attribute.
1495         * doc/invoke.texi: Document -mindirect-branch= option.
1497 2018-01-14  Jan Hubicka  <hubicka@ucw.cz>
1499         PR ipa/83051
1500         * ipa-inline.c (edge_badness): Tolerate roundoff errors.
1502 2018-01-14  Richard Sandiford  <richard.sandiford@linaro.org>
1504         * ipa-inline.c (want_inline_small_function_p): Return false if
1505         inlining has already failed with CIF_FINAL_ERROR.
1506         (update_caller_keys): Call want_inline_small_function_p before
1507         can_inline_edge_p.
1508         (update_callee_keys): Likewise.
1510 2018-01-10  Kelvin Nilsen  <kelvin@gcc.gnu.org>
1512         * config/rs6000/rs6000-p8swap.c (rs6000_sum_of_two_registers_p):
1513         New function.
1514         (rs6000_quadword_masked_address_p): Likewise.
1515         (quad_aligned_load_p): Likewise.
1516         (quad_aligned_store_p): Likewise.
1517         (const_load_sequence_p): Add comment to describe the outer-most loop.
1518         (mimic_memory_attributes_and_flags): New function.
1519         (rs6000_gen_stvx): Likewise.
1520         (replace_swapped_aligned_store): Likewise.
1521         (rs6000_gen_lvx): Likewise.
1522         (replace_swapped_aligned_load): Likewise.
1523         (replace_swapped_load_constant): Capitalize argument name in
1524         comment describing this function.
1525         (rs6000_analyze_swaps): Add a third pass to search for vector loads
1526         and stores that access quad-word aligned addresses and replace
1527         with stvx or lvx instructions when appropriate.
1528         * config/rs6000/rs6000-protos.h (rs6000_sum_of_two_registers_p):
1529         New function prototype.
1530         (rs6000_quadword_masked_address_p): Likewise.
1531         (rs6000_gen_lvx): Likewise.
1532         (rs6000_gen_stvx): Likewise.
1533         * config/rs6000/vsx.md (*vsx_le_perm_load_<mode>): For modes
1534         VSX_D (V2DF, V2DI), modify this split to select lvx instruction
1535         when memory address is aligned.
1536         (*vsx_le_perm_load_<mode>): For modes VSX_W (V4SF, V4SI), modify
1537         this split to select lvx instruction when memory address is aligned.
1538         (*vsx_le_perm_load_v8hi): Modify this split to select lvx
1539         instruction when memory address is aligned.
1540         (*vsx_le_perm_load_v16qi): Likewise.
1541         (four unnamed splitters): Modify to select the stvx instruction
1542         when memory is aligned.
1544 2018-01-13  Jan Hubicka  <hubicka@ucw.cz>
1546         * predict.c (determine_unlikely_bbs): Handle correctly BBs
1547         which appears in the queue multiple times.
1549 2018-01-13  Richard Sandiford  <richard.sandiford@linaro.org>
1550             Alan Hayward  <alan.hayward@arm.com>
1551             David Sherwood  <david.sherwood@arm.com>
1553         * tree-vectorizer.h (vec_lower_bound): New structure.
1554         (_loop_vec_info): Add check_nonzero and lower_bounds.
1555         (LOOP_VINFO_CHECK_NONZERO): New macro.
1556         (LOOP_VINFO_LOWER_BOUNDS): Likewise.
1557         (LOOP_REQUIRES_VERSIONING_FOR_ALIAS): Check lower_bounds too.
1558         * tree-data-ref.h (dr_with_seg_len): Add access_size and align
1559         fields.  Make seg_len the distance travelled, not including the
1560         access size.
1561         (dr_direction_indicator): Declare.
1562         (dr_zero_step_indicator): Likewise.
1563         (dr_known_forward_stride_p): Likewise.
1564         * tree-data-ref.c: Include stringpool.h, tree-vrp.h and
1565         tree-ssanames.h.
1566         (runtime_alias_check_p): Allow runtime alias checks with
1567         variable strides.
1568         (operator ==): Compare access_size and align.
1569         (prune_runtime_alias_test_list): Rework for new distinction between
1570         the access_size and seg_len.
1571         (create_intersect_range_checks_index): Likewise.  Cope with polynomial
1572         segment lengths.
1573         (get_segment_min_max): New function.
1574         (create_intersect_range_checks): Use it.
1575         (dr_step_indicator): New function.
1576         (dr_direction_indicator): Likewise.
1577         (dr_zero_step_indicator): Likewise.
1578         (dr_known_forward_stride_p): Likewise.
1579         * tree-loop-distribution.c (data_ref_segment_size): Return
1580         DR_STEP * (niters - 1).
1581         (compute_alias_check_pairs): Update call to the dr_with_seg_len
1582         constructor.
1583         * tree-vect-data-refs.c (vect_check_nonzero_value): New function.
1584         (vect_preserves_scalar_order_p): New function, split out from...
1585         (vect_analyze_data_ref_dependence): ...here.  Check for zero steps.
1586         (vect_vfa_segment_size): Return DR_STEP * (length_factor - 1).
1587         (vect_vfa_access_size): New function.
1588         (vect_vfa_align): Likewise.
1589         (vect_compile_time_alias): Take access_size_a and access_b arguments.
1590         (dump_lower_bound): New function.
1591         (vect_check_lower_bound): Likewise.
1592         (vect_small_gap_p): Likewise.
1593         (vectorizable_with_step_bound_p): Likewise.
1594         (vect_prune_runtime_alias_test_list): Ignore cross-iteration
1595         depencies if the vectorization factor is 1.  Convert the checks
1596         for nonzero steps into checks on the bounds of DR_STEP.  Try using
1597         a bunds check for variable steps if the minimum required step is
1598         relatively small. Update calls to the dr_with_seg_len
1599         constructor and to vect_compile_time_alias.
1600         * tree-vect-loop-manip.c (vect_create_cond_for_lower_bounds): New
1601         function.
1602         (vect_loop_versioning): Call it.
1603         * tree-vect-loop.c (vect_analyze_loop_2): Clear LOOP_VINFO_LOWER_BOUNDS
1604         when retrying.
1605         (vect_estimate_min_profitable_iters): Account for any bounds checks.
1607 2018-01-13  Richard Sandiford  <richard.sandiford@linaro.org>
1608             Alan Hayward  <alan.hayward@arm.com>
1609             David Sherwood  <david.sherwood@arm.com>
1611         * doc/sourcebuild.texi (vect_scatter_store): Document.
1612         * optabs.def (scatter_store_optab, mask_scatter_store_optab): New
1613         optabs.
1614         * doc/md.texi (scatter_store@var{m}, mask_scatter_store@var{m}):
1615         Document.
1616         * genopinit.c (main): Add supports_vec_scatter_store and
1617         supports_vec_scatter_store_cached to target_optabs.
1618         * gimple.h (gimple_expr_type): Handle IFN_SCATTER_STORE and
1619         IFN_MASK_SCATTER_STORE.
1620         * internal-fn.def (SCATTER_STORE, MASK_SCATTER_STORE): New internal
1621         functions.
1622         * internal-fn.h (internal_store_fn_p): Declare.
1623         (internal_fn_stored_value_index): Likewise.
1624         * internal-fn.c (scatter_store_direct): New macro.
1625         (expand_scatter_store_optab_fn): New function.
1626         (direct_scatter_store_optab_supported_p): New macro.
1627         (internal_store_fn_p): New function.
1628         (internal_gather_scatter_fn_p): Handle IFN_SCATTER_STORE and
1629         IFN_MASK_SCATTER_STORE.
1630         (internal_fn_mask_index): Likewise.
1631         (internal_fn_stored_value_index): New function.
1632         (internal_gather_scatter_fn_supported_p): Adjust operand numbers
1633         for scatter stores.
1634         * optabs-query.h (supports_vec_scatter_store_p): Declare.
1635         * optabs-query.c (supports_vec_scatter_store_p): New function.
1636         * tree-vectorizer.h (vect_get_store_rhs): Declare.
1637         * tree-vect-data-refs.c (vect_analyze_data_ref_access): Return
1638         true for scatter stores.
1639         (vect_gather_scatter_fn_p): Handle scatter stores too.
1640         (vect_check_gather_scatter): Consider using scatter stores if
1641         supports_vec_scatter_store_p.
1642         * tree-vect-patterns.c (vect_try_gather_scatter_pattern): Handle
1643         scatter stores too.
1644         * tree-vect-stmts.c (exist_non_indexing_operands_for_use_p): Use
1645         internal_fn_stored_value_index.
1646         (check_load_store_masking): Handle scatter stores too.
1647         (vect_get_store_rhs): Make public.
1648         (vectorizable_call): Use internal_store_fn_p.
1649         (vectorizable_store): Handle scatter store internal functions.
1650         (vect_transform_stmt): Compare GROUP_STORE_COUNT with GROUP_SIZE
1651         when deciding whether the end of the group has been reached.
1652         * config/aarch64/aarch64.md (UNSPEC_ST1_SCATTER): New unspec.
1653         * config/aarch64/aarch64-sve.md (scatter_store<mode>): New expander.
1654         (mask_scatter_store<mode>): New insns.
1656 2018-01-13  Richard Sandiford  <richard.sandiford@linaro.org>
1657             Alan Hayward  <alan.hayward@arm.com>
1658             David Sherwood  <david.sherwood@arm.com>
1660         * tree-vectorizer.h (vect_gather_scatter_fn_p): Declare.
1661         * tree-vect-data-refs.c (vect_gather_scatter_fn_p): Make public.
1662         * tree-vect-stmts.c (vect_truncate_gather_scatter_offset): New
1663         function.
1664         (vect_use_strided_gather_scatters_p): Take a masked_p argument.
1665         Use vect_truncate_gather_scatter_offset if we can't treat the
1666         operation as a normal gather load or scatter store.
1667         (get_group_load_store_type): Take the gather_scatter_info
1668         as argument.  Try using a gather load or scatter store for
1669         single-element groups.
1670         (get_load_store_type): Update calls to get_group_load_store_type
1671         and vect_use_strided_gather_scatters_p.
1673 2018-01-13  Richard Sandiford  <richard.sandiford@linaro.org>
1674             Alan Hayward  <alan.hayward@arm.com>
1675             David Sherwood  <david.sherwood@arm.com>
1677         * tree-vectorizer.h (vect_create_data_ref_ptr): Take an extra
1678         optional tree argument.
1679         * tree-vect-data-refs.c (vect_check_gather_scatter): Check for
1680         null target hooks.
1681         (vect_create_data_ref_ptr): Take the iv_step as an optional argument,
1682         but continue to use the current value as a fallback.
1683         (bump_vector_ptr): Use operand_equal_p rather than tree_int_cst_compare
1684         to compare the updates.
1685         * tree-vect-stmts.c (vect_use_strided_gather_scatters_p): New function.
1686         (get_load_store_type): Use it when handling a strided access.
1687         (vect_get_strided_load_store_ops): New function.
1688         (vect_get_data_ptr_increment): Likewise.
1689         (vectorizable_load): Handle strided gather loads.  Always pass
1690         a step to vect_create_data_ref_ptr and bump_vector_ptr.
1692 2018-01-13  Richard Sandiford  <richard.sandiford@linaro.org>
1693             Alan Hayward  <alan.hayward@arm.com>
1694             David Sherwood  <david.sherwood@arm.com>
1696         * doc/md.texi (gather_load@var{m}): Document.
1697         (mask_gather_load@var{m}): Likewise.
1698         * genopinit.c (main): Add supports_vec_gather_load and
1699         supports_vec_gather_load_cached to target_optabs.
1700         * optabs-tree.c (init_tree_optimization_optabs): Use
1701         ggc_cleared_alloc to allocate target_optabs.
1702         * optabs.def (gather_load_optab, mask_gather_laod_optab): New optabs.
1703         * internal-fn.def (GATHER_LOAD, MASK_GATHER_LOAD): New internal
1704         functions.
1705         * internal-fn.h (internal_load_fn_p): Declare.
1706         (internal_gather_scatter_fn_p): Likewise.
1707         (internal_fn_mask_index): Likewise.
1708         (internal_gather_scatter_fn_supported_p): Likewise.
1709         * internal-fn.c (gather_load_direct): New macro.
1710         (expand_gather_load_optab_fn): New function.
1711         (direct_gather_load_optab_supported_p): New macro.
1712         (direct_internal_fn_optab): New function.
1713         (internal_load_fn_p): Likewise.
1714         (internal_gather_scatter_fn_p): Likewise.
1715         (internal_fn_mask_index): Likewise.
1716         (internal_gather_scatter_fn_supported_p): Likewise.
1717         * optabs-query.c (supports_at_least_one_mode_p): New function.
1718         (supports_vec_gather_load_p): Likewise.
1719         * optabs-query.h (supports_vec_gather_load_p): Declare.
1720         * tree-vectorizer.h (gather_scatter_info): Add ifn, element_type
1721         and memory_type field.
1722         (NUM_PATTERNS): Bump to 15.
1723         * tree-vect-data-refs.c: Include internal-fn.h.
1724         (vect_gather_scatter_fn_p): New function.
1725         (vect_describe_gather_scatter_call): Likewise.
1726         (vect_check_gather_scatter): Try using internal functions for
1727         gather loads.  Recognize existing calls to a gather load function.
1728         (vect_analyze_data_refs): Consider using gather loads if
1729         supports_vec_gather_load_p.
1730         * tree-vect-patterns.c (vect_get_load_store_mask): New function.
1731         (vect_get_gather_scatter_offset_type): Likewise.
1732         (vect_convert_mask_for_vectype): Likewise.
1733         (vect_add_conversion_to_patterm): Likewise.
1734         (vect_try_gather_scatter_pattern): Likewise.
1735         (vect_recog_gather_scatter_pattern): New pattern recognizer.
1736         (vect_vect_recog_func_ptrs): Add it.
1737         * tree-vect-stmts.c (exist_non_indexing_operands_for_use_p): Use
1738         internal_fn_mask_index and internal_gather_scatter_fn_p.
1739         (check_load_store_masking): Take the gather_scatter_info as an
1740         argument and handle gather loads.
1741         (vect_get_gather_scatter_ops): New function.
1742         (vectorizable_call): Check internal_load_fn_p.
1743         (vectorizable_load): Likewise.  Handle gather load internal
1744         functions.
1745         (vectorizable_store): Update call to check_load_store_masking.
1746         * config/aarch64/aarch64.md (UNSPEC_LD1_GATHER): New unspec.
1747         * config/aarch64/iterators.md (SVE_S, SVE_D): New mode iterators.
1748         * config/aarch64/predicates.md (aarch64_gather_scale_operand_w)
1749         (aarch64_gather_scale_operand_d): New predicates.
1750         * config/aarch64/aarch64-sve.md (gather_load<mode>): New expander.
1751         (mask_gather_load<mode>): New insns.
1753 2018-01-13  Richard Sandiford  <richard.sandiford@linaro.org>
1754             Alan Hayward  <alan.hayward@arm.com>
1755             David Sherwood  <david.sherwood@arm.com>
1757         * optabs.def (fold_left_plus_optab): New optab.
1758         * doc/md.texi (fold_left_plus_@var{m}): Document.
1759         * internal-fn.def (IFN_FOLD_LEFT_PLUS): New internal function.
1760         * internal-fn.c (fold_left_direct): Define.
1761         (expand_fold_left_optab_fn): Likewise.
1762         (direct_fold_left_optab_supported_p): Likewise.
1763         * fold-const-call.c (fold_const_fold_left): New function.
1764         (fold_const_call): Use it to fold CFN_FOLD_LEFT_PLUS.
1765         * tree-parloops.c (valid_reduction_p): New function.
1766         (gather_scalar_reductions): Use it.
1767         * tree-vectorizer.h (FOLD_LEFT_REDUCTION): New vect_reduction_type.
1768         (vect_finish_replace_stmt): Declare.
1769         * tree-vect-loop.c (fold_left_reduction_fn): New function.
1770         (needs_fold_left_reduction_p): New function, split out from...
1771         (vect_is_simple_reduction): ...here.  Accept reductions that
1772         forbid reassociation, but give them type FOLD_LEFT_REDUCTION.
1773         (vect_force_simple_reduction): Also store the reduction type in
1774         the assignment's STMT_VINFO_REDUC_TYPE.
1775         (vect_model_reduction_cost): Handle FOLD_LEFT_REDUCTION.
1776         (merge_with_identity): New function.
1777         (vect_expand_fold_left): Likewise.
1778         (vectorize_fold_left_reduction): Likewise.
1779         (vectorizable_reduction): Handle FOLD_LEFT_REDUCTION.  Leave the
1780         scalar phi in place for it.  Check for target support and reject
1781         cases that would reassociate the operation.  Defer the transform
1782         phase to vectorize_fold_left_reduction.
1783         * config/aarch64/aarch64.md (UNSPEC_FADDA): New unspec.
1784         * config/aarch64/aarch64-sve.md (fold_left_plus_<mode>): New expander.
1785         (*fold_left_plus_<mode>, *pred_fold_left_plus_<mode>): New insns.
1787 2018-01-13  Richard Sandiford  <richard.sandiford@linaro.org>
1789         * tree-if-conv.c (predicate_mem_writes): Remove redundant
1790         call to ifc_temp_var.
1792 2018-01-13  Richard Sandiford  <richard.sandiford@linaro.org>
1793             Alan Hayward  <alan.hayward@arm.com>
1794             David Sherwood  <david.sherwood@arm.com>
1796         * target.def (legitimize_address_displacement): Take the original
1797         offset as a poly_int.
1798         * targhooks.h (default_legitimize_address_displacement): Update
1799         accordingly.
1800         * targhooks.c (default_legitimize_address_displacement): Likewise.
1801         * doc/tm.texi: Regenerate.
1802         * lra-constraints.c (base_plus_disp_to_reg): Take the displacement
1803         as an argument, moving assert of ad->disp == ad->disp_term to...
1804         (process_address_1): ...here.  Update calls to base_plus_disp_to_reg.
1805         Try calling targetm.legitimize_address_displacement before expanding
1806         the address rather than afterwards, and adjust for the new interface.
1807         * config/aarch64/aarch64.c (aarch64_legitimize_address_displacement):
1808         Match the new hook interface.  Handle SVE addresses.
1809         * config/sh/sh.c (sh_legitimize_address_displacement): Make the
1810         new hook interface.
1812 2018-01-13  Richard Sandiford  <richard.sandiford@linaro.org>
1814         * Makefile.in (OBJS): Add early-remat.o.
1815         * target.def (select_early_remat_modes): New hook.
1816         * doc/tm.texi.in (TARGET_SELECT_EARLY_REMAT_MODES): New hook.
1817         * doc/tm.texi: Regenerate.
1818         * targhooks.h (default_select_early_remat_modes): Declare.
1819         * targhooks.c (default_select_early_remat_modes): New function.
1820         * timevar.def (TV_EARLY_REMAT): New timevar.
1821         * passes.def (pass_early_remat): New pass.
1822         * tree-pass.h (make_pass_early_remat): Declare.
1823         * early-remat.c: New file.
1824         * config/aarch64/aarch64.c (aarch64_select_early_remat_modes): New
1825         function.
1826         (TARGET_SELECT_EARLY_REMAT_MODES): Define.
1828 2018-01-13  Richard Sandiford  <richard.sandiford@linaro.org>
1829             Alan Hayward  <alan.hayward@arm.com>
1830             David Sherwood  <david.sherwood@arm.com>
1832         * tree-vect-loop-manip.c (vect_gen_scalar_loop_niters): Replace
1833         vfm1 with a bound_epilog parameter.
1834         (vect_do_peeling): Update calls accordingly, and move the prologue
1835         call earlier in the function.  Treat the base bound_epilog as 0 for
1836         fully-masked loops and retain vf - 1 for other loops.  Add 1 to
1837         this base when peeling for gaps.
1838         * tree-vect-loop.c (vect_analyze_loop_2): Allow peeling for gaps
1839         with fully-masked loops.
1840         (vect_estimate_min_profitable_iters): Handle the single peeled
1841         iteration in that case.
1843 2018-01-13  Richard Sandiford  <richard.sandiford@linaro.org>
1844             Alan Hayward  <alan.hayward@arm.com>
1845             David Sherwood  <david.sherwood@arm.com>
1847         * tree-vect-data-refs.c (vect_analyze_group_access_1): Allow
1848         single-element interleaving even if the size is not a power of 2.
1849         * tree-vect-stmts.c (get_load_store_type): Disallow elementwise
1850         accesses for single-element interleaving if the group size is
1851         not a power of 2.
1853 2018-01-13  Richard Sandiford  <richard.sandiford@linaro.org>
1854             Alan Hayward  <alan.hayward@arm.com>
1855             David Sherwood  <david.sherwood@arm.com>
1857         * doc/md.texi (fold_extract_last_@var{m}): Document.
1858         * doc/sourcebuild.texi (vect_fold_extract_last): Likewise.
1859         * optabs.def (fold_extract_last_optab): New optab.
1860         * internal-fn.def (FOLD_EXTRACT_LAST): New internal function.
1861         * internal-fn.c (fold_extract_direct): New macro.
1862         (expand_fold_extract_optab_fn): Likewise.
1863         (direct_fold_extract_optab_supported_p): Likewise.
1864         * tree-vectorizer.h (EXTRACT_LAST_REDUCTION): New vect_reduction_type.
1865         * tree-vect-loop.c (vect_model_reduction_cost): Handle
1866         EXTRACT_LAST_REDUCTION.
1867         (get_initial_def_for_reduction): Do not create an initial vector
1868         for EXTRACT_LAST_REDUCTION reductions.
1869         (vectorizable_reduction): Leave the scalar phi in place for
1870         EXTRACT_LAST_REDUCTIONs.  Try using EXTRACT_LAST_REDUCTION
1871         ahead of INTEGER_INDUC_COND_REDUCTION.  Do not check for an
1872         epilogue code for EXTRACT_LAST_REDUCTION and defer the
1873         transform phase to vectorizable_condition.
1874         * tree-vect-stmts.c (vect_finish_stmt_generation_1): New function,
1875         split out from...
1876         (vect_finish_stmt_generation): ...here.
1877         (vect_finish_replace_stmt): New function.
1878         (vectorizable_condition): Handle EXTRACT_LAST_REDUCTION.
1879         * config/aarch64/aarch64-sve.md (fold_extract_last_<mode>): New
1880         pattern.
1881         * config/aarch64/aarch64.md (UNSPEC_CLASTB): New unspec.
1883 2018-01-13  Richard Sandiford  <richard.sandiford@linaro.org>
1884             Alan Hayward  <alan.hayward@arm.com>
1885             David Sherwood  <david.sherwood@arm.com>
1887         * doc/md.texi (extract_last_@var{m}): Document.
1888         * optabs.def (extract_last_optab): New optab.
1889         * internal-fn.def (EXTRACT_LAST): New internal function.
1890         * internal-fn.c (cond_unary_direct): New macro.
1891         (expand_cond_unary_optab_fn): Likewise.
1892         (direct_cond_unary_optab_supported_p): Likewise.
1893         * tree-vect-loop.c (vectorizable_live_operation): Allow fully-masked
1894         loops using EXTRACT_LAST.
1895         * config/aarch64/aarch64-sve.md (aarch64_sve_lastb<mode>): Rename to...
1896         (extract_last_<mode>): ...this optab.
1897         (vec_extract<mode><Vel>): Update accordingly.
1899 2018-01-13  Richard Sandiford  <richard.sandiford@linaro.org>
1900             Alan Hayward  <alan.hayward@arm.com>
1901             David Sherwood  <david.sherwood@arm.com>
1903         * target.def (empty_mask_is_expensive): New hook.
1904         * doc/tm.texi.in (TARGET_VECTORIZE_EMPTY_MASK_IS_EXPENSIVE): New hook.
1905         * doc/tm.texi: Regenerate.
1906         * targhooks.h (default_empty_mask_is_expensive): Declare.
1907         * targhooks.c (default_empty_mask_is_expensive): New function.
1908         * tree-vectorizer.c (vectorize_loops): Only call optimize_mask_stores
1909         if the target says that empty masks are expensive.
1910         * config/aarch64/aarch64.c (aarch64_empty_mask_is_expensive):
1911         New function.
1912         (TARGET_VECTORIZE_EMPTY_MASK_IS_EXPENSIVE): Redefine.
1914 2018-01-13  Richard Sandiford  <richard.sandiford@linaro.org>
1915             Alan Hayward  <alan.hayward@arm.com>
1916             David Sherwood  <david.sherwood@arm.com>
1918         * tree-vectorizer.h (_loop_vec_info::mask_skip_niters): New field.
1919         (LOOP_VINFO_MASK_SKIP_NITERS): New macro.
1920         (vect_use_loop_mask_for_alignment_p): New function.
1921         (vect_prepare_for_masked_peels, vect_gen_while_not): Declare.
1922         * tree-vect-loop-manip.c (vect_set_loop_masks_directly): Add an
1923         niters_skip argument.  Make sure that the first niters_skip elements
1924         of the first iteration are inactive.
1925         (vect_set_loop_condition_masked): Handle LOOP_VINFO_MASK_SKIP_NITERS.
1926         Update call to vect_set_loop_masks_directly.
1927         (get_misalign_in_elems): New function, split out from...
1928         (vect_gen_prolog_loop_niters): ...here.
1929         (vect_update_init_of_dr): Take a code argument that specifies whether
1930         the adjustment should be added or subtracted.
1931         (vect_update_init_of_drs): Likewise.
1932         (vect_prepare_for_masked_peels): New function.
1933         (vect_do_peeling): Skip prologue peeling if we're using a mask
1934         instead.  Update call to vect_update_inits_of_drs.
1935         * tree-vect-loop.c (_loop_vec_info::_loop_vec_info): Initialize
1936         mask_skip_niters.
1937         (vect_analyze_loop_2): Allow fully-masked loops with peeling for
1938         alignment.  Do not include the number of peeled iterations in
1939         the minimum threshold in that case.
1940         (vectorizable_induction): Adjust the start value down by
1941         LOOP_VINFO_MASK_SKIP_NITERS iterations.
1942         (vect_transform_loop): Call vect_prepare_for_masked_peels.
1943         Take the number of skipped iterations into account when calculating
1944         the loop bounds.
1945         * tree-vect-stmts.c (vect_gen_while_not): New function.
1947 2018-01-13  Richard Sandiford  <richard.sandiford@linaro.org>
1948             Alan Hayward  <alan.hayward@arm.com>
1949             David Sherwood  <david.sherwood@arm.com>
1951         * doc/sourcebuild.texi (vect_fully_masked): Document.
1952         * params.def (PARAM_MIN_VECT_LOOP_BOUND): Change minimum and
1953         default value to 0.
1954         * tree-vect-loop.c (vect_analyze_loop_costing): New function,
1955         split out from...
1956         (vect_analyze_loop_2): ...here. Don't check the vectorization
1957         factor against the number of loop iterations if the loop is
1958         fully-masked.
1960 2018-01-13  Richard Sandiford  <richard.sandiford@linaro.org>
1961             Alan Hayward  <alan.hayward@arm.com>
1962             David Sherwood  <david.sherwood@arm.com>
1964         * tree-ssa-loop-ivopts.c (USE_ADDRESS): Split into...
1965         (USE_REF_ADDRESS, USE_PTR_ADDRESS): ...these new use types.
1966         (dump_groups): Update accordingly.
1967         (iv_use::mem_type): New member variable.
1968         (address_p): New function.
1969         (record_use): Add a mem_type argument and initialize the new
1970         mem_type field.
1971         (record_group_use): Add a mem_type argument.  Use address_p.
1972         Remove obsolete null checks of base_object.  Update call to record_use.
1973         (find_interesting_uses_op): Update call to record_group_use.
1974         (find_interesting_uses_cond): Likewise.
1975         (find_interesting_uses_address): Likewise.
1976         (get_mem_type_for_internal_fn): New function.
1977         (find_address_like_use): Likewise.
1978         (find_interesting_uses_stmt): Try find_address_like_use before
1979         calling find_interesting_uses_op.
1980         (addr_offset_valid_p): Use the iv mem_type field as the type
1981         of the addressed memory.
1982         (add_autoinc_candidates): Likewise.
1983         (get_address_cost): Likewise.
1984         (split_small_address_groups_p): Use address_p.
1985         (split_address_groups): Likewise.
1986         (add_iv_candidate_for_use): Likewise.
1987         (autoinc_possible_for_pair): Likewise.
1988         (rewrite_groups): Likewise.
1989         (get_use_type): Check for USE_REF_ADDRESS instead of USE_ADDRESS.
1990         (determine_group_iv_cost): Update after split of USE_ADDRESS.
1991         (get_alias_ptr_type_for_ptr_address): New function.
1992         (rewrite_use_address): Rewrite address uses in calls that were
1993         identified by find_address_like_use.
1995 2018-01-13  Richard Sandiford  <richard.sandiford@linaro.org>
1996             Alan Hayward  <alan.hayward@arm.com>
1997             David Sherwood  <david.sherwood@arm.com>
1999         * expr.c (expand_expr_addr_expr_1): Handle ADDR_EXPRs of
2000         TARGET_MEM_REFs.
2001         * gimple-expr.h (is_gimple_addressable: Likewise.
2002         * gimple-expr.c (is_gimple_address): Likewise.
2003         * internal-fn.c (expand_call_mem_ref): New function.
2004         (expand_mask_load_optab_fn): Use it.
2005         (expand_mask_store_optab_fn): Likewise.
2007 2018-01-13  Richard Sandiford  <richard.sandiford@linaro.org>
2008             Alan Hayward  <alan.hayward@arm.com>
2009             David Sherwood  <david.sherwood@arm.com>
2011         * doc/md.texi (cond_add@var{mode}, cond_sub@var{mode})
2012         (cond_and@var{mode}, cond_ior@var{mode}, cond_xor@var{mode})
2013         (cond_smin@var{mode}, cond_smax@var{mode}, cond_umin@var{mode})
2014         (cond_umax@var{mode}): Document.
2015         * optabs.def (cond_add_optab, cond_sub_optab, cond_and_optab)
2016         (cond_ior_optab, cond_xor_optab, cond_smin_optab, cond_smax_optab)
2017         (cond_umin_optab, cond_umax_optab): New optabs.
2018         * internal-fn.def (COND_ADD, COND_SUB, COND_MIN, COND_MAX, COND_AND)
2019         (COND_IOR, COND_XOR): New internal functions.
2020         * internal-fn.h (get_conditional_internal_fn): Declare.
2021         * internal-fn.c (cond_binary_direct): New macro.
2022         (expand_cond_binary_optab_fn): Likewise.
2023         (direct_cond_binary_optab_supported_p): Likewise.
2024         (get_conditional_internal_fn): New function.
2025         * tree-vect-loop.c (vectorizable_reduction): Handle fully-masked loops.
2026         Cope with reduction statements that are vectorized as calls rather
2027         than assignments.
2028         * config/aarch64/aarch64-sve.md (cond_<optab><mode>): New insns.
2029         * config/aarch64/iterators.md (UNSPEC_COND_ADD, UNSPEC_COND_SUB)
2030         (UNSPEC_COND_SMAX, UNSPEC_COND_UMAX, UNSPEC_COND_SMIN)
2031         (UNSPEC_COND_UMIN, UNSPEC_COND_AND, UNSPEC_COND_ORR)
2032         (UNSPEC_COND_EOR): New unspecs.
2033         (optab): Add mappings for them.
2034         (SVE_COND_INT_OP, SVE_COND_FP_OP): New int iterators.
2035         (sve_int_op, sve_fp_op): New int attributes.
2037 2018-01-13  Richard Sandiford  <richard.sandiford@linaro.org>
2038             Alan Hayward  <alan.hayward@arm.com>
2039             David Sherwood  <david.sherwood@arm.com>
2041         * optabs.def (while_ult_optab): New optab.
2042         * doc/md.texi (while_ult@var{m}@var{n}): Document.
2043         * internal-fn.def (WHILE_ULT): New internal function.
2044         * internal-fn.h (direct_internal_fn_supported_p): New override
2045         that takes two types as argument.
2046         * internal-fn.c (while_direct): New macro.
2047         (expand_while_optab_fn): New function.
2048         (convert_optab_supported_p): Likewise.
2049         (direct_while_optab_supported_p): New macro.
2050         * wide-int.h (wi::udiv_ceil): New function.
2051         * tree-vectorizer.h (rgroup_masks): New structure.
2052         (vec_loop_masks): New typedef.
2053         (_loop_vec_info): Add masks, mask_compare_type, can_fully_mask_p
2054         and fully_masked_p.
2055         (LOOP_VINFO_CAN_FULLY_MASK_P, LOOP_VINFO_FULLY_MASKED_P)
2056         (LOOP_VINFO_MASKS, LOOP_VINFO_MASK_COMPARE_TYPE): New macros.
2057         (vect_max_vf): New function.
2058         (slpeel_make_loop_iterate_ntimes): Delete.
2059         (vect_set_loop_condition, vect_get_loop_mask_type, vect_gen_while)
2060         (vect_halve_mask_nunits, vect_double_mask_nunits): Declare.
2061         (vect_record_loop_mask, vect_get_loop_mask): Likewise.
2062         * tree-vect-loop-manip.c: Include tree-ssa-loop-niter.h,
2063         internal-fn.h, stor-layout.h and optabs-query.h.
2064         (vect_set_loop_mask): New function.
2065         (add_preheader_seq): Likewise.
2066         (add_header_seq): Likewise.
2067         (interleave_supported_p): Likewise.
2068         (vect_maybe_permute_loop_masks): Likewise.
2069         (vect_set_loop_masks_directly): Likewise.
2070         (vect_set_loop_condition_masked): Likewise.
2071         (vect_set_loop_condition_unmasked): New function, split out from
2072         slpeel_make_loop_iterate_ntimes.
2073         (slpeel_make_loop_iterate_ntimes): Rename to..
2074         (vect_set_loop_condition): ...this.  Use vect_set_loop_condition_masked
2075         for fully-masked loops and vect_set_loop_condition_unmasked otherwise.
2076         (vect_do_peeling): Update call accordingly.
2077         (vect_gen_vector_loop_niters): Use VF as the step for fully-masked
2078         loops.
2079         * tree-vect-loop.c (_loop_vec_info::_loop_vec_info): Initialize
2080         mask_compare_type, can_fully_mask_p and fully_masked_p.
2081         (release_vec_loop_masks): New function.
2082         (_loop_vec_info): Use it to free the loop masks.
2083         (can_produce_all_loop_masks_p): New function.
2084         (vect_get_max_nscalars_per_iter): Likewise.
2085         (vect_verify_full_masking): Likewise.
2086         (vect_analyze_loop_2): Save LOOP_VINFO_CAN_FULLY_MASK_P around
2087         retries, and free the mask rgroups before retrying.  Check loop-wide
2088         reasons for disallowing fully-masked loops.  Make the final decision
2089         about whether use a fully-masked loop or not.
2090         (vect_estimate_min_profitable_iters): Do not assume that peeling
2091         for the number of iterations will be needed for fully-masked loops.
2092         (vectorizable_reduction): Disable fully-masked loops.
2093         (vectorizable_live_operation): Likewise.
2094         (vect_halve_mask_nunits): New function.
2095         (vect_double_mask_nunits): Likewise.
2096         (vect_record_loop_mask): Likewise.
2097         (vect_get_loop_mask): Likewise.
2098         (vect_transform_loop): Handle the case in which the final loop
2099         iteration might handle a partial vector.  Call vect_set_loop_condition
2100         instead of slpeel_make_loop_iterate_ntimes.
2101         * tree-vect-stmts.c: Include tree-ssa-loop-niter.h and gimple-fold.h.
2102         (check_load_store_masking): New function.
2103         (prepare_load_store_mask): Likewise.
2104         (vectorizable_store): Handle fully-masked loops.
2105         (vectorizable_load): Likewise.
2106         (supportable_widening_operation): Use vect_halve_mask_nunits for
2107         booleans.
2108         (supportable_narrowing_operation): Likewise vect_double_mask_nunits.
2109         (vect_gen_while): New function.
2110         * config/aarch64/aarch64.md (umax<mode>3): New expander.
2111         (aarch64_uqdec<mode>): New insn.
2113 2018-01-13  Richard Sandiford  <richard.sandiford@linaro.org>
2114             Alan Hayward  <alan.hayward@arm.com>
2115             David Sherwood  <david.sherwood@arm.com>
2117         * optabs.def (reduc_and_scal_optab, reduc_ior_scal_optab)
2118         (reduc_xor_scal_optab): New optabs.
2119         * doc/md.texi (reduc_and_scal_@var{m}, reduc_ior_scal_@var{m})
2120         (reduc_xor_scal_@var{m}): Document.
2121         * doc/sourcebuild.texi (vect_logical_reduc): Likewise.
2122         * internal-fn.def (IFN_REDUC_AND, IFN_REDUC_IOR, IFN_REDUC_XOR): New
2123         internal functions.
2124         * fold-const-call.c (fold_const_call): Handle them.
2125         * tree-vect-loop.c (reduction_fn_for_scalar_code): Return the new
2126         internal functions for BIT_AND_EXPR, BIT_IOR_EXPR and BIT_XOR_EXPR.
2127         * config/aarch64/aarch64-sve.md (reduc_<bit_reduc>_scal_<mode>):
2128         (*reduc_<bit_reduc>_scal_<mode>): New patterns.
2129         * config/aarch64/iterators.md (UNSPEC_ANDV, UNSPEC_ORV)
2130         (UNSPEC_XORV): New unspecs.
2131         (optab): Add entries for them.
2132         (BITWISEV): New int iterator.
2133         (bit_reduc_op): New int attributes.
2135 2018-01-13  Richard Sandiford  <richard.sandiford@linaro.org>
2136             Alan Hayward  <alan.hayward@arm.com>
2137             David Sherwood  <david.sherwood@arm.com>
2139         * doc/md.texi (vec_shl_insert_@var{m}): New optab.
2140         * internal-fn.def (VEC_SHL_INSERT): New internal function.
2141         * optabs.def (vec_shl_insert_optab): New optab.
2142         * tree-vectorizer.h (can_duplicate_and_interleave_p): Declare.
2143         (duplicate_and_interleave): Likewise.
2144         * tree-vect-loop.c: Include internal-fn.h.
2145         (neutral_op_for_slp_reduction): New function, split out from
2146         get_initial_defs_for_reduction.
2147         (get_initial_def_for_reduction): Handle option 2 for variable-length
2148         vectors by loading the neutral value into a vector and then shifting
2149         the initial value into element 0.
2150         (get_initial_defs_for_reduction): Replace the code argument with
2151         the neutral value calculated by neutral_op_for_slp_reduction.
2152         Use gimple_build_vector for constant-length vectors.
2153         Use IFN_VEC_SHL_INSERT for variable-length vectors if all
2154         but the first group_size elements have a neutral value.
2155         Use duplicate_and_interleave otherwise.
2156         (vect_create_epilog_for_reduction): Take a neutral_op parameter.
2157         Update call to get_initial_defs_for_reduction.  Handle SLP
2158         reductions for variable-length vectors by creating one vector
2159         result for each scalar result, with the elements associated
2160         with other scalar results stubbed out with the neutral value.
2161         (vectorizable_reduction): Call neutral_op_for_slp_reduction.
2162         Require IFN_VEC_SHL_INSERT for double reductions on
2163         variable-length vectors, or SLP reductions that have
2164         a neutral value.  Require can_duplicate_and_interleave_p
2165         support for variable-length unchained SLP reductions if there
2166         is no neutral value, such as for MIN/MAX reductions.  Also require
2167         the number of vector elements to be a multiple of the number of
2168         SLP statements when doing variable-length unchained SLP reductions.
2169         Update call to vect_create_epilog_for_reduction.
2170         * tree-vect-slp.c (can_duplicate_and_interleave_p): Make public
2171         and remove initial values.
2172         (duplicate_and_interleave): Make public.
2173         * config/aarch64/aarch64.md (UNSPEC_INSR): New unspec.
2174         * config/aarch64/aarch64-sve.md (vec_shl_insert_<mode>): New insn.
2176 2018-01-13  Richard Sandiford  <richard.sandiford@linaro.org>
2177             Alan Hayward  <alan.hayward@arm.com>
2178             David Sherwood  <david.sherwood@arm.com>
2180         * tree-vect-slp.c: Include gimple-fold.h and internal-fn.h
2181         (can_duplicate_and_interleave_p): New function.
2182         (vect_get_and_check_slp_defs): Take the vector of statements
2183         rather than just the current one.  Remove excess parentheses.
2184         Restriction rejectinon of vect_constant_def and vect_external_def
2185         for variable-length vectors to boolean types, or types for which
2186         can_duplicate_and_interleave_p is false.
2187         (vect_build_slp_tree_2): Update call to vect_get_and_check_slp_defs.
2188         (duplicate_and_interleave): New function.
2189         (vect_get_constant_vectors): Use gimple_build_vector for
2190         constant-length vectors and suitable variable-length constant
2191         vectors.  Use duplicate_and_interleave for other variable-length
2192         vectors.  Don't defer the update when inserting new statements.
2194 2018-01-13  Richard Sandiford  <richard.sandiford@linaro.org>
2195             Alan Hayward  <alan.hayward@arm.com>
2196             David Sherwood  <david.sherwood@arm.com>
2198         * tree-vect-loop.c (vect_estimate_min_profitable_iters): Make sure
2199         min_profitable_iters doesn't go negative.
2201 2018-01-13  Richard Sandiford  <richard.sandiford@linaro.org>
2202             Alan Hayward  <alan.hayward@arm.com>
2203             David Sherwood  <david.sherwood@arm.com>
2205         * doc/md.texi (vec_mask_load_lanes@var{m}@var{n}): Document.
2206         (vec_mask_store_lanes@var{m}@var{n}): Likewise.
2207         * optabs.def (vec_mask_load_lanes_optab): New optab.
2208         (vec_mask_store_lanes_optab): Likewise.
2209         * internal-fn.def (MASK_LOAD_LANES): New internal function.
2210         (MASK_STORE_LANES): Likewise.
2211         * internal-fn.c (mask_load_lanes_direct): New macro.
2212         (mask_store_lanes_direct): Likewise.
2213         (expand_mask_load_optab_fn): Handle masked operations.
2214         (expand_mask_load_lanes_optab_fn): New macro.
2215         (expand_mask_store_optab_fn): Handle masked operations.
2216         (expand_mask_store_lanes_optab_fn): New macro.
2217         (direct_mask_load_lanes_optab_supported_p): Likewise.
2218         (direct_mask_store_lanes_optab_supported_p): Likewise.
2219         * tree-vectorizer.h (vect_store_lanes_supported): Take a masked_p
2220         parameter.
2221         (vect_load_lanes_supported): Likewise.
2222         * tree-vect-data-refs.c (strip_conversion): New function.
2223         (can_group_stmts_p): Likewise.
2224         (vect_analyze_data_ref_accesses): Use it instead of checking
2225         for a pair of assignments.
2226         (vect_store_lanes_supported): Take a masked_p parameter.
2227         (vect_load_lanes_supported): Likewise.
2228         * tree-vect-loop.c (vect_analyze_loop_2): Update calls to
2229         vect_store_lanes_supported and vect_load_lanes_supported.
2230         * tree-vect-slp.c (vect_analyze_slp_instance): Likewise.
2231         * tree-vect-stmts.c (get_group_load_store_type): Take a masked_p
2232         parameter.  Don't allow gaps for masked accesses.
2233         Use vect_get_store_rhs.  Update calls to vect_store_lanes_supported
2234         and vect_load_lanes_supported.
2235         (get_load_store_type): Take a masked_p parameter and update
2236         call to get_group_load_store_type.
2237         (vectorizable_store): Update call to get_load_store_type.
2238         Handle IFN_MASK_STORE_LANES.
2239         (vectorizable_load): Update call to get_load_store_type.
2240         Handle IFN_MASK_LOAD_LANES.
2242 2018-01-13  Richard Sandiford  <richard.sandiford@linaro.org>
2243             Alan Hayward  <alan.hayward@arm.com>
2244             David Sherwood  <david.sherwood@arm.com>
2246         * config/aarch64/aarch64-modes.def: Define x2, x3 and x4 vector
2247         modes for SVE.
2248         * config/aarch64/aarch64-protos.h
2249         (aarch64_sve_struct_memory_operand_p): Declare.
2250         * config/aarch64/iterators.md (SVE_STRUCT): New mode iterator.
2251         (vector_count, insn_length, VSINGLE, vsingle): New mode attributes.
2252         (VPRED, vpred): Handle SVE structure modes.
2253         * config/aarch64/constraints.md (Utx): New constraint.
2254         * config/aarch64/predicates.md (aarch64_sve_struct_memory_operand)
2255         (aarch64_sve_struct_nonimmediate_operand): New predicates.
2256         * config/aarch64/aarch64.md (UNSPEC_LDN, UNSPEC_STN): New unspecs.
2257         * config/aarch64/aarch64-sve.md (mov<mode>, *aarch64_sve_mov<mode>_le)
2258         (*aarch64_sve_mov<mode>_be, pred_mov<mode>): New patterns for
2259         structure modes.  Split into pieces after RA.
2260         (vec_load_lanes<mode><vsingle>, vec_mask_load_lanes<mode><vsingle>)
2261         (vec_store_lanes<mode><vsingle>, vec_mask_store_lanes<mode><vsingle>):
2262         New patterns.
2263         * config/aarch64/aarch64.c (aarch64_classify_vector_mode): Handle
2264         SVE structure modes.
2265         (aarch64_classify_address): Likewise.
2266         (sizetochar): Move earlier in file.
2267         (aarch64_print_operand): Handle SVE register lists.
2268         (aarch64_array_mode): New function.
2269         (aarch64_sve_struct_memory_operand_p): Likewise.
2270         (TARGET_ARRAY_MODE): Redefine.
2272 2018-01-13  Richard Sandiford  <richard.sandiford@linaro.org>
2273             Alan Hayward  <alan.hayward@arm.com>
2274             David Sherwood  <david.sherwood@arm.com>
2276         * target.def (array_mode): New target hook.
2277         * doc/tm.texi.in (TARGET_ARRAY_MODE): New hook.
2278         * doc/tm.texi: Regenerate.
2279         * hooks.h (hook_optmode_mode_uhwi_none): Declare.
2280         * hooks.c (hook_optmode_mode_uhwi_none): New function.
2281         * tree-vect-data-refs.c (vect_lanes_optab_supported_p): Use
2282         targetm.array_mode.
2283         * stor-layout.c (mode_for_array): Likewise.  Support polynomial
2284         type sizes.
2286 2018-01-13  Richard Sandiford  <richard.sandiford@linaro.org>
2287             Alan Hayward  <alan.hayward@arm.com>
2288             David Sherwood  <david.sherwood@arm.com>
2290         * fold-const.c (fold_binary_loc): Check the argument types
2291         rather than the result type when testing for a vector operation.
2293 2018-01-13  Richard Sandiford  <richard.sandiford@linaro.org>
2295         * doc/tm.texi.in (DWARF_LAZY_REGISTER_VALUE): Document.
2296         * doc/tm.texi: Regenerate.
2298 2018-01-13  Richard Sandiford  <richard.sandiford@linaro.org>
2299             Alan Hayward  <alan.hayward@arm.com>
2300             David Sherwood  <david.sherwood@arm.com>
2302         * doc/invoke.texi (-msve-vector-bits=): Document new option.
2303         (sve): Document new AArch64 extension.
2304         * doc/md.texi (w): Extend the description of the AArch64
2305         constraint to include SVE vectors.
2306         (Upl, Upa): Document new AArch64 predicate constraints.
2307         * config/aarch64/aarch64-opts.h (aarch64_sve_vector_bits_enum): New
2308         enum.
2309         * config/aarch64/aarch64.opt (sve_vector_bits): New enum.
2310         (msve-vector-bits=): New option.
2311         * config/aarch64/aarch64-option-extensions.def (fp, simd): Disable
2312         SVE when these are disabled.
2313         (sve): New extension.
2314         * config/aarch64/aarch64-modes.def: Define SVE vector and predicate
2315         modes.  Adjust their number of units based on aarch64_sve_vg.
2316         (MAX_BITSIZE_MODE_ANY_MODE): Define.
2317         * config/aarch64/aarch64-protos.h (ADDR_QUERY_ANY): New
2318         aarch64_addr_query_type.
2319         (aarch64_const_vec_all_same_in_range_p, aarch64_sve_pred_mode)
2320         (aarch64_sve_cnt_immediate_p, aarch64_sve_addvl_addpl_immediate_p)
2321         (aarch64_sve_inc_dec_immediate_p, aarch64_add_offset_temporaries)
2322         (aarch64_split_add_offset, aarch64_output_sve_cnt_immediate)
2323         (aarch64_output_sve_addvl_addpl, aarch64_output_sve_inc_dec_immediate)
2324         (aarch64_output_sve_mov_immediate, aarch64_output_ptrue): Declare.
2325         (aarch64_simd_imm_zero_p): Delete.
2326         (aarch64_check_zero_based_sve_index_immediate): Declare.
2327         (aarch64_sve_index_immediate_p, aarch64_sve_arith_immediate_p)
2328         (aarch64_sve_bitmask_immediate_p, aarch64_sve_dup_immediate_p)
2329         (aarch64_sve_cmp_immediate_p, aarch64_sve_float_arith_immediate_p)
2330         (aarch64_sve_float_mul_immediate_p): Likewise.
2331         (aarch64_classify_symbol): Take the offset as a HOST_WIDE_INT
2332         rather than an rtx.
2333         (aarch64_sve_ld1r_operand_p, aarch64_sve_ldr_operand_p): Declare.
2334         (aarch64_expand_mov_immediate): Take a gen_vec_duplicate callback.
2335         (aarch64_emit_sve_pred_move, aarch64_expand_sve_mem_move): Declare.
2336         (aarch64_expand_sve_vec_cmp_int, aarch64_expand_sve_vec_cmp_float)
2337         (aarch64_expand_sve_vcond, aarch64_expand_sve_vec_perm): Declare.
2338         (aarch64_regmode_natural_size): Likewise.
2339         * config/aarch64/aarch64.h (AARCH64_FL_SVE): New macro.
2340         (AARCH64_FL_V8_3, AARCH64_FL_RCPC, AARCH64_FL_DOTPROD): Shift
2341         left one place.
2342         (AARCH64_ISA_SVE, TARGET_SVE): New macros.
2343         (FIXED_REGISTERS, CALL_USED_REGISTERS, REGISTER_NAMES): Add entries
2344         for VG and the SVE predicate registers.
2345         (V_ALIASES): Add a "z"-prefixed alias.
2346         (FIRST_PSEUDO_REGISTER): Change to P15_REGNUM + 1.
2347         (AARCH64_DWARF_VG, AARCH64_DWARF_P0): New macros.
2348         (PR_REGNUM_P, PR_LO_REGNUM_P): Likewise.
2349         (PR_LO_REGS, PR_HI_REGS, PR_REGS): New reg_classes.
2350         (REG_CLASS_NAMES): Add entries for them.
2351         (REG_CLASS_CONTENTS): Likewise.  Update ALL_REGS to include VG
2352         and the predicate registers.
2353         (aarch64_sve_vg): Declare.
2354         (BITS_PER_SVE_VECTOR, BYTES_PER_SVE_VECTOR, BYTES_PER_SVE_PRED)
2355         (SVE_BYTE_MODE, MAX_COMPILE_TIME_VEC_BYTES): New macros.
2356         (REGMODE_NATURAL_SIZE): Define.
2357         * config/aarch64/aarch64-c.c (aarch64_update_cpp_builtins): Handle
2358         SVE macros.
2359         * config/aarch64/aarch64.c: Include cfgrtl.h.
2360         (simd_immediate_info): Add a constructor for series vectors,
2361         and an associated step field.
2362         (aarch64_sve_vg): New variable.
2363         (aarch64_dbx_register_number): Handle VG and the predicate registers.
2364         (aarch64_vect_struct_mode_p, aarch64_vector_mode_p): Delete.
2365         (VEC_ADVSIMD, VEC_SVE_DATA, VEC_SVE_PRED, VEC_STRUCT, VEC_ANY_SVE)
2366         (VEC_ANY_DATA, VEC_STRUCT): New constants.
2367         (aarch64_advsimd_struct_mode_p, aarch64_sve_pred_mode_p)
2368         (aarch64_classify_vector_mode, aarch64_vector_data_mode_p)
2369         (aarch64_sve_data_mode_p, aarch64_sve_pred_mode)
2370         (aarch64_get_mask_mode): New functions.
2371         (aarch64_hard_regno_nregs): Handle SVE data modes for FP_REGS
2372         and FP_LO_REGS.  Handle PR_REGS, PR_LO_REGS and PR_HI_REGS.
2373         (aarch64_hard_regno_mode_ok): Handle VG.  Also handle the SVE
2374         predicate modes and predicate registers.  Explicitly restrict
2375         GPRs to modes of 16 bytes or smaller.  Only allow FP registers
2376         to store a vector mode if it is recognized by
2377         aarch64_classify_vector_mode.
2378         (aarch64_regmode_natural_size): New function.
2379         (aarch64_hard_regno_caller_save_mode): Return the original mode
2380         for predicates.
2381         (aarch64_sve_cnt_immediate_p, aarch64_output_sve_cnt_immediate)
2382         (aarch64_sve_addvl_addpl_immediate_p, aarch64_output_sve_addvl_addpl)
2383         (aarch64_sve_inc_dec_immediate_p, aarch64_output_sve_inc_dec_immediate)
2384         (aarch64_add_offset_1_temporaries, aarch64_offset_temporaries): New
2385         functions.
2386         (aarch64_add_offset): Add a temp2 parameter.  Assert that temp1
2387         does not overlap dest if the function is frame-related.  Handle
2388         SVE constants.
2389         (aarch64_split_add_offset): New function.
2390         (aarch64_add_sp, aarch64_sub_sp): Add temp2 parameters and pass
2391         them aarch64_add_offset.
2392         (aarch64_allocate_and_probe_stack_space): Add a temp2 parameter
2393         and update call to aarch64_sub_sp.
2394         (aarch64_add_cfa_expression): New function.
2395         (aarch64_expand_prologue): Pass extra temporary registers to the
2396         functions above.  Handle the case in which we need to emit new
2397         DW_CFA_expressions for registers that were originally saved
2398         relative to the stack pointer, but now have to be expressed
2399         relative to the frame pointer.
2400         (aarch64_output_mi_thunk): Pass extra temporary registers to the
2401         functions above.
2402         (aarch64_expand_epilogue): Likewise.  Prevent inheritance of
2403         IP0 and IP1 values for SVE frames.
2404         (aarch64_expand_vec_series): New function.
2405         (aarch64_expand_sve_widened_duplicate): Likewise.
2406         (aarch64_expand_sve_const_vector): Likewise.
2407         (aarch64_expand_mov_immediate): Add a gen_vec_duplicate parameter.
2408         Handle SVE constants.  Use emit_move_insn to move a force_const_mem
2409         into the register, rather than emitting a SET directly.
2410         (aarch64_emit_sve_pred_move, aarch64_expand_sve_mem_move)
2411         (aarch64_get_reg_raw_mode, offset_4bit_signed_scaled_p)
2412         (offset_6bit_unsigned_scaled_p, aarch64_offset_7bit_signed_scaled_p)
2413         (offset_9bit_signed_scaled_p): New functions.
2414         (aarch64_replicate_bitmask_imm): New function.
2415         (aarch64_bitmask_imm): Use it.
2416         (aarch64_cannot_force_const_mem): Reject expressions involving
2417         a CONST_POLY_INT.  Update call to aarch64_classify_symbol.
2418         (aarch64_classify_index): Handle SVE indices, by requiring
2419         a plain register index with a scale that matches the element size.
2420         (aarch64_classify_address): Handle SVE addresses.  Assert that
2421         the mode of the address is VOIDmode or an integer mode.
2422         Update call to aarch64_classify_symbol.
2423         (aarch64_classify_symbolic_expression): Update call to
2424         aarch64_classify_symbol.
2425         (aarch64_const_vec_all_in_range_p): New function.
2426         (aarch64_print_vector_float_operand): Likewise.
2427         (aarch64_print_operand): Handle 'N' and 'C'.  Use "zN" rather than
2428         "vN" for FP registers with SVE modes.  Handle (const ...) vectors
2429         and the FP immediates 1.0 and 0.5.
2430         (aarch64_print_address_internal): Handle SVE addresses.
2431         (aarch64_print_operand_address): Use ADDR_QUERY_ANY.
2432         (aarch64_regno_regclass): Handle predicate registers.
2433         (aarch64_secondary_reload): Handle big-endian reloads of SVE
2434         data modes.
2435         (aarch64_class_max_nregs): Handle SVE modes and predicate registers.
2436         (aarch64_rtx_costs): Check for ADDVL and ADDPL instructions.
2437         (aarch64_convert_sve_vector_bits): New function.
2438         (aarch64_override_options): Use it to handle -msve-vector-bits=.
2439         (aarch64_classify_symbol): Take the offset as a HOST_WIDE_INT
2440         rather than an rtx.
2441         (aarch64_legitimate_constant_p): Use aarch64_classify_vector_mode.
2442         Handle SVE vector and predicate modes.  Accept VL-based constants
2443         that need only one temporary register, and VL offsets that require
2444         no temporary registers.
2445         (aarch64_conditional_register_usage): Mark the predicate registers
2446         as fixed if SVE isn't available.
2447         (aarch64_vector_mode_supported_p): Use aarch64_classify_vector_mode.
2448         Return true for SVE vector and predicate modes.
2449         (aarch64_simd_container_mode): Take the number of bits as a poly_int64
2450         rather than an unsigned int.  Handle SVE modes.
2451         (aarch64_preferred_simd_mode): Update call accordingly.  Handle
2452         SVE modes.
2453         (aarch64_autovectorize_vector_sizes): Add BYTES_PER_SVE_VECTOR
2454         if SVE is enabled.
2455         (aarch64_sve_index_immediate_p, aarch64_sve_arith_immediate_p)
2456         (aarch64_sve_bitmask_immediate_p, aarch64_sve_dup_immediate_p)
2457         (aarch64_sve_cmp_immediate_p, aarch64_sve_float_arith_immediate_p)
2458         (aarch64_sve_float_mul_immediate_p): New functions.
2459         (aarch64_sve_valid_immediate): New function.
2460         (aarch64_simd_valid_immediate): Use it as the fallback for SVE vectors.
2461         Explicitly reject structure modes.  Check for INDEX constants.
2462         Handle PTRUE and PFALSE constants.
2463         (aarch64_check_zero_based_sve_index_immediate): New function.
2464         (aarch64_simd_imm_zero_p): Delete.
2465         (aarch64_mov_operand_p): Use aarch64_simd_valid_immediate for
2466         vector modes.  Accept constants in the range of CNT[BHWD].
2467         (aarch64_simd_scalar_immediate_valid_for_move): Explicitly
2468         ask for an Advanced SIMD mode.
2469         (aarch64_sve_ld1r_operand_p, aarch64_sve_ldr_operand_p): New functions.
2470         (aarch64_simd_vector_alignment): Handle SVE predicates.
2471         (aarch64_vectorize_preferred_vector_alignment): New function.
2472         (aarch64_simd_vector_alignment_reachable): Use it instead of
2473         the vector size.
2474         (aarch64_shift_truncation_mask): Use aarch64_vector_data_mode_p.
2475         (aarch64_output_sve_mov_immediate, aarch64_output_ptrue): New
2476         functions.
2477         (MAX_VECT_LEN): Delete.
2478         (expand_vec_perm_d): Add a vec_flags field.
2479         (emit_unspec2, aarch64_expand_sve_vec_perm): New functions.
2480         (aarch64_evpc_trn, aarch64_evpc_uzp, aarch64_evpc_zip)
2481         (aarch64_evpc_ext): Don't apply a big-endian lane correction
2482         for SVE modes.
2483         (aarch64_evpc_rev): Rename to...
2484         (aarch64_evpc_rev_local): ...this.  Use a predicated operation for SVE.
2485         (aarch64_evpc_rev_global): New function.
2486         (aarch64_evpc_dup): Enforce a 64-byte range for SVE DUP.
2487         (aarch64_evpc_tbl): Use MAX_COMPILE_TIME_VEC_BYTES instead of
2488         MAX_VECT_LEN.
2489         (aarch64_evpc_sve_tbl): New function.
2490         (aarch64_expand_vec_perm_const_1): Update after rename of
2491         aarch64_evpc_rev.  Handle SVE permutes too, trying
2492         aarch64_evpc_rev_global and using aarch64_evpc_sve_tbl rather
2493         than aarch64_evpc_tbl.
2494         (aarch64_vectorize_vec_perm_const): Initialize vec_flags.
2495         (aarch64_sve_cmp_operand_p, aarch64_unspec_cond_code)
2496         (aarch64_gen_unspec_cond, aarch64_expand_sve_vec_cmp_int)
2497         (aarch64_emit_unspec_cond, aarch64_emit_unspec_cond_or)
2498         (aarch64_emit_inverted_unspec_cond, aarch64_expand_sve_vec_cmp_float)
2499         (aarch64_expand_sve_vcond): New functions.
2500         (aarch64_modes_tieable_p): Use aarch64_vector_data_mode_p instead
2501         of aarch64_vector_mode_p.
2502         (aarch64_dwarf_poly_indeterminate_value): New function.
2503         (aarch64_compute_pressure_classes): Likewise.
2504         (aarch64_can_change_mode_class): Likewise.
2505         (TARGET_GET_RAW_RESULT_MODE, TARGET_GET_RAW_ARG_MODE): Redefine.
2506         (TARGET_VECTORIZE_PREFERRED_VECTOR_ALIGNMENT): Likewise.
2507         (TARGET_VECTORIZE_GET_MASK_MODE): Likewise.
2508         (TARGET_DWARF_POLY_INDETERMINATE_VALUE): Likewise.
2509         (TARGET_COMPUTE_PRESSURE_CLASSES): Likewise.
2510         (TARGET_CAN_CHANGE_MODE_CLASS): Likewise.
2511         * config/aarch64/constraints.md (Upa, Upl, Uav, Uat, Usv, Usi, Utr)
2512         (Uty, Dm, vsa, vsc, vsd, vsi, vsn, vsl, vsm, vsA, vsM, vsN): New
2513         constraints.
2514         (Dn, Dl, Dr): Accept const as well as const_vector.
2515         (Dz): Likewise.  Compare against CONST0_RTX.
2516         * config/aarch64/iterators.md: Refer to "Advanced SIMD" instead
2517         of "vector" where appropriate.
2518         (SVE_ALL, SVE_BH, SVE_BHS, SVE_BHSI, SVE_HSDI, SVE_HSF, SVE_SD)
2519         (SVE_SDI, SVE_I, SVE_F, PRED_ALL, PRED_BHS): New mode iterators.
2520         (UNSPEC_SEL, UNSPEC_ANDF, UNSPEC_IORF, UNSPEC_XORF, UNSPEC_COND_LT)
2521         (UNSPEC_COND_LE, UNSPEC_COND_EQ, UNSPEC_COND_NE, UNSPEC_COND_GE)
2522         (UNSPEC_COND_GT, UNSPEC_COND_LO, UNSPEC_COND_LS, UNSPEC_COND_HS)
2523         (UNSPEC_COND_HI, UNSPEC_COND_UO): New unspecs.
2524         (Vetype, VEL, Vel, VWIDE, Vwide, vw, vwcore, V_INT_EQUIV)
2525         (v_int_equiv): Extend to SVE modes.
2526         (Vesize, V128, v128, Vewtype, V_FP_EQUIV, v_fp_equiv, VPRED): New
2527         mode attributes.
2528         (LOGICAL_OR, SVE_INT_UNARY, SVE_FP_UNARY): New code iterators.
2529         (optab): Handle popcount, smin, smax, umin, umax, abs and sqrt.
2530         (logical_nn, lr, sve_int_op, sve_fp_op): New code attributs.
2531         (LOGICALF, OPTAB_PERMUTE, UNPACK, UNPACK_UNSIGNED, SVE_COND_INT_CMP)
2532         (SVE_COND_FP_CMP): New int iterators.
2533         (perm_hilo): Handle the new unpack unspecs.
2534         (optab, logicalf_op, su, perm_optab, cmp_op, imm_con): New int
2535         attributes.
2536         * config/aarch64/predicates.md (aarch64_sve_cnt_immediate)
2537         (aarch64_sve_addvl_addpl_immediate, aarch64_split_add_offset_immediate)
2538         (aarch64_pluslong_or_poly_operand, aarch64_nonmemory_operand)
2539         (aarch64_equality_operator, aarch64_constant_vector_operand)
2540         (aarch64_sve_ld1r_operand, aarch64_sve_ldr_operand): New predicates.
2541         (aarch64_sve_nonimmediate_operand): Likewise.
2542         (aarch64_sve_general_operand): Likewise.
2543         (aarch64_sve_dup_operand, aarch64_sve_arith_immediate): Likewise.
2544         (aarch64_sve_sub_arith_immediate, aarch64_sve_inc_dec_immediate)
2545         (aarch64_sve_logical_immediate, aarch64_sve_mul_immediate): Likewise.
2546         (aarch64_sve_dup_immediate, aarch64_sve_cmp_vsc_immediate): Likewise.
2547         (aarch64_sve_cmp_vsd_immediate, aarch64_sve_index_immediate): Likewise.
2548         (aarch64_sve_float_arith_immediate): Likewise.
2549         (aarch64_sve_float_arith_with_sub_immediate): Likewise.
2550         (aarch64_sve_float_mul_immediate, aarch64_sve_arith_operand): Likewise.
2551         (aarch64_sve_add_operand, aarch64_sve_logical_operand): Likewise.
2552         (aarch64_sve_lshift_operand, aarch64_sve_rshift_operand): Likewise.
2553         (aarch64_sve_mul_operand, aarch64_sve_cmp_vsc_operand): Likewise.
2554         (aarch64_sve_cmp_vsd_operand, aarch64_sve_index_operand): Likewise.
2555         (aarch64_sve_float_arith_operand): Likewise.
2556         (aarch64_sve_float_arith_with_sub_operand): Likewise.
2557         (aarch64_sve_float_mul_operand): Likewise.
2558         (aarch64_sve_vec_perm_operand): Likewise.
2559         (aarch64_pluslong_operand): Include aarch64_sve_addvl_addpl_immediate.
2560         (aarch64_mov_operand): Accept const_poly_int and const_vector.
2561         (aarch64_simd_lshift_imm, aarch64_simd_rshift_imm): Accept const
2562         as well as const_vector.
2563         (aarch64_simd_imm_zero, aarch64_simd_imm_minus_one): Move earlier
2564         in file.  Use CONST0_RTX and CONSTM1_RTX.
2565         (aarch64_simd_or_scalar_imm_zero): Likewise.  Add match_codes.
2566         (aarch64_simd_reg_or_zero): Accept const as well as const_vector.
2567         Use aarch64_simd_imm_zero.
2568         * config/aarch64/aarch64-sve.md: New file.
2569         * config/aarch64/aarch64.md: Include it.
2570         (VG_REGNUM, P0_REGNUM, P7_REGNUM, P15_REGNUM): New register numbers.
2571         (UNSPEC_REV, UNSPEC_LD1_SVE, UNSPEC_ST1_SVE, UNSPEC_MERGE_PTRUE)
2572         (UNSPEC_PTEST_PTRUE, UNSPEC_UNPACKSHI, UNSPEC_UNPACKUHI)
2573         (UNSPEC_UNPACKSLO, UNSPEC_UNPACKULO, UNSPEC_PACK)
2574         (UNSPEC_FLOAT_CONVERT, UNSPEC_WHILE_LO): New unspec constants.
2575         (sve): New attribute.
2576         (enabled): Disable instructions with the sve attribute unless
2577         TARGET_SVE.
2578         (movqi, movhi): Pass CONST_POLY_INT operaneds through
2579         aarch64_expand_mov_immediate.
2580         (*mov<mode>_aarch64, *movsi_aarch64, *movdi_aarch64): Handle
2581         CNT[BHSD] immediates.
2582         (movti): Split CONST_POLY_INT moves into two halves.
2583         (add<mode>3): Accept aarch64_pluslong_or_poly_operand.
2584         Split additions that need a temporary here if the destination
2585         is the stack pointer.
2586         (*add<mode>3_aarch64): Handle ADDVL and ADDPL immediates.
2587         (*add<mode>3_poly_1): New instruction.
2588         (set_clobber_cc): New expander.
2590 2018-01-13  Richard Sandiford  <richard.sandiford@linaro.org>
2592         * simplify-rtx.c (simplify_immed_subreg): Add an inner_bytes
2593         parameter and use it instead of GET_MODE_SIZE (innermode).  Use
2594         inner_bytes * BITS_PER_UNIT instead of GET_MODE_BITSIZE (innermode).
2595         Use CEIL (inner_bytes, GET_MODE_UNIT_SIZE (innermode)) instead of
2596         GET_MODE_NUNITS (innermode).  Also add a first_elem parameter.
2597         Change innermode from fixed_mode_size to machine_mode.
2598         (simplify_subreg): Update call accordingly.  Handle a constant-sized
2599         subreg of a variable-length CONST_VECTOR.
2601 2018-01-13  Richard Sandiford  <richard.sandiford@linaro.org>
2602             Alan Hayward  <alan.hayward@arm.com>
2603             David Sherwood  <david.sherwood@arm.com>
2605         * tree-ssa-address.c (mem_ref_valid_without_offset_p): New function.
2606         (add_offset_to_base): New function, split out from...
2607         (create_mem_ref): ...here.  When handling a scale other than 1,
2608         check first whether the address is valid without the offset.
2609         Add it into the base if so, leaving the index and scale as-is.
2611 2018-01-12  Jakub Jelinek  <jakub@redhat.com>
2613         PR c++/83778
2614         * config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin): Call
2615         fold_for_warn before checking if arg2 is INTEGER_CST.
2617 2018-01-12  Segher Boessenkool  <segher@kernel.crashing.org>
2619         * config/rs6000/predicates.md (load_multiple_operation): Delete.
2620         (store_multiple_operation): Delete.
2621         * config/rs6000/rs6000-cpus.def (601): Remove MASK_STRING.
2622         * config/rs6000/rs6000-protos.h (rs6000_output_load_multiple): Delete.
2623         * config/rs6000/rs6000-string.c (expand_block_move): Delete everything
2624         guarded by TARGET_STRING.
2625         (rs6000_output_load_multiple): Delete.
2626         * config/rs6000/rs6000.c (rs6000_option_override_internal): Delete
2627         OPTION_MASK_STRING / TARGET_STRING handling.
2628         (print_operand) <'N', 'O'>: Add comment that these are unused now.
2629         (const rs6000_opt_masks) <"string">: Change mask to 0.
2630         * config/rs6000/rs6000.h (TARGET_DEFAULT): Remove MASK_STRING.
2631         (MASK_STRING): Delete.
2632         * config/rs6000/rs6000.md (*mov<mode>_string): Delete TARGET_STRING
2633         parts.  Simplify.
2634         (load_multiple): Delete.
2635         (*ldmsi8): Delete.
2636         (*ldmsi7): Delete.
2637         (*ldmsi6): Delete.
2638         (*ldmsi5): Delete.
2639         (*ldmsi4): Delete.
2640         (*ldmsi3): Delete.
2641         (store_multiple): Delete.
2642         (*stmsi8): Delete.
2643         (*stmsi7): Delete.
2644         (*stmsi6): Delete.
2645         (*stmsi5): Delete.
2646         (*stmsi4): Delete.
2647         (*stmsi3): Delete.
2648         (movmemsi_8reg): Delete.
2649         (corresponding unnamed define_insn): Delete.
2650         (movmemsi_6reg): Delete.
2651         (corresponding unnamed define_insn): Delete.
2652         (movmemsi_4reg): Delete.
2653         (corresponding unnamed define_insn): Delete.
2654         (movmemsi_2reg): Delete.
2655         (corresponding unnamed define_insn): Delete.
2656         (movmemsi_1reg): Delete.
2657         (corresponding unnamed define_insn): Delete.
2658         * config/rs6000/rs6000.opt (mno-string): New.
2659         (mstring): Replace by deprecation warning stub.
2660         * doc/invoke.texi (RS/6000 and PowerPC Options): Delete -mstring.
2662 2018-01-12  Jakub Jelinek  <jakub@redhat.com>
2664         * regrename.c (regrename_do_replace): If replacing the same
2665         reg multiple times, try to reuse last created gen_raw_REG.
2667         PR debug/81155
2668         * bb-reorder.c (pass_partition_blocks::gate): In lto don't partition
2669         main to workaround a bug in GDB.
2671 2018-01-12  Tom de Vries  <tom@codesourcery.com>
2673         PR target/83737
2674         * config.gcc (nvptx*-*-*): Set use_gcc_stdint=wrap.
2676 2018-01-12  Vladimir Makarov  <vmakarov@redhat.com>
2678         PR rtl-optimization/80481
2679         * ira-color.c (get_cap_member): New function.
2680         (allocnos_conflict_by_live_ranges_p): Use it.
2681         (slot_coalesced_allocno_live_ranges_intersect_p): Add assert.
2682         (setup_slot_coalesced_allocno_live_ranges): Ditto.
2684 2018-01-12  Uros Bizjak  <ubizjak@gmail.com>
2686         PR target/83628
2687         * config/alpha/alpha.md (*saddsi_1): New insn_ans_split pattern.
2688         (*saddl_se_1): Ditto.
2689         (*ssubsi_1): Ditto.
2690         (*ssubl_se_1): Ditto.
2692 2018-01-12  Richard Sandiford  <richard.sandiford@linaro.org>
2694         * tree-predcom.c (aff_combination_dr_offset): Use wi::to_poly_widest
2695         rather than wi::to_widest for DR_INITs.
2696         * tree-vect-data-refs.c (vect_find_same_alignment_drs): Use
2697         wi::to_poly_offset rather than wi::to_offset for DR_INIT.
2698         (vect_analyze_data_ref_accesses): Require both DR_INITs to be
2699         INTEGER_CSTs.
2700         (vect_analyze_group_access_1): Note that here.
2702 2018-01-12  Richard Sandiford  <richard.sandiford@linaro.org>
2704         * tree-vectorizer.c (get_vec_alignment_for_array_type): Handle
2705         polynomial type sizes.
2707 2018-01-12  Richard Sandiford  <richard.sandiford@linaro.org>
2709         * gimplify.c (gimple_add_tmp_var_fn): Allow variables to have a
2710         poly_uint64 size, rather than requiring an unsigned HOST_WIDE_INT size.
2711         (gimple_add_tmp_var): Likewise.
2713 2018-01-12  Martin Liska  <mliska@suse.cz>
2715         * gimple.c (gimple_alloc_counts): Use uint64_t instead of int.
2716         (gimple_alloc_sizes): Likewise.
2717         (dump_gimple_statistics): Use PRIu64 in printf format.
2718         * gimple.h: Change uint64_t to int.
2720 2018-01-12  Martin Liska  <mliska@suse.cz>
2722         * tree-core.h: Use uint64_t instead of int.
2723         * tree.c (tree_node_counts): Likewise.
2724         (tree_node_sizes): Likewise.
2725         (dump_tree_statistics): Use PRIu64 in printf format.
2727 2018-01-12  Martin Liska  <mliska@suse.cz>
2729         * Makefile.in: As qsort_chk is implemented in vec.c, add
2730         vec.o to linkage of gencfn-macros.
2731         * tree.c (build_new_poly_int_cst): Add CXX_MEM_STAT_INFO as it's
2732         passing the info to record_node_allocation_statistics.
2733         (test_vector_cst_patterns): Add CXX_MEM_STAT_INFO to declaration
2734         and pass the info.
2735         * ggc-common.c (struct ggc_usage): Add operator== and use
2736         it in operator< and compare function.
2737         * mem-stats.h (struct mem_usage): Likewise.
2738         * vec.c (struct vec_usage): Remove operator< and compare
2739         function. Can be simply inherited.
2741 2018-01-12  Martin Jambor  <mjambor@suse.cz>
2743         PR target/81616
2744         * params.def: New parameter PARAM_AVOID_FMA_MAX_BITS.
2745         * tree-ssa-math-opts.c: Include domwalk.h.
2746         (convert_mult_to_fma_1): New function.
2747         (fma_transformation_info): New type.
2748         (fma_deferring_state): Likewise.
2749         (cancel_fma_deferring): New function.
2750         (result_of_phi): Likewise.
2751         (last_fma_candidate_feeds_initial_phi): Likewise.
2752         (convert_mult_to_fma): Added deferring logic, split actual
2753         transformation to convert_mult_to_fma_1.
2754         (math_opts_dom_walker): New type.
2755         (math_opts_dom_walker::after_dom_children): New method, body moved
2756         here from pass_optimize_widening_mul::execute, added deferring logic
2757         bits.
2758         (pass_optimize_widening_mul::execute): Moved most of code to
2759         math_opts_dom_walker::after_dom_children.
2760         * config/i386/x86-tune.def (X86_TUNE_AVOID_128FMA_CHAINS): New.
2761         * config/i386/i386.c (ix86_option_override_internal): Added
2762         maybe_setting of PARAM_AVOID_FMA_MAX_BITS.
2764 2018-01-12  Richard Biener  <rguenther@suse.de>
2766         PR debug/83157
2767         * dwarf2out.c (gen_variable_die): Do not reset old_die for
2768         inline instance vars.
2770 2018-01-12  Oleg Endo  <olegendo@gcc.gnu.org>
2772         PR target/81819
2773         * config/rx/rx.c (rx_is_restricted_memory_address):
2774         Handle SUBREG case.
2776 2018-01-12  Richard Biener  <rguenther@suse.de>
2778         PR tree-optimization/80846
2779         * target.def (split_reduction): New target hook.
2780         * targhooks.c (default_split_reduction): New function.
2781         * targhooks.h (default_split_reduction): Declare.
2782         * tree-vect-loop.c (vect_create_epilog_for_reduction): If the
2783         target requests first reduce vectors by combining low and high
2784         parts.
2785         * tree-vect-stmts.c (vect_gen_perm_mask_any): Adjust.
2786         (get_vectype_for_scalar_type_and_size): Export.
2787         * tree-vectorizer.h (get_vectype_for_scalar_type_and_size): Declare.
2788         * doc/tm.texi.in (TARGET_VECTORIZE_SPLIT_REDUCTION): Document.
2789         * doc/tm.texi: Regenerate.
2790         * config/i386/i386.c (ix86_split_reduction): Implement
2791         TARGET_VECTORIZE_SPLIT_REDUCTION.
2793 2018-01-12  Eric Botcazou  <ebotcazou@adacore.com>
2795         PR target/83368
2796         * config/sparc/sparc.h (PIC_OFFSET_TABLE_REGNUM): Set to INVALID_REGNUM
2797         in PIC mode except for TARGET_VXWORKS_RTP.
2798         * config/sparc/sparc.c: Include cfgrtl.h.
2799         (TARGET_INIT_PIC_REG): Define.
2800         (TARGET_USE_PSEUDO_PIC_REG): Likewise.
2801         (sparc_pic_register_p): New predicate.
2802         (sparc_legitimate_address_p): Use it.
2803         (sparc_legitimize_pic_address): Likewise.
2804         (sparc_delegitimize_address): Likewise.
2805         (sparc_mode_dependent_address_p): Likewise.
2806         (gen_load_pcrel_sym): Remove 4th parameter.
2807         (load_got_register): Adjust call to above.  Remove obsolete stuff.
2808         (sparc_expand_prologue): Do not call load_got_register here.
2809         (sparc_flat_expand_prologue): Likewise.
2810         (sparc_output_mi_thunk): Set the pic_offset_table_rtx object.
2811         (sparc_use_pseudo_pic_reg): New function.
2812         (sparc_init_pic_reg): Likewise.
2813         * config/sparc/sparc.md (vxworks_load_got): Set the GOT register.
2814         (builtin_setjmp_receiver): Enable only for TARGET_VXWORKS_RTP.
2816 2018-01-12  Christophe Lyon  <christophe.lyon@linaro.org>
2818         * doc/sourcebuild.texi (Effective-Target Keywords, Other attributes):
2819         Add item for branch_cost.
2821 2018-01-12  Eric Botcazou  <ebotcazou@adacore.com>
2823         PR rtl-optimization/83565
2824         * rtlanal.c (nonzero_bits1): On WORD_REGISTER_OPERATIONS machines, do
2825         not extend the result to a larger mode for rotate operations.
2826         (num_sign_bit_copies1): Likewise.
2828 2018-01-12  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
2830         PR target/40411
2831         * config/sol2.h (STARTFILE_ARCH_SPEC): Don't use with -shared or
2832         -symbolic.
2833         Use values-Xc.o for -pedantic.
2834         Link with values-xpg4.o for C90, values-xpg6.o otherwise.
2836 2018-01-12  Martin Liska  <mliska@suse.cz>
2838         PR ipa/83054
2839         * ipa-devirt.c (final_warning_record::grow_type_warnings):
2840         New function.
2841         (possible_polymorphic_call_targets): Use it.
2842         (ipa_devirt): Likewise.
2844 2018-01-12  Martin Liska  <mliska@suse.cz>
2846         * profile-count.h (enum profile_quality): Use 0 as invalid
2847         enum value of profile_quality.
2849 2018-01-12  Chung-Ju Wu  <jasonwucj@gmail.com>
2851         * doc/invoke.texi (NDS32 Options): Add -mext-perf, -mext-perf2 and
2852         -mext-string options.
2854 2018-01-12  Richard Biener  <rguenther@suse.de>
2856         * lto-streamer-out.c (DFS::DFS_write_tree_body): Process
2857         DECL_DEBUG_EXPR conditional on DECL_HAS_DEBUG_EXPR_P.
2858         * tree-streamer-in.c (lto_input_ts_decl_common_tree_pointers):
2859         Likewise.
2860         * tree-streamer-out.c (write_ts_decl_common_tree_pointers): Likewise.
2862 2018-01-11  Michael Meissner  <meissner@linux.vnet.ibm.com>
2864         * configure.ac (--with-long-double-format): Add support for the
2865         configuration option to change the default long double format on
2866         PowerPC systems.
2867         * config.gcc (powerpc*-linux*-*): Likewise.
2868         * configure: Regenerate.
2869         * config/rs6000/rs6000-c.c (rs6000_cpu_cpp_builtins): If long
2870         double is IEEE, define __KC__ and __KF__ to allow floatn.h to be
2871         used without modification.
2873 2018-01-11  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
2875         * config/rs6000/rs6000-builtin.def (BU_P7_MISC_X): New #define.
2876         (SPEC_BARRIER): New instantiation of BU_P7_MISC_X.
2877         * config/rs6000/rs6000.c (rs6000_expand_builtin): Handle
2878         MISC_BUILTIN_SPEC_BARRIER.
2879         (rs6000_init_builtins): Likewise.
2880         * config/rs6000/rs6000.md (UNSPECV_SPEC_BARRIER): New UNSPECV
2881         enum value.
2882         (speculation_barrier): New define_insn.
2883         * doc/extend.texi: Document __builtin_speculation_barrier.
2885 2018-01-11  Jakub Jelinek  <jakub@redhat.com>
2887         PR target/83203
2888         * config/i386/i386.c (ix86_expand_vector_init_one_nonzero): If one_var
2889         is 0, for V{8,16}S[IF] and V[48]D[IF]mode use gen_vec_set<mode>_0.
2890         * config/i386/sse.md (VI8_AVX_AVX512F, VI4F_256_512): New mode
2891         iterators.
2892         (ssescalarmodesuffix): Add 512-bit vectors.  Use "d" or "q" for
2893         integral modes instead of "ss" and "sd".
2894         (vec_set<mode>_0): New define_insns for 256-bit and 512-bit
2895         vectors with 32-bit and 64-bit elements.
2896         (vecdupssescalarmodesuffix): New mode attribute.
2897         (vec_dup<mode>): Use it.
2899 2018-01-11  H.J. Lu  <hongjiu.lu@intel.com>
2901         PR target/83330
2902         * config/i386/i386.c (ix86_compute_frame_layout): Align stack
2903         frame if argument is passed on stack.
2905 2018-01-11  Jakub Jelinek  <jakub@redhat.com>
2907         PR target/82682
2908         * ree.c (combine_reaching_defs): Optimize also
2909         reg2=exp; reg1=reg2; reg2=any_extend(reg1); into
2910         reg2=any_extend(exp); reg1=reg2;, formatting fix.
2912 2018-01-11  Jan Hubicka  <hubicka@ucw.cz>
2914         PR middle-end/83189
2915         * gimple-ssa-isolate-paths.c (isolate_path): Fix profile update.
2917 2018-01-11  Jan Hubicka  <hubicka@ucw.cz>
2919         PR middle-end/83718
2920         * tree-inline.c (copy_cfg_body): Adjust num&den for scaling
2921         after they are computed.
2923 2018-01-11  Bin Cheng  <bin.cheng@arm.com>
2925         PR tree-optimization/83695
2926         * gimple-loop-linterchange.cc
2927         (tree_loop_interchange::interchange_loops): Call scev_reset_htab to
2928         reset cached scev information after interchange.
2929         (pass_linterchange::execute): Remove call to scev_reset_htab.
2931 2018-01-11  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
2933         * config/arm/arm_neon.h (vfmlal_lane_low_u32, vfmlal_lane_high_u32,
2934         vfmlalq_laneq_low_u32, vfmlalq_lane_low_u32, vfmlal_laneq_low_u32,
2935         vfmlalq_laneq_high_u32, vfmlalq_lane_high_u32, vfmlal_laneq_high_u32,
2936         vfmlsl_lane_low_u32, vfmlsl_lane_high_u32, vfmlslq_laneq_low_u32,
2937         vfmlslq_lane_low_u32, vfmlsl_laneq_low_u32, vfmlslq_laneq_high_u32,
2938         vfmlslq_lane_high_u32, vfmlsl_laneq_high_u32): Define.
2939         * config/arm/arm_neon_builtins.def (vfmal_lane_low,
2940         vfmal_lane_lowv4hf, vfmal_lane_lowv8hf, vfmal_lane_high,
2941         vfmal_lane_highv4hf, vfmal_lane_highv8hf, vfmsl_lane_low,
2942         vfmsl_lane_lowv4hf, vfmsl_lane_lowv8hf, vfmsl_lane_high,
2943         vfmsl_lane_highv4hf, vfmsl_lane_highv8hf): New sets of builtins.
2944         * config/arm/iterators.md (VFMLSEL2, vfmlsel2): New mode attributes.
2945         (V_lane_reg): Likewise.
2946         * config/arm/neon.md (neon_vfm<vfml_op>l_lane_<vfml_half><VCVTF:mode>):
2947         New define_expand.
2948         (neon_vfm<vfml_op>l_lane_<vfml_half><vfmlsel2><mode>): Likewise.
2949         (vfmal_lane_low<mode>_intrinsic,
2950         vfmal_lane_low<vfmlsel2><mode>_intrinsic,
2951         vfmal_lane_high<vfmlsel2><mode>_intrinsic,
2952         vfmal_lane_high<mode>_intrinsic, vfmsl_lane_low<mode>_intrinsic,
2953         vfmsl_lane_low<vfmlsel2><mode>_intrinsic,
2954         vfmsl_lane_high<vfmlsel2><mode>_intrinsic,
2955         vfmsl_lane_high<mode>_intrinsic): New define_insns.
2957 2018-01-11  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
2959         * config/arm/arm-cpus.in (fp16fml): New feature.
2960         (ALL_SIMD): Add fp16fml.
2961         (armv8.2-a): Add fp16fml as an option.
2962         (armv8.3-a): Likewise.
2963         (armv8.4-a): Add fp16fml as part of fp16.
2964         * config/arm/arm.h (TARGET_FP16FML): Define.
2965         * config/arm/arm-c.c (arm_cpu_builtins): Define __ARM_FEATURE_FP16_FML
2966         when appropriate.
2967         * config/arm/arm-modes.def (V2HF): Define.
2968         * config/arm/arm_neon.h (vfmlal_low_u32, vfmlsl_low_u32,
2969         vfmlal_high_u32, vfmlsl_high_u32, vfmlalq_low_u32,
2970         vfmlslq_low_u32, vfmlalq_high_u32, vfmlslq_high_u32): Define.
2971         * config/arm/arm_neon_builtins.def (vfmal_low, vfmal_high,
2972         vfmsl_low, vfmsl_high): New set of builtins.
2973         * config/arm/iterators.md (PLUSMINUS): New code iterator.
2974         (vfml_op): New code attribute.
2975         (VFMLHALVES): New int iterator.
2976         (VFML, VFMLSEL): New mode attributes.
2977         (V_reg): Define mapping for V2HF.
2978         (V_hi, V_lo): New mode attributes.
2979         (VF_constraint): Likewise.
2980         (vfml_half, vfml_half_selector): New int attributes.
2981         * config/arm/neon.md (neon_vfm<vfml_op>l_<vfml_half><mode>): New
2982         define_expand.
2983         (vfmal_low<mode>_intrinsic, vfmsl_high<mode>_intrinsic,
2984         vfmal_high<mode>_intrinsic, vfmsl_low<mode>_intrinsic):
2985         New define_insn.
2986         * config/arm/t-arm-elf (v8_fps): Add fp16fml.
2987         * config/arm/t-multilib (v8_2_a_simd_variants): Add fp16fml.
2988         * config/arm/unspecs.md (UNSPEC_VFML_LO, UNSPEC_VFML_HI): New unspecs.
2989         * doc/invoke.texi (ARM Options): Document fp16fml.  Update armv8.4-a
2990         documentation.
2991         * doc/sourcebuild.texi (arm_fp16fml_neon_ok, arm_fp16fml_neon):
2992         Document new effective target and option set.
2994 2017-01-11  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
2996         * config/arm/arm-cpus.in (armv8_4): New feature.
2997         (ARMv8_4a): New fgroup.
2998         (armv8.4-a): New arch.
2999         * config/arm/arm-tables.opt: Regenerate.
3000         * config/arm/t-aprofile: Add matching rules for -march=armv8.4-a.
3001         * config/arm/t-arm-elf (all_v8_archs): Add armv8.4-a.
3002         * config/arm/t-multilib (v8_4_a_simd_variants): New variable.
3003         Add matching rules for -march=armv8.4-a and extensions.
3004         * doc/invoke.texi (ARM Options): Document -march=armv8.4-a.
3006 2018-01-11  Oleg Endo  <olegendo@gcc.gnu.org>
3008         PR target/81821
3009         * config/rx/rx.md (BW): New mode attribute.
3010         (sync_lock_test_and_setsi): Add mode suffix to insn output.
3012 2018-01-11  Richard Biener  <rguenther@suse.de>
3014         PR tree-optimization/83435
3015         * graphite.c (canonicalize_loop_form): Ignore fake loop exit edges.
3016         * graphite-scop-detection.c (scop_detection::get_sese): Likewise.
3017         * tree-vrp.c (add_assert_info): Drop TREE_OVERFLOW if they appear.
3019 2018-01-11  Richard Sandiford  <richard.sandiford@linaro.org>
3020             Alan Hayward  <alan.hayward@arm.com>
3021             David Sherwood  <david.sherwood@arm.com>
3023         * config/aarch64/aarch64.c (aarch64_address_info): Add a const_offset
3024         field.
3025         (aarch64_classify_address): Initialize it.  Track polynomial offsets.
3026         (aarch64_print_address_internal): Use it to check for a zero offset.
3028 2018-01-11  Richard Sandiford  <richard.sandiford@linaro.org>
3029             Alan Hayward  <alan.hayward@arm.com>
3030             David Sherwood  <david.sherwood@arm.com>
3032         * config/aarch64/aarch64-modes.def (NUM_POLY_INT_COEFFS): Set to 2.
3033         * config/aarch64/aarch64-protos.h (aarch64_initial_elimination_offset):
3034         Return a poly_int64 rather than a HOST_WIDE_INT.
3035         (aarch64_offset_7bit_signed_scaled_p): Take the offset as a poly_int64
3036         rather than a HOST_WIDE_INT.
3037         * config/aarch64/aarch64.h (aarch64_frame): Protect with
3038         HAVE_POLY_INT_H rather than HOST_WIDE_INT.  Change locals_offset,
3039         hard_fp_offset, frame_size, initial_adjust, callee_offset and
3040         final_offset from HOST_WIDE_INT to poly_int64.
3041         * config/aarch64/aarch64-builtins.c (aarch64_simd_expand_args): Use
3042         to_constant when getting the number of units in an Advanced SIMD
3043         mode.
3044         (aarch64_builtin_vectorized_function): Check for a constant number
3045         of units.
3046         * config/aarch64/aarch64-simd.md (mov<mode>): Handle polynomial
3047         GET_MODE_SIZE.
3048         (aarch64_ld<VSTRUCT:nregs>_lane<VALLDIF:mode>): Use the nunits
3049         attribute instead of GET_MODE_NUNITS.
3050         * config/aarch64/aarch64.c (aarch64_hard_regno_nregs)
3051         (aarch64_class_max_nregs): Use the constant_lowest_bound of the
3052         GET_MODE_SIZE for fixed-size registers.
3053         (aarch64_const_vec_all_same_in_range_p): Use const_vec_duplicate_p.
3054         (aarch64_hard_regno_call_part_clobbered, aarch64_classify_index)
3055         (aarch64_mode_valid_for_sched_fusion_p, aarch64_classify_address)
3056         (aarch64_legitimize_address_displacement, aarch64_secondary_reload)
3057         (aarch64_print_operand, aarch64_print_address_internal)
3058         (aarch64_address_cost, aarch64_rtx_costs, aarch64_register_move_cost)
3059         (aarch64_short_vector_p, aapcs_vfp_sub_candidate)
3060         (aarch64_simd_attr_length_rglist, aarch64_operands_ok_for_ldpstp):
3061         Handle polynomial GET_MODE_SIZE.
3062         (aarch64_hard_regno_caller_save_mode): Likewise.  Return modes
3063         wider than SImode without modification.
3064         (tls_symbolic_operand_type): Use strip_offset instead of split_const.
3065         (aarch64_pass_by_reference, aarch64_layout_arg, aarch64_pad_reg_upward)
3066         (aarch64_gimplify_va_arg_expr): Assert that we don't yet handle
3067         passing and returning SVE modes.
3068         (aarch64_function_value, aarch64_layout_arg): Use gen_int_mode
3069         rather than GEN_INT.
3070         (aarch64_emit_probe_stack_range): Take the size as a poly_int64
3071         rather than a HOST_WIDE_INT, but call sorry if it isn't constant.
3072         (aarch64_allocate_and_probe_stack_space): Likewise.
3073         (aarch64_layout_frame): Cope with polynomial offsets.
3074         (aarch64_save_callee_saves, aarch64_restore_callee_saves): Take the
3075         start_offset as a poly_int64 rather than a HOST_WIDE_INT.  Track
3076         polynomial offsets.
3077         (offset_9bit_signed_unscaled_p, offset_12bit_unsigned_scaled_p)
3078         (aarch64_offset_7bit_signed_scaled_p): Take the offset as a
3079         poly_int64 rather than a HOST_WIDE_INT.
3080         (aarch64_get_separate_components, aarch64_process_components)
3081         (aarch64_expand_prologue, aarch64_expand_epilogue)
3082         (aarch64_use_return_insn_p): Handle polynomial frame offsets.
3083         (aarch64_anchor_offset): New function, split out from...
3084         (aarch64_legitimize_address): ...here.
3085         (aarch64_builtin_vectorization_cost): Handle polynomial
3086         TYPE_VECTOR_SUBPARTS.
3087         (aarch64_simd_check_vect_par_cnst_half): Handle polynomial
3088         GET_MODE_NUNITS.
3089         (aarch64_simd_make_constant, aarch64_expand_vector_init): Get the
3090         number of elements from the PARALLEL rather than the mode.
3091         (aarch64_shift_truncation_mask): Use GET_MODE_UNIT_BITSIZE
3092         rather than GET_MODE_BITSIZE.
3093         (aarch64_evpc_trn, aarch64_evpc_uzp, aarch64_evpc_ext)
3094         (aarch64_evpc_rev, aarch64_evpc_dup, aarch64_evpc_zip)
3095         (aarch64_expand_vec_perm_const_1): Handle polynomial
3096         d->perm.length () and d->perm elements.
3097         (aarch64_evpc_tbl): Likewise.  Use nelt rather than GET_MODE_NUNITS.
3098         Apply to_constant to d->perm elements.
3099         (aarch64_simd_valid_immediate, aarch64_vec_fpconst_pow_of_2): Handle
3100         polynomial CONST_VECTOR_NUNITS.
3101         (aarch64_move_pointer): Take amount as a poly_int64 rather
3102         than an int.
3103         (aarch64_progress_pointer): Avoid temporary variable.
3104         * config/aarch64/aarch64.md (aarch64_<crc_variant>): Use
3105         the mode attribute instead of GET_MODE.
3107 2018-01-11  Richard Sandiford  <richard.sandiford@linaro.org>
3108             Alan Hayward  <alan.hayward@arm.com>
3109             David Sherwood  <david.sherwood@arm.com>
3111         * config/aarch64/aarch64.c (aarch64_force_temporary): Assert that
3112         x exists before using it.
3113         (aarch64_add_constant_internal): Rename to...
3114         (aarch64_add_offset_1): ...this.  Replace regnum with separate
3115         src and dest rtxes.  Handle the case in which they're different,
3116         including when the offset is zero.  Replace scratchreg with an rtx.
3117         Use 2 additions if there is no spare register into which we can
3118         move a 16-bit constant.
3119         (aarch64_add_constant): Delete.
3120         (aarch64_add_offset): Replace reg with separate src and dest
3121         rtxes.  Take a poly_int64 offset instead of a HOST_WIDE_INT.
3122         Use aarch64_add_offset_1.
3123         (aarch64_add_sp, aarch64_sub_sp): Take the scratch register as
3124         an rtx rather than an int.  Take the delta as a poly_int64
3125         rather than a HOST_WIDE_INT.  Use aarch64_add_offset.
3126         (aarch64_expand_mov_immediate): Update uses of aarch64_add_offset.
3127         (aarch64_expand_prologue): Update calls to aarch64_sub_sp,
3128         aarch64_allocate_and_probe_stack_space and aarch64_add_offset.
3129         (aarch64_expand_epilogue): Update calls to aarch64_add_offset
3130         and aarch64_add_sp.
3131         (aarch64_output_mi_thunk): Use aarch64_add_offset rather than
3132         aarch64_add_constant.
3134 2018-01-11  Richard Sandiford  <richard.sandiford@linaro.org>
3136         * config/aarch64/aarch64.c (aarch64_reinterpret_float_as_int):
3137         Use scalar_float_mode.
3139 2018-01-11  Richard Sandiford  <richard.sandiford@linaro.org>
3141         * config/aarch64/aarch64-simd.md
3142         (aarch64_fml<f16mac1>l<f16quad>_low<mode>): Avoid GET_MODE_NUNITS.
3143         (aarch64_fml<f16mac1>l<f16quad>_high<mode>): Likewise.
3144         (aarch64_fml<f16mac1>l_lane_lowv2sf): Likewise.
3145         (aarch64_fml<f16mac1>l_lane_highv2sf): Likewise.
3146         (aarch64_fml<f16mac1>lq_laneq_lowv4sf): Likewise.
3147         (aarch64_fml<f16mac1>lq_laneq_highv4sf): Likewise.
3148         (aarch64_fml<f16mac1>l_laneq_lowv2sf): Likewise.
3149         (aarch64_fml<f16mac1>l_laneq_highv2sf): Likewise.
3150         (aarch64_fml<f16mac1>lq_lane_lowv4sf): Likewise.
3151         (aarch64_fml<f16mac1>lq_lane_highv4sf): Likewise.
3153 2018-01-11  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>
3155         PR target/83514
3156         * config/arm/arm.c (arm_declare_function_name): Set arch_to_print if
3157         targ_options->x_arm_arch_string is non NULL.
3159 2018-01-11  Tamar Christina  <tamar.christina@arm.com>
3161         * config/aarch64/aarch64.h
3162         (AARCH64_FL_FOR_ARCH8_4): Add  AARCH64_FL_DOTPROD.
3164 2018-01-11  Sudakshina Das  <sudi.das@arm.com>
3166         PR target/82096
3167         * expmed.c (emit_store_flag_force): Swap if const op0
3168         and change VOIDmode to mode of op0.
3170 2018-01-11  Richard Sandiford  <richard.sandiford@linaro.org>
3172         PR rtl-optimization/83761
3173         * caller-save.c (replace_reg_with_saved_mem): Pass bits rather
3174         than bytes to mode_for_size.
3176 2018-01-10  Jan Hubicka  <hubicka@ucw.cz>
3178         PR middle-end/83189
3179         * gfortran.fortran-torture/compile/pr83189.f90: New testcase.
3180         * tree-ssa-loop-manip.c (tree_transform_and_unroll_loop): Handle zero
3181         profile.
3183 2018-01-10  Jan Hubicka  <hubicka@ucw.cz>
3185         PR middle-end/83575
3186         * cfgrtl.c (rtl_verify_edges): Only verify fixability of partition
3187         when in layout mode.
3188         (cfg_layout_finalize): Do not verify cfg before we are out of layout.
3189         * cfgcleanup.c (try_optimize_cfg): Only verify flow info when doing
3190         partition fixup.
3192 2018-01-10  Michael Collison  <michael.collison@arm.com>
3194         * config/aarch64/aarch64-modes.def (V2HF): New VECTOR_MODE.
3195         * config/aarch64/aarch64-option-extension.def: Add
3196         AARCH64_OPT_EXTENSION of 'fp16fml'.
3197         * config/aarch64/aarch64-c.c (aarch64_update_cpp_builtins):
3198         (__ARM_FEATURE_FP16_FML): Define if TARGET_F16FML is true.
3199         * config/aarch64/predicates.md (aarch64_lane_imm3): New predicate.
3200         * config/aarch64/constraints.md (Ui7): New constraint.
3201         * config/aarch64/iterators.md (VFMLA_W): New mode iterator.
3202         (VFMLA_SEL_W): Ditto.
3203         (f16quad): Ditto.
3204         (f16mac1): Ditto.
3205         (VFMLA16_LOW): New int iterator.
3206         (VFMLA16_HIGH): Ditto.
3207         (UNSPEC_FMLAL): New unspec.
3208         (UNSPEC_FMLSL): Ditto.
3209         (UNSPEC_FMLAL2): Ditto.
3210         (UNSPEC_FMLSL2): Ditto.
3211         (f16mac): New code attribute.
3212         * config/aarch64/aarch64-simd-builtins.def
3213         (aarch64_fmlal_lowv2sf): Ditto.
3214         (aarch64_fmlsl_lowv2sf): Ditto.
3215         (aarch64_fmlalq_lowv4sf): Ditto.
3216         (aarch64_fmlslq_lowv4sf): Ditto.
3217         (aarch64_fmlal_highv2sf): Ditto.
3218         (aarch64_fmlsl_highv2sf): Ditto.
3219         (aarch64_fmlalq_highv4sf): Ditto.
3220         (aarch64_fmlslq_highv4sf): Ditto.
3221         (aarch64_fmlal_lane_lowv2sf): Ditto.
3222         (aarch64_fmlsl_lane_lowv2sf): Ditto.
3223         (aarch64_fmlal_laneq_lowv2sf): Ditto.
3224         (aarch64_fmlsl_laneq_lowv2sf): Ditto.
3225         (aarch64_fmlalq_lane_lowv4sf): Ditto.
3226         (aarch64_fmlsl_lane_lowv4sf): Ditto.
3227         (aarch64_fmlalq_laneq_lowv4sf): Ditto.
3228         (aarch64_fmlsl_laneq_lowv4sf): Ditto.
3229         (aarch64_fmlal_lane_highv2sf): Ditto.
3230         (aarch64_fmlsl_lane_highv2sf): Ditto.
3231         (aarch64_fmlal_laneq_highv2sf): Ditto.
3232         (aarch64_fmlsl_laneq_highv2sf): Ditto.
3233         (aarch64_fmlalq_lane_highv4sf): Ditto.
3234         (aarch64_fmlsl_lane_highv4sf): Ditto.
3235         (aarch64_fmlalq_laneq_highv4sf): Ditto.
3236         (aarch64_fmlsl_laneq_highv4sf): Ditto.
3237         * config/aarch64/aarch64-simd.md:
3238         (aarch64_fml<f16mac1>l<f16quad>_low<mode>): New pattern.
3239         (aarch64_fml<f16mac1>l<f16quad>_high<mode>): Ditto.
3240         (aarch64_simd_fml<f16mac1>l<f16quad>_low<mode>): Ditto.
3241         (aarch64_simd_fml<f16mac1>l<f16quad>_high<mode>): Ditto.
3242         (aarch64_fml<f16mac1>l_lane_lowv2sf): Ditto.
3243         (aarch64_fml<f16mac1>l_lane_highv2sf): Ditto.
3244         (aarch64_simd_fml<f16mac>l_lane_lowv2sf): Ditto.
3245         (aarch64_simd_fml<f16mac>l_lane_highv2sf): Ditto.
3246         (aarch64_fml<f16mac1>lq_laneq_lowv4sf): Ditto.
3247         (aarch64_fml<f16mac1>lq_laneq_highv4sf): Ditto.
3248         (aarch64_simd_fml<f16mac>lq_laneq_lowv4sf): Ditto.
3249         (aarch64_simd_fml<f16mac>lq_laneq_highv4sf): Ditto.
3250         (aarch64_fml<f16mac1>l_laneq_lowv2sf): Ditto.
3251         (aarch64_fml<f16mac1>l_laneq_highv2sf): Ditto.
3252         (aarch64_simd_fml<f16mac>l_laneq_lowv2sf): Ditto.
3253         (aarch64_simd_fml<f16mac>l_laneq_highv2sf): Ditto.
3254         (aarch64_fml<f16mac1>lq_lane_lowv4sf): Ditto.
3255         (aarch64_fml<f16mac1>lq_lane_highv4sf): Ditto.
3256         (aarch64_simd_fml<f16mac>lq_lane_lowv4sf): Ditto.
3257         (aarch64_simd_fml<f16mac>lq_lane_highv4sf): Ditto.
3258         * config/aarch64/arm_neon.h (vfmlal_low_u32): New intrinsic.
3259         (vfmlsl_low_u32): Ditto.
3260         (vfmlalq_low_u32): Ditto.
3261         (vfmlslq_low_u32): Ditto.
3262         (vfmlal_high_u32): Ditto.
3263         (vfmlsl_high_u32): Ditto.
3264         (vfmlalq_high_u32): Ditto.
3265         (vfmlslq_high_u32): Ditto.
3266         (vfmlal_lane_low_u32): Ditto.
3267         (vfmlsl_lane_low_u32): Ditto.
3268         (vfmlal_laneq_low_u32): Ditto.
3269         (vfmlsl_laneq_low_u32): Ditto.
3270         (vfmlalq_lane_low_u32): Ditto.
3271         (vfmlslq_lane_low_u32): Ditto.
3272         (vfmlalq_laneq_low_u32): Ditto.
3273         (vfmlslq_laneq_low_u32): Ditto.
3274         (vfmlal_lane_high_u32): Ditto.
3275         (vfmlsl_lane_high_u32): Ditto.
3276         (vfmlal_laneq_high_u32): Ditto.
3277         (vfmlsl_laneq_high_u32): Ditto.
3278         (vfmlalq_lane_high_u32): Ditto.
3279         (vfmlslq_lane_high_u32): Ditto.
3280         (vfmlalq_laneq_high_u32): Ditto.
3281         (vfmlslq_laneq_high_u32): Ditto.
3282         * config/aarch64/aarch64.h (AARCH64_FL_F16SML): New flag.
3283         (AARCH64_FL_FOR_ARCH8_4): New.
3284         (AARCH64_ISA_F16FML): New ISA flag.
3285         (TARGET_F16FML): New feature flag for fp16fml.
3286         (doc/invoke.texi): Document new fp16fml option.
3288 2018-01-10  Michael Collison  <michael.collison@arm.com>
3290         * config/aarch64/aarch64-builtins.c:
3291         (aarch64_types_ternopu_imm_qualifiers, TYPES_TERNOPUI): New.
3292         * config/aarch64/aarch64-c.c (aarch64_update_cpp_builtins):
3293         (__ARM_FEATURE_SHA3): Define if TARGET_SHA3 is true.
3294         * config/aarch64/aarch64.h (AARCH64_FL_SHA3): New flags.
3295         (AARCH64_ISA_SHA3): New ISA flag.
3296         (TARGET_SHA3): New feature flag for sha3.
3297         * config/aarch64/iterators.md (sha512_op): New int attribute.
3298         (CRYPTO_SHA512): New int iterator.
3299         (UNSPEC_SHA512H): New unspec.
3300         (UNSPEC_SHA512H2): Ditto.
3301         (UNSPEC_SHA512SU0): Ditto.
3302         (UNSPEC_SHA512SU1): Ditto.
3303         * config/aarch64/aarch64-simd-builtins.def
3304         (aarch64_crypto_sha512hqv2di): New builtin.
3305         (aarch64_crypto_sha512h2qv2di): Ditto.
3306         (aarch64_crypto_sha512su0qv2di): Ditto.
3307         (aarch64_crypto_sha512su1qv2di): Ditto.
3308         (aarch64_eor3qv8hi): Ditto.
3309         (aarch64_rax1qv2di): Ditto.
3310         (aarch64_xarqv2di): Ditto.
3311         (aarch64_bcaxqv8hi): Ditto.
3312         * config/aarch64/aarch64-simd.md:
3313         (aarch64_crypto_sha512h<sha512_op>qv2di): New pattern.
3314         (aarch64_crypto_sha512su0qv2di): Ditto.
3315         (aarch64_crypto_sha512su1qv2di): Ditto.
3316         (aarch64_eor3qv8hi): Ditto.
3317         (aarch64_rax1qv2di): Ditto.
3318         (aarch64_xarqv2di): Ditto.
3319         (aarch64_bcaxqv8hi): Ditto.
3320         * config/aarch64/arm_neon.h (vsha512hq_u64): New intrinsic.
3321         (vsha512h2q_u64): Ditto.
3322         (vsha512su0q_u64): Ditto.
3323         (vsha512su1q_u64): Ditto.
3324         (veor3q_u16): Ditto.
3325         (vrax1q_u64): Ditto.
3326         (vxarq_u64): Ditto.
3327         (vbcaxq_u16): Ditto.
3328         * config/arm/types.md (crypto_sha512): New type attribute.
3329         (crypto_sha3): Ditto.
3330         (doc/invoke.texi): Document new sha3 option.
3332 2018-01-10  Michael Collison  <michael.collison@arm.com>
3334         * config/aarch64/aarch64-builtins.c:
3335         (aarch64_types_quadopu_imm_qualifiers, TYPES_QUADOPUI): New.
3336         * config/aarch64/aarch64-c.c (aarch64_update_cpp_builtins):
3337         (__ARM_FEATURE_SM3): Define if TARGET_SM4 is true.
3338         (__ARM_FEATURE_SM4): Define if TARGET_SM4 is true.
3339         * config/aarch64/aarch64.h (AARCH64_FL_SM4): New flags.
3340         (AARCH64_ISA_SM4): New ISA flag.
3341         (TARGET_SM4): New feature flag for sm4.
3342         * config/aarch64/aarch64-simd-builtins.def
3343         (aarch64_sm3ss1qv4si): Ditto.
3344         (aarch64_sm3tt1aq4si): Ditto.
3345         (aarch64_sm3tt1bq4si): Ditto.
3346         (aarch64_sm3tt2aq4si): Ditto.
3347         (aarch64_sm3tt2bq4si): Ditto.
3348         (aarch64_sm3partw1qv4si): Ditto.
3349         (aarch64_sm3partw2qv4si): Ditto.
3350         (aarch64_sm4eqv4si): Ditto.
3351         (aarch64_sm4ekeyqv4si): Ditto.
3352         * config/aarch64/aarch64-simd.md:
3353         (aarch64_sm3ss1qv4si): Ditto.
3354         (aarch64_sm3tt<sm3tt_op>qv4si): Ditto.
3355         (aarch64_sm3partw<sm3part_op>qv4si): Ditto.
3356         (aarch64_sm4eqv4si): Ditto.
3357         (aarch64_sm4ekeyqv4si): Ditto.
3358         * config/aarch64/iterators.md (sm3tt_op): New int iterator.
3359         (sm3part_op): Ditto.
3360         (CRYPTO_SM3TT): Ditto.
3361         (CRYPTO_SM3PART): Ditto.
3362         (UNSPEC_SM3SS1): New unspec.
3363         (UNSPEC_SM3TT1A): Ditto.
3364         (UNSPEC_SM3TT1B): Ditto.
3365         (UNSPEC_SM3TT2A): Ditto.
3366         (UNSPEC_SM3TT2B): Ditto.
3367         (UNSPEC_SM3PARTW1): Ditto.
3368         (UNSPEC_SM3PARTW2): Ditto.
3369         (UNSPEC_SM4E): Ditto.
3370         (UNSPEC_SM4EKEY): Ditto.
3371         * config/aarch64/constraints.md (Ui2): New constraint.
3372         * config/aarch64/predicates.md (aarch64_imm2): New predicate.
3373         * config/arm/types.md (crypto_sm3): New type attribute.
3374         (crypto_sm4): Ditto.
3375         * config/aarch64/arm_neon.h (vsm3ss1q_u32): New intrinsic.
3376         (vsm3tt1aq_u32): Ditto.
3377         (vsm3tt1bq_u32): Ditto.
3378         (vsm3tt2aq_u32): Ditto.
3379         (vsm3tt2bq_u32): Ditto.
3380         (vsm3partw1q_u32): Ditto.
3381         (vsm3partw2q_u32): Ditto.
3382         (vsm4eq_u32): Ditto.
3383         (vsm4ekeyq_u32): Ditto.
3384         (doc/invoke.texi): Document new sm4 option.
3386 2018-01-10  Michael Collison  <michael.collison@arm.com>
3388         * config/aarch64/aarch64-arches.def (armv8.4-a): New architecture.
3389         * config/aarch64/aarch64.h (AARCH64_ISA_V8_4): New ISA flag.
3390         (AARCH64_FL_FOR_ARCH8_4): New.
3391         (AARCH64_FL_V8_4): New flag.
3392         (doc/invoke.texi): Document new armv8.4-a option.
3394 2018-01-10  Michael Collison  <michael.collison@arm.com>
3396         * config/aarch64/aarch64-c.c (aarch64_update_cpp_builtins):
3397         (__ARM_FEATURE_AES): Define if TARGET_AES is true.
3398         (__ARM_FEATURE_SHA2): Define if TARGET_SHA2 is true.
3399         * config/aarch64/aarch64-option-extension.def: Add
3400         AARCH64_OPT_EXTENSION of 'sha2'.
3401         (aes): Add AARCH64_OPT_EXTENSION of 'aes'.
3402         (crypto): Disable sha2 and aes if crypto disabled.
3403         (crypto): Enable aes and sha2 if enabled.
3404         (simd): Disable sha2 and aes if simd disabled.
3405         * config/aarch64/aarch64.h (AARCH64_FL_AES, AARCH64_FL_SHA2):
3406         New flags.
3407         (AARCH64_ISA_AES, AARCH64_ISA_SHA2): New ISA flags.
3408         (TARGET_SHA2): New feature flag for sha2.
3409         (TARGET_AES): New feature flag for aes.
3410         * config/aarch64/aarch64-simd.md:
3411         (aarch64_crypto_aes<aes_op>v16qi): Make pattern
3412         conditional on TARGET_AES.
3413         (aarch64_crypto_aes<aesmc_op>v16qi): Ditto.
3414         (aarch64_crypto_sha1hsi): Make pattern conditional
3415         on TARGET_SHA2.
3416         (aarch64_crypto_sha1hv4si): Ditto.
3417         (aarch64_be_crypto_sha1hv4si): Ditto.
3418         (aarch64_crypto_sha1su1v4si): Ditto.
3419         (aarch64_crypto_sha1<sha1_op>v4si): Ditto.
3420         (aarch64_crypto_sha1su0v4si): Ditto.
3421         (aarch64_crypto_sha256h<sha256_op>v4si): Ditto.
3422         (aarch64_crypto_sha256su0v4si): Ditto.
3423         (aarch64_crypto_sha256su1v4si): Ditto.
3424         (doc/invoke.texi): Document new aes and sha2 options.
3426 2018-01-10  Martin Sebor  <msebor@redhat.com>
3428         PR tree-optimization/83781
3429         * gimple-fold.c (get_range_strlen): Avoid treating arrays of pointers
3430         as string arrays.
3432 2018-01-11  Martin Sebor  <msebor@gmail.com>
3433             Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>
3435         PR tree-optimization/83501
3436         PR tree-optimization/81703
3438         * tree-ssa-strlen.c (get_string_cst): Rename...
3439         (get_string_len): ...to this.  Handle global constants.
3440         (handle_char_store): Adjust.
3442 2018-01-10  Kito Cheng  <kito.cheng@gmail.com>
3443             Jim Wilson  <jimw@sifive.com>
3445         * config/riscv/riscv-protos.h (riscv_output_return): New.
3446         * config/riscv/riscv.c (struct machine_function): New naked_p field.
3447         (riscv_attribute_table, riscv_output_return),
3448         (riscv_handle_fndecl_attribute, riscv_naked_function_p),
3449         (riscv_allocate_stack_slots_for_args, riscv_warn_func_return): New.
3450         (riscv_compute_frame_info): Only compute frame->mask if not a naked
3451         function.
3452         (riscv_expand_prologue): Add early return for naked function.
3453         (riscv_expand_epilogue): Likewise.
3454         (riscv_function_ok_for_sibcall): Return false for naked function.
3455         (riscv_set_current_function): New.
3456         (TARGET_SET_CURRENT_FUNCTION, TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS),
3457         (TARGET_ATTRIBUTE_TABLE, TARGET_WARN_FUNC_RETURN): New.
3458         * config/riscv/riscv.md (simple_return): Call riscv_output_return.
3459         * doc/extend.texi (RISC-V Function Attributes): New.
3461 2018-01-10  Michael Meissner  <meissner@linux.vnet.ibm.com>
3463         * config/rs6000/rs6000.c (is_complex_IBM_long_double): Explicitly
3464         check for 128-bit long double before checking TCmode.
3465         * config/rs6000/rs6000.h (FLOAT128_IEEE_P): Explicitly check for
3466         128-bit long doubles before checking TFmode or TCmode.
3467         (FLOAT128_IBM_P): Likewise.
3469 2018-01-10  Martin Sebor  <msebor@redhat.com>
3471         PR tree-optimization/83671
3472         * builtins.c (c_strlen): Unconditionally return zero for the empty
3473         string.
3474         Use -Warray-bounds for warnings.
3475         * gimple-fold.c (get_range_strlen): Handle non-constant lengths
3476         for non-constant array indices with COMPONENT_REF, arrays of
3477         arrays, and pointers to arrays.
3478         (gimple_fold_builtin_strlen): Determine and set length range for
3479         non-constant character arrays.
3481 2018-01-10  Aldy Hernandez  <aldyh@redhat.com>
3483         PR middle-end/81897
3484         * tree-ssa-uninit.c (convert_control_dep_chain_into_preds): Skip
3485         empty blocks.
3487 2018-01-10  Eric Botcazou  <ebotcazou@adacore.com>
3489         * dwarf2out.c (dwarf2out_var_location): Do not pass NULL to fprintf.
3491 2018-01-10  Peter Bergner  <bergner@vnet.ibm.com>
3493         PR target/83399
3494         * config/rs6000/rs6000.c (print_operand) <'y'>: Use
3495         VECTOR_MEM_ALTIVEC_OR_VSX_P.
3496         * config/rs6000/vsx.md (*vsx_le_perm_load_<mode> for VSX_D): Use
3497         indexed_or_indirect_operand predicate.
3498         (*vsx_le_perm_load_<mode> for VSX_W): Likewise.
3499         (*vsx_le_perm_load_v8hi): Likewise.
3500         (*vsx_le_perm_load_v16qi): Likewise.
3501         (*vsx_le_perm_store_<mode> for VSX_D): Likewise.
3502         (*vsx_le_perm_store_<mode> for VSX_W): Likewise.
3503         (*vsx_le_perm_store_v8hi): Likewise.
3504         (*vsx_le_perm_store_v16qi): Likewise.
3505         (eight unnamed splitters): Likewise.
3507 2018-01-10  Peter Bergner  <bergner@vnet.ibm.com>
3509         * config/rs6000/x86intrin.h: Change #warning to #error. Update message.
3510         * config/rs6000/emmintrin.h: Likewise.
3511         * config/rs6000/mmintrin.h: Likewise.
3512         * config/rs6000/xmmintrin.h: Likewise.
3514 2018-01-10  David Malcolm  <dmalcolm@redhat.com>
3516         PR c++/43486
3517         * tree-core.h: Document EXPR_LOCATION_WRAPPER_P's usage of
3518         "public_flag".
3519         * tree.c (tree_nop_conversion): Return true for location wrapper
3520         nodes.
3521         (maybe_wrap_with_location): New function.
3522         (selftest::check_strip_nops): New function.
3523         (selftest::test_location_wrappers): New function.
3524         (selftest::tree_c_tests): Call it.
3525         * tree.h (STRIP_ANY_LOCATION_WRAPPER): New macro.
3526         (maybe_wrap_with_location): New decl.
3527         (EXPR_LOCATION_WRAPPER_P): New macro.
3528         (location_wrapper_p): New inline function.
3529         (tree_strip_any_location_wrapper): New inline function.
3531 2018-01-10  H.J. Lu  <hongjiu.lu@intel.com>
3533         PR target/83735
3534         * config/i386/i386.c (ix86_compute_frame_layout): Always adjust
3535         stack_realign_offset for the largest alignment of stack slot
3536         actually used.
3537         (ix86_find_max_used_stack_alignment): New function.
3538         (ix86_finalize_stack_frame_flags): Use it.  Set
3539         max_used_stack_alignment if we don't realign stack.
3540         * config/i386/i386.h (machine_function): Add
3541         max_used_stack_alignment.
3543 2018-01-10  Christophe Lyon  <christophe.lyon@linaro.org>
3545         * config/arm/arm.opt (-mbranch-cost): New option.
3546         * config/arm/arm.h (BRANCH_COST): Take arm_branch_cost into
3547         account.
3549 2018-01-10  Segher Boessenkool  <segher@kernel.crashing.org>
3551         PR target/83629
3552         * config/rs6000/rs6000.md (load_toc_v4_PIC_2, load_toc_v4_PIC_3b,
3553         load_toc_v4_PIC_3c): Wrap const term in CONST RTL.
3555 2018-01-10  Richard Biener  <rguenther@suse.de>
3557         PR debug/83765
3558         * dwarf2out.c (gen_subprogram_die): Hoist old_die && declaration
3559         early out so it also covers the case where we have a non-NULL
3560         origin.
3562 2018-01-10  Richard Sandiford  <richard.sandiford@linaro.org>
3564         PR tree-optimization/83753
3565         * tree-vect-stmts.c (get_group_load_store_type): Use VMAT_CONTIGUOUS
3566         for non-strided grouped accesses if the number of elements is 1.
3568 2018-01-10  Jan Hubicka  <hubicka@ucw.cz>
3570         PR target/81616
3571         * i386.c (ix86_vectorize_builtin_gather): Check TARGET_USE_GATHER.
3572         * i386.h (TARGET_USE_GATHER): Define.
3573         * x86-tune.def (X86_TUNE_USE_GATHER): New.
3575 2018-01-10  Martin Liska  <mliska@suse.cz>
3577         PR bootstrap/82831
3578         * basic-block.h (CLEANUP_NO_PARTITIONING): New define.
3579         * bb-reorder.c (pass_reorder_blocks::execute): Do not clean up
3580         partitioning.
3581         * cfgcleanup.c (try_optimize_cfg): Fix up partitioning if
3582         CLEANUP_NO_PARTITIONING is not set.
3584 2018-01-10  Richard Sandiford  <richard.sandiford@linaro.org>
3586         * doc/rtl.texi: Remove documentation of (const ...) wrappers
3587         for vectors, as a partial revert of r254296.
3588         * rtl.h (const_vec_p): Delete.
3589         (const_vec_duplicate_p): Don't test for vector CONSTs.
3590         (unwrap_const_vec_duplicate, const_vec_series_p): Likewise.
3591         * expmed.c (make_tree): Likewise.
3593         Revert:
3594         * common.md (E, F): Use CONSTANT_P instead of checking for
3595         CONST_VECTOR.
3596         * emit-rtl.c (gen_lowpart_common): Use const_vec_p instead of
3597         checking for CONST_VECTOR.
3599 2018-01-09  Jan Hubicka  <hubicka@ucw.cz>
3601         PR middle-end/83575
3602         * predict.c (force_edge_cold): Handle in more sane way edges
3603         with no prediction.
3605 2018-01-09  Carl Love  <cel@us.ibm.com>
3607         * config/rs6002/altivec.md (p8_vmrgow): Add support for V2DI, V2DF,
3608         V4SI, V4SF types.
3609         (p8_vmrgew): Add support for V2DI, V2DF, V4SF types.
3610         * config/rs6000/rs6000-builtin.def: Add definitions for FLOAT2_V2DF,
3611         VMRGEW_V2DI, VMRGEW_V2DF, VMRGEW_V4SF, VMRGOW_V4SI, VMRGOW_V4SF,
3612         VMRGOW_V2DI, VMRGOW_V2DF.  Remove definition for VMRGOW.
3613         * config/rs6000/rs6000-c.c (VSX_BUILTIN_VEC_FLOAT2,
3614         P8V_BUILTIN_VEC_VMRGEW, P8V_BUILTIN_VEC_VMRGOW):  Add definitions.
3615         * config/rs6000/rs6000-protos.h: Add extern defition for
3616         rs6000_generate_float2_double_code.
3617         * config/rs6000/rs6000.c (rs6000_generate_float2_double_code): Add
3618         function.
3619         * config/rs6000/vsx.md (vsx_xvcdpsp): Add define_insn.
3620         (float2_v2df): Add define_expand.
3622 2018-01-09  Uros Bizjak  <ubizjak@gmail.com>
3624         PR target/83628
3625         * combine.c (force_int_to_mode) <case ASHIFT>: Use mode instead of
3626         op_mode in the force_to_mode call.
3628 2018-01-09  Richard Sandiford  <richard.sandiford@linaro.org>
3630         * config/aarch64/aarch64.c (aarch64_evpc_trn): Use d.perm.series_p
3631         instead of checking each element individually.
3632         (aarch64_evpc_uzp): Likewise.
3633         (aarch64_evpc_zip): Likewise.
3634         (aarch64_evpc_ext): Likewise.
3635         (aarch64_evpc_rev): Likewise.
3636         (aarch64_evpc_dup): Test the encoding for a single duplicated element,
3637         instead of checking each element individually.  Return true without
3638         generating rtl if
3639         (aarch64_vectorize_vec_perm_const): Use all_from_input_p to test
3640         whether all selected elements come from the same input, instead of
3641         checking each element individually.  Remove calls to gen_rtx_REG,
3642         start_sequence and end_sequence and instead assert that no rtl is
3643         generated.
3645 2018-01-09  Richard Sandiford  <richard.sandiford@linaro.org>
3647         * config/aarch64/aarch64.c (aarch64_legitimate_constant_p): Fix
3648         order of HIGH and CONST checks.
3650 2018-01-09  Richard Sandiford  <richard.sandiford@linaro.org>
3652         * tree-vect-stmts.c (permute_vec_elements): Create a fresh variable
3653         if the destination isn't an SSA_NAME.
3655 2018-01-09  Richard Biener  <rguenther@suse.de>
3657         PR tree-optimization/83668
3658         * graphite.c (canonicalize_loop_closed_ssa): Add edge argument,
3659         move prologue...
3660         (canonicalize_loop_form): ... here, renamed from ...
3661         (canonicalize_loop_closed_ssa_form): ... this and amended to
3662         swap successor edges for loop exit blocks to make us use
3663         the RPO order we need for initial schedule generation.
3665 2018-01-09  Joseph Myers  <joseph@codesourcery.com>
3667         PR tree-optimization/64811
3668         * match.pd: When optimizing comparisons with Inf, avoid
3669         introducing or losing exceptions from comparisons with NaN.
3671 2018-01-09  Martin Liska  <mliska@suse.cz>
3673         PR sanitizer/82517
3674         * asan.c (shadow_mem_size): Add gcc_assert.
3676 2018-01-09  Georg-Johann Lay  <avr@gjlay.de>
3678         Don't save registers in main().
3680         PR target/83738
3681         * doc/invoke.texi (AVR Options) [-mmain-is-OS_task]: Document it.
3682         * config/avr/avr.opt (-mmain-is-OS_task): New target option.
3683         * config/avr/avr.c (avr_set_current_function): Don't error if
3684         naked, OS_task or OS_main are specified at the same time.
3685         (avr_function_ok_for_sibcall): Don't disable sibcalls for OS_task,
3686         OS_main.
3687         (avr_insert_attributes) [-mmain-is-OS_task] <main>: Add OS_task
3688         attribute.
3689         * common/config/avr/avr-common.c (avr_option_optimization_table):
3690         Switch on -mmain-is-OS_task for optimizing compilations.
3692 2018-01-09  Richard Biener  <rguenther@suse.de>
3694         PR tree-optimization/83572
3695         * graphite.c: Include cfganal.h.
3696         (graphite_transform_loops): Connect infinite loops to exit
3697         and remove fake edges at the end.
3699 2018-01-09  Jan Hubicka  <hubicka@ucw.cz>
3701         * ipa-inline.c (edge_badness): Revert accidental checkin.
3703 2018-01-09  Jan Hubicka  <hubicka@ucw.cz>
3705         PR ipa/80763
3706         * ipa-comdats.c (set_comdat_group): Only set comdat group of real
3707         symbols; not inline clones.
3709 2018-01-09  Jakub Jelinek  <jakub@redhat.com>
3711         PR target/83507
3712         * modulo-sched.c (schedule_reg_moves): Punt if we'd need to move
3713         hard registers.  Formatting fixes.
3715         PR preprocessor/83722
3716         * gcc.c (try_generate_repro): Pass
3717         &temp_stderr_files[RETRY_ICE_ATTEMPTS - 1] rather than
3718         &temp_stdout_files[RETRY_ICE_ATTEMPTS - 1] as last argument to
3719         do_report_bug.
3721 2018-01-08  Monk Chiang  <sh.chiang04@gmail.com>
3722             Kito Cheng  <kito.cheng@gmail.com>
3724         * config/riscv/riscv.c (machine_function::is_leaf): Remove field.
3725         (riscv_leaf_function_p): Delete.
3726         (riscv_function_ok_for_sibcall): Return false when TARGET_SAVE_RESTORE.
3728 2018-01-08  Aaron Sawdey  <acsawdey@linux.vnet.ibm.com>
3730         * config/rs6000/rs6000-string.c (do_load_for_compare_from_addr): New
3731         function.
3732         (do_ifelse): New function.
3733         (do_isel): New function.
3734         (do_sub3): New function.
3735         (do_add3): New function.
3736         (do_load_mask_compare): New function.
3737         (do_overlap_load_compare): New function.
3738         (expand_compare_loop): New function.
3739         (expand_block_compare): Call expand_compare_loop() when appropriate.
3740         * config/rs6000/rs6000.opt (-mblock-compare-inline-limit): Change
3741         option description.
3742         (-mblock-compare-inline-loop-limit): New option.
3744 2018-01-08  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
3746         PR target/83677
3747         * config/rs6000/altivec.md (*altivec_vpermr_<mode>_internal):
3748         Reverse order of second and third operands in first alternative.
3749         * config/rs6000/rs6000.c (rs6000_expand_vector_set): Reverse order
3750         of first and second elements in UNSPEC_VPERMR vector.
3751         (altivec_expand_vec_perm_le): Likewise.
3753 2017-01-08  Jeff Law  <law@redhat.com>
3755         PR rtl-optimizatin/81308
3756         * tree-switch-conversion.c (cfg_altered): New file scoped static.
3757         (process_switch): If group_case_labels makes a change, then set
3758         cfg_altered.
3759         (pass_convert_switch::execute): If a switch is converted, then
3760         set cfg_altered.  Return TODO_cfg_cleanup if cfg_altered is true.
3762         PR rtl-optimization/81308
3763         * recog.c (split_all_insns): Conditionally cleanup the CFG after
3764         splitting insns.
3766 2018-01-08  Vidya Praveen  <vidyapraveen@arm.com>
3768         PR target/83663 - Revert r255946
3769         * config/aarch64/aarch64.c (aarch64_expand_vector_init): Modify code
3770         generation for cases where splatting a value is not useful.
3771         * simplify-rtx.c (simplify_ternary_operation): Simplify vec_merge
3772         across a vec_duplicate and a paradoxical subreg forming a vector
3773         mode to a vec_concat.
3775 2018-01-08  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
3777         * config/arm/t-aprofile (MULTILIB_MATCHES): Add mapping rules for
3778         -march=armv8.3-a variants.
3779         * config/arm/t-multilib: Likewise.
3780         * config/arm/t-arm-elf: Likewise.  Handle dotprod extension.
3782 2018-01-08  Aaron Sawdey  <acsawdey@linux.vnet.ibm.com>
3784         * config/rs6000/rs6000.md (cceq_ior_compare): Remove * so I can use it
3785         to generate rtl.
3786         (cceq_ior_compare_complement): Give it a name so I can use it, and
3787         change boolean_or_operator predicate to boolean_operator so it can
3788         be used to generate a crand.
3789         (eqne): New code iterator.
3790         (bd/bd_neg): New code_attrs.
3791         (<bd>_<mode>): New name for ctr<mode>_internal[12] now combined into
3792         a single define_insn.
3793         (<bd>tf_<mode>): A new insn pattern for the conditional form branch
3794         decrement (bdnzt/bdnzf/bdzt/bdzf).
3795         * config/rs6000/rs6000.c (rs6000_legitimate_combined_insn): Updated
3796         with the new names of the branch decrement patterns, and added the
3797         names of the branch decrement conditional patterns.
3799 2018-01-08  Richard Biener  <rguenther@suse.de>
3801         PR tree-optimization/83563
3802         * graphite.c (canonicalize_loop_closed_ssa_form): Reset the SCEV
3803         cache.
3805 2018-01-08  Richard Biener  <rguenther@suse.de>
3807         PR middle-end/83713
3808         * convert.c (do_narrow): Properly guard TYPE_OVERFLOW_WRAPS checks.
3810 2018-01-08  Richard Biener  <rguenther@suse.de>
3812         PR tree-optimization/83685
3813         * tree-ssa-pre.c (create_expression_by_pieces): Do not insert
3814         references to abnormals.
3816 2018-01-08  Richard Biener  <rguenther@suse.de>
3818         PR lto/83719
3819         * dwarf2out.c (output_indirect_strings): Handle empty
3820         skeleton_debug_str_hash.
3821         (dwarf2out_early_finish): Index strings for -gsplit-dwarf.
3823 2018-01-08  Claudiu Zissulescu  <claziss@synopsys.com>
3825         * config/arc/arc.c (TARGET_TRAMPOLINE_ADJUST_ADDRESS): Delete.
3826         (emit_store_direct): Likewise.
3827         (arc_trampoline_adjust_address): Likewise.
3828         (arc_asm_trampoline_template): New function.
3829         (arc_initialize_trampoline): Use asm_trampoline_template.
3830         (TARGET_ASM_TRAMPOLINE_TEMPLATE): Define.
3831         * config/arc/arc.h (TRAMPOLINE_SIZE): Adjust to 16.
3832         * config/arc/arc.md (flush_icache): Delete pattern.
3834 2018-01-08  Claudiu Zissulescu  <claziss@synopsys.com>
3836         * config/arc/arc-c.def (__ARC_UNALIGNED__): New define.
3837         * config/arc/arc.h (STRICT_ALIGNMENT): Control this macro using
3838         munaligned-access.
3840 2018-01-08  Sebastian Huber  <sebastian.huber@embedded-brains.de>
3842         PR target/83681
3843         * config/epiphany/epiphany.h (make_pass_mode_switch_use): Guard
3844         by not USED_FOR_TARGET.
3845         (make_pass_resolve_sw_modes): Likewise.
3847 2018-01-08  Sebastian Huber  <sebastian.huber@embedded-brains.de>
3849         * config/nios2/nios2.h (nios2_section_threshold): Guard by not
3850         USED_FOR_TARGET.
3852 2018-01-08  Richard Biener  <rguenther@suse.de>
3854         PR middle-end/83580
3855         * tree-data-ref.c (split_constant_offset): Remove STRIP_NOPS.
3857 2018-01-08  Richard Biener  <rguenther@suse.de>
3859         PR middle-end/83517
3860         * match.pd ((t * 2) / 2) -> t): Add missing :c.
3862 2018-01-06  Aldy Hernandez  <aldyh@redhat.com>
3864         PR middle-end/81897
3865         * tree-ssa-uninit.c (compute_control_dep_chain): Do not bail on
3866         basic blocks with a small number of successors.
3867         (convert_control_dep_chain_into_preds): Improve handling of
3868         forwarder blocks.
3869         (dump_predicates): Split apart into...
3870         (dump_pred_chain): ...here...
3871         (dump_pred_info): ...and here.
3872         (can_one_predicate_be_invalidated_p): Add debugging printfs.
3873         (can_chain_union_be_invalidated_p): Improve check for invalidation
3874         of paths.
3875         (uninit_uses_cannot_happen): Avoid unnecessary if
3876         convert_control_dep_chain_into_preds yielded nothing.
3878 2018-01-06  Martin Sebor  <msebor@redhat.com>
3880         PR tree-optimization/83640
3881         * gimple-ssa-warn-restrict.c (builtin_access::builtin_access): Avoid
3882         subtracting negative offset from size.
3883         (builtin_access::overlap): Adjust offset bounds of the access to fall
3884         within the size of the object if possible.
3886 2018-01-06  Richard Sandiford  <richard.sandiford@linaro.org>
3888         PR rtl-optimization/83699
3889         * expmed.c (extract_bit_field_1): Restrict the vector usage of
3890         extract_bit_field_as_subreg to cases in which the extracted
3891         value is also a vector.
3893         * lra-constraints.c (process_alt_operands): Test for the equivalence
3894         substitutions when detecting a possible reload cycle.
3896 2018-01-06  Jakub Jelinek  <jakub@redhat.com>
3898         PR debug/83480
3899         * toplev.c (process_options): Don't enable debug_nonbind_markers_p
3900         by default if flag_selective_schedling{,2}.  Formatting fixes.
3902         PR rtl-optimization/83682
3903         * rtl.h (const_vec_duplicate_p): Only return true for VEC_DUPLICATE
3904         if it has non-VECTOR_MODE element mode.
3905         (vec_duplicate_p): Likewise.
3907         PR middle-end/83694
3908         * cfgexpand.c (expand_debug_expr): Punt if mode1 is VOIDmode
3909         and bitsize might be greater than MAX_BITSIZE_MODE_ANY_INT.
3911 2018-01-05  Jakub Jelinek  <jakub@redhat.com>
3913         PR target/83604
3914         * config/i386/i386-builtin.def
3915         (__builtin_ia32_vgf2p8affineinvqb_v64qi,
3916         __builtin_ia32_vgf2p8affineqb_v64qi, __builtin_ia32_vgf2p8mulb_v64qi):
3917         Require also OPTION_MASK_ISA_AVX512F in addition to
3918         OPTION_MASK_ISA_GFNI.
3919         (__builtin_ia32_vgf2p8affineinvqb_v16qi_mask,
3920         __builtin_ia32_vgf2p8affineqb_v16qi_mask): Require
3921         OPTION_MASK_ISA_AVX512VL instead of OPTION_MASK_ISA_SSE in addition
3922         to OPTION_MASK_ISA_GFNI.
3923         (__builtin_ia32_vgf2p8mulb_v32qi_mask): Require
3924         OPTION_MASK_ISA_AVX512VL in addition to OPTION_MASK_ISA_GFNI and
3925         OPTION_MASK_ISA_AVX512BW.
3926         (__builtin_ia32_vgf2p8mulb_v16qi_mask): Require
3927         OPTION_MASK_ISA_AVX512VL instead of OPTION_MASK_ISA_AVX512BW in
3928         addition to OPTION_MASK_ISA_GFNI.
3929         (__builtin_ia32_vgf2p8affineinvqb_v16qi,
3930         __builtin_ia32_vgf2p8affineqb_v16qi, __builtin_ia32_vgf2p8mulb_v16qi):
3931         Require OPTION_MASK_ISA_SSE2 instead of OPTION_MASK_ISA_SSE in addition
3932         to OPTION_MASK_ISA_GFNI.
3933         * config/i386/i386.c (def_builtin): Change to builtin isa/isa2 being
3934         a requirement for all ISAs rather than any of them with a few
3935         exceptions.
3936         (ix86_add_new_builtins): Clear OPTION_MASK_ISA_64BIT from isa before
3937         processing.
3938         (ix86_expand_builtin): Require all ISAs from builtin's isa and isa2
3939         bitmasks to be enabled with 3 exceptions, instead of requiring any
3940         enabled ISA with lots of exceptions.
3941         * config/i386/sse.md (vgf2p8affineinvqb_<mode><mask_name>,
3942         vgf2p8affineqb_<mode><mask_name>, vgf2p8mulb_<mode><mask_name>):
3943         Change avx512bw in isa attribute to avx512f.
3944         * config/i386/sgxintrin.h: Add license boilerplate.
3945         * config/i386/vaesintrin.h: Likewise.  Fix macro spelling __AVX512F
3946         to __AVX512F__ and __AVX512VL to __AVX512VL__.
3947         (_mm256_aesdec_epi128, _mm256_aesdeclast_epi128, _mm256_aesenc_epi128,
3948         _mm256_aesenclast_epi128): Enable temporarily avx if __AVX__ is not
3949         defined.
3950         * config/i386/gfniintrin.h (_mm_gf2p8mul_epi8,
3951         _mm_gf2p8affineinv_epi64_epi8, _mm_gf2p8affine_epi64_epi8): Enable
3952         temporarily sse2 rather than sse if not enabled already.
3954         PR target/83604
3955         * config/i386/sse.md (VI248_VLBW): Rename to ...
3956         (VI248_AVX512VL): ... this.  Don't guard V32HI with TARGET_AVX512BW.
3957         (vpshrd_<mode><mask_name>, vpshld_<mode><mask_name>,
3958         vpshrdv_<mode>, vpshrdv_<mode>_mask, vpshrdv_<mode>_maskz,
3959         vpshrdv_<mode>_maskz_1, vpshldv_<mode>, vpshldv_<mode>_mask,
3960         vpshldv_<mode>_maskz, vpshldv_<mode>_maskz_1): Use VI248_AVX512VL
3961         mode iterator instead of VI248_VLBW.
3963 2018-01-05  Jan Hubicka  <hubicka@ucw.cz>
3965         * ipa-fnsummary.c (record_modified_bb_info): Add OP.
3966         (record_modified): Skip clobbers; add debug output.
3967         (param_change_prob): Use sreal frequencies.
3969 2018-01-05  Richard Sandiford  <richard.sandiford@linaro.org>
3971         * tree-vect-data-refs.c (vect_compute_data_ref_alignment): Don't
3972         punt for user-aligned variables.
3974 2018-01-05  Richard Sandiford  <richard.sandiford@linaro.org>
3976         * tree-chrec.c (chrec_contains_symbols): Return true for
3977         POLY_INT_CST.
3979 2018-01-05  Sudakshina Das  <sudi.das@arm.com>
3981         PR target/82439
3982         * simplify-rtx.c (simplify_relational_operation_1): Add simplifications
3983         of (x|y) == x for BICS pattern.
3985 2018-01-05  Jakub Jelinek  <jakub@redhat.com>
3987         PR tree-optimization/83605
3988         * gimple-ssa-strength-reduction.c: Include tree-eh.h.
3989         (find_candidates_dom_walker::before_dom_children): Ignore stmts that
3990         can throw.
3992 2018-01-05  Sebastian Huber  <sebastian.huber@embedded-brains.de>
3994         * config.gcc (epiphany-*-elf*): Add (epiphany-*-rtems*) configuration.
3995         * config/epiphany/rtems.h: New file.
3997 2018-01-04  Jakub Jelinek  <jakub@redhat.com>
3998             Uros Bizjak  <ubizjak@gmail.com>
4000         PR target/83554
4001         * config/i386/i386.md (*<rotate_insn>hi3_1 splitter): Use
4002         QIreg_operand instead of register_operand predicate.
4003         * config/i386/i386.c (ix86_rop_should_change_byte_p,
4004         set_rop_modrm_reg_bits, ix86_mitigate_rop): Use -mmitigate-rop in
4005         comments instead of -fmitigate[-_]rop.
4007 2018-01-04  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
4009         PR bootstrap/81926
4010         * cgraphunit.c (symbol_table::compile): Switch to text_section
4011         before calling assembly_start debug hook.
4012         * run-rtl-passes.c (run_rtl_passes): Likewise.
4013         Include output.h.
4015 2018-01-04  Richard Sandiford  <richard.sandiford@linaro.org>
4017         * tree-vrp.c (extract_range_from_binary_expr_1): Check
4018         range_int_cst_p rather than !symbolic_range_p before calling
4019         extract_range_from_multiplicative_op_1.
4021 2017-01-04  Jeff Law  <law@redhat.com>
4023         * tree-ssa-math-opts.c (execute_cse_reciprocals_1): Remove
4024         redundant test in assertion.
4026 2018-01-04  Richard Sandiford  <richard.sandiford@linaro.org>
4028         * doc/rtl.texi: Document machine_mode wrapper classes.
4030 2018-01-04  Richard Sandiford  <richard.sandiford@linaro.org>
4032         * fold-const.c (fold_ternary_loc): Check tree_fits_uhwi_p before
4033         using tree_to_uhwi.
4035 2018-01-04  Richard Sandiford  <richard.sandiford@linaro.org>
4037         * tree-ssa-forwprop.c (is_combined_permutation_identity): Allow
4038         the VEC_PERM_EXPR fold to fail.
4040 2018-01-04  Jakub Jelinek  <jakub@redhat.com>
4042         PR debug/83585
4043         * bb-reorder.c (insert_section_boundary_note): Set has_bb_partition
4044         to switched_sections.
4046 2018-01-04  Richard Sandiford  <richard.sandiford@linaro.org>
4048         PR target/83680
4049         * config/arm/arm.c (arm_vectorize_vec_perm_const): Fix inverted
4050         test for d.testing.
4052 2018-01-04  Peter Bergner  <bergner@vnet.ibm.com>
4054         PR target/83387
4055         * config/rs6000/rs6000.c (rs6000_discover_homogeneous_aggregate): Do not
4056         allow arguments in FP registers if TARGET_HARD_FLOAT is false.
4058 2018-01-04  Jakub Jelinek  <jakub@redhat.com>
4060         PR debug/83666
4061         * cfgexpand.c (expand_debug_expr) <case BIT_FIELD_REF>: Punt if mode
4062         is BLKmode and bitpos not zero or mode change is needed.
4064 2018-01-04  Richard Sandiford  <richard.sandiford@linaro.org>
4066         PR target/83675
4067         * config/sparc/sparc.c (sparc_vectorize_vec_perm_const): Require
4068         TARGET_VIS2.
4070 2018-01-04  Uros Bizjak  <ubizjak@gmail.com>
4072         PR target/83628
4073         * config/alpha/alpha.md (*sadd<modesuffix>): Use ASHIFT
4074         instead of MULT rtx.  Update all corresponding splitters.
4075         (*saddl_se): Ditto.
4076         (*ssub<modesuffix>): Ditto.
4077         (*ssubl_se): Ditto.
4078         (*cmp_sadd_di): Update split patterns.
4079         (*cmp_sadd_si): Ditto.
4080         (*cmp_sadd_sidi): Ditto.
4081         (*cmp_ssub_di): Ditto.
4082         (*cmp_ssub_si): Ditto.
4083         (*cmp_ssub_sidi): Ditto.
4084         * config/alpha/predicates.md (const23_operand): New predicate.
4085         * config/alpha/alpha.c (alpha_rtx_costs) [PLUS, MINUS]:
4086         Look for ASHIFT, not MULT inner operand.
4087         (alpha_split_conditional_move): Update for *sadd<modesuffix> change.
4089 2018-01-04  Martin Liska  <mliska@suse.cz>
4091         PR gcov-profile/83669
4092         * gcov.c (output_intermediate_file): Add version to intermediate
4093         gcov file.
4094         * doc/gcov.texi: Document new field 'version' in intermediate
4095         file format. Fix location of '-k' option of gcov command.
4097 2018-01-04  Martin Liska  <mliska@suse.cz>
4099         PR ipa/82352
4100         * ipa-icf.c (sem_function::merge): Do not cross comdat boundary.
4102 2018-01-04  Jakub Jelinek  <jakub@redhat.com>
4104         * gimple-ssa-sprintf.c (parse_directive): Cast second dir.len to uhwi.
4106 2018-01-03  Martin Sebor  <msebor@redhat.com>
4108         PR tree-optimization/83655
4109         * gimple-ssa-warn-restrict.c (wrestrict_dom_walker::check_call): Avoid
4110         checking calls with invalid arguments.
4112 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
4114         * tree-vect-stmts.c (vect_get_store_rhs): New function.
4115         (vectorizable_mask_load_store): Delete.
4116         (vectorizable_call): Return false for masked loads and stores.
4117         (vectorizable_store): Handle IFN_MASK_STORE.  Use vect_get_store_rhs
4118         instead of gimple_assign_rhs1.
4119         (vectorizable_load): Handle IFN_MASK_LOAD.
4120         (vect_transform_stmt): Don't set is_store for call_vec_info_type.
4122 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
4124         * tree-vect-stmts.c (vect_build_gather_load_calls): New function,
4125         split out from..,
4126         (vectorizable_mask_load_store): ...here.
4127         (vectorizable_load): ...and here.
4129 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
4131         * tree-vect-stmts.c (vect_build_all_ones_mask)
4132         (vect_build_zero_merge_argument): New functions, split out from...
4133         (vectorizable_load): ...here.
4135 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
4137         * tree-vect-stmts.c (vect_check_store_rhs): New function,
4138         split out from...
4139         (vectorizable_mask_load_store): ...here.
4140         (vectorizable_store): ...and here.
4142 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
4144         * tree-vect-stmts.c (vect_check_load_store_mask): New function,
4145         split out from...
4146         (vectorizable_mask_load_store): ...here.
4148 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
4150         * tree-vectorizer.h (vec_load_store_type): Moved from tree-vec-stmts.c
4151         (vect_model_store_cost): Take a vec_load_store_type instead of a
4152         vect_def_type.
4153         * tree-vect-stmts.c (vec_load_store_type): Move to tree-vectorizer.h.
4154         (vect_model_store_cost): Take a vec_load_store_type instead of a
4155         vect_def_type.
4156         (vectorizable_mask_load_store): Update accordingly.
4157         (vectorizable_store): Likewise.
4158         * tree-vect-slp.c (vect_analyze_slp_cost_1): Update accordingly.
4160 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
4162         * tree-vect-loop.c (vect_transform_loop): Stub out scalar
4163         IFN_MASK_LOAD calls here rather than...
4164         * tree-vect-stmts.c (vectorizable_mask_load_store): ...here.
4166 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
4167             Alan Hayward  <alan.hayward@arm.com>
4168             David Sherwood  <david.sherwood@arm.com>
4170         * expmed.c (extract_bit_field_1): For vector extracts,
4171         fall back to extract_bit_field_as_subreg if vec_extract
4172         isn't available.
4174 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
4175             Alan Hayward  <alan.hayward@arm.com>
4176             David Sherwood  <david.sherwood@arm.com>
4178         * lra-spills.c (pseudo_reg_slot_compare): Sort slots by whether
4179         they are variable or constant sized.
4180         (assign_stack_slot_num_and_sort_pseudos): Don't reuse variable-sized
4181         slots for constant-sized data.
4183 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
4184             Alan Hayward  <alan.hayward@arm.com>
4185             David Sherwood  <david.sherwood@arm.com>
4187         * tree-vect-patterns.c (vect_recog_mask_conversion_pattern): When
4188         handling COND_EXPRs with boolean comparisons, try to find a better
4189         basis for the mask type than the boolean itself.
4191 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
4193         * doc/rtl.texi (MAX_BITSIZE_MODE_ANY_MODE): Describe how the default
4194         is calculated and how it can be overridden.
4195         * genmodes.c (max_bitsize_mode_any_mode): New variable.
4196         (create_modes): Initialize it from MAX_BITSIZE_MODE_ANY_MODE,
4197         if defined.
4198         (emit_max_int): Use it to set the output MAX_BITSIZE_MODE_ANY_MODE,
4199         if nonzero.
4201 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
4202             Alan Hayward  <alan.hayward@arm.com>
4203             David Sherwood  <david.sherwood@arm.com>
4205         * config/aarch64/aarch64-protos.h (aarch64_output_simd_mov_immediate):
4206         Remove the mode argument.
4207         (aarch64_simd_valid_immediate): Remove the mode and inverse
4208         arguments.
4209         * config/aarch64/iterators.md (bitsize): New iterator.
4210         * config/aarch64/aarch64-simd.md (*aarch64_simd_mov<mode>, and<mode>3)
4211         (ior<mode>3): Update calls to aarch64_output_simd_mov_immediate.
4212         * config/aarch64/constraints.md (Do, Db, Dn): Update calls to
4213         aarch64_simd_valid_immediate.
4214         * config/aarch64/predicates.md (aarch64_reg_or_orr_imm): Likewise.
4215         (aarch64_reg_or_bic_imm): Likewise.
4216         * config/aarch64/aarch64.c (simd_immediate_info): Replace mvn
4217         with an insn_type enum and msl with a modifier_type enum.
4218         Replace element_width with a scalar_mode.  Change the shift
4219         to unsigned int.  Add constructors for scalar_float_mode and
4220         scalar_int_mode elements.
4221         (aarch64_vect_float_const_representable_p): Delete.
4222         (aarch64_can_const_movi_rtx_p)
4223         (aarch64_simd_scalar_immediate_valid_for_move)
4224         (aarch64_simd_make_constant): Update call to
4225         aarch64_simd_valid_immediate.
4226         (aarch64_advsimd_valid_immediate_hs): New function.
4227         (aarch64_advsimd_valid_immediate): Likewise.
4228         (aarch64_simd_valid_immediate): Remove mode and inverse
4229         arguments.  Rewrite to use the above.  Use const_vec_duplicate_p
4230         to detect duplicated constants and use aarch64_float_const_zero_rtx_p
4231         and aarch64_float_const_representable_p on the result.
4232         (aarch64_output_simd_mov_immediate): Remove mode argument.
4233         Update call to aarch64_simd_valid_immediate and use of
4234         simd_immediate_info.
4235         (aarch64_output_scalar_simd_mov_immediate): Update call
4236         accordingly.
4238 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
4239             Alan Hayward  <alan.hayward@arm.com>
4240             David Sherwood  <david.sherwood@arm.com>
4242         * machmode.h (mode_precision): Prefix with CONST_MODE_PRECISION.
4243         (mode_nunits): Likewise CONST_MODE_NUNITS.
4244         * machmode.def (ADJUST_NUNITS): Document.
4245         * genmodes.c (mode_data::need_nunits_adj): New field.
4246         (blank_mode): Update accordingly.
4247         (adj_nunits): New variable.
4248         (print_maybe_const_decl): Replace CATEGORY with a NEEDS_ADJ
4249         parameter.
4250         (emit_mode_size_inline): Set need_bytesize_adj for all modes
4251         listed in adj_nunits.
4252         (emit_mode_nunits_inline): Set need_nunits_adj for all modes
4253         listed in adj_nunits.  Don't emit case statements for such modes.
4254         (emit_insn_modes_h): Emit definitions of CONST_MODE_NUNITS
4255         and CONST_MODE_PRECISION.  Make CONST_MODE_SIZE expand to
4256         nothing if adj_nunits is nonnull.
4257         (emit_mode_precision, emit_mode_nunits): Use print_maybe_const_decl.
4258         (emit_mode_unit_size, emit_mode_base_align, emit_mode_ibit)
4259         (emit_mode_fbit): Update use of print_maybe_const_decl.
4260         (emit_move_size): Likewise.  Treat the array as non-const
4261         if adj_nunits.
4262         (emit_mode_adjustments): Handle adj_nunits.
4264 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
4266         * machmode.def (VECTOR_MODES_WITH_PREFIX): Document.
4267         * genmodes.c (VECTOR_MODES_WITH_PREFIX): New macro.
4268         (VECTOR_MODES): Use it.
4269         (make_vector_modes): Take the prefix as an argument.
4271 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
4272             Alan Hayward  <alan.hayward@arm.com>
4273             David Sherwood  <david.sherwood@arm.com>
4275         * mode-classes.def (MODE_VECTOR_BOOL): New mode class.
4276         * machmode.h (INTEGRAL_MODE_P, VECTOR_MODE_P): Return true
4277         for MODE_VECTOR_BOOL.
4278         * machmode.def (VECTOR_BOOL_MODE): Document.
4279         * genmodes.c (VECTOR_BOOL_MODE): New macro.
4280         (make_vector_bool_mode): New function.
4281         (complete_mode, emit_mode_wider, emit_mode_adjustments): Handle
4282         MODE_VECTOR_BOOL.
4283         * lto-streamer-in.c (lto_input_mode_table): Likewise.
4284         * rtx-vector-builder.c (rtx_vector_builder::find_cached_value):
4285         Likewise.
4286         * stor-layout.c (int_mode_for_mode): Likewise.
4287         * tree.c (build_vector_type_for_mode): Likewise.
4288         * varasm.c (output_constant_pool_2): Likewise.
4289         * emit-rtl.c (init_emit_once): Make sure that CONST1_RTX (BImode) and
4290         CONSTM1_RTX (BImode) are the same thing.  Initialize const_tiny_rtx
4291         for MODE_VECTOR_BOOL.
4292         * expr.c (expand_expr_real_1): Use VECTOR_MODE_P instead of a list
4293         of mode class checks.
4294         * tree-vect-generic.c (expand_vector_operation): Use VECTOR_MODE_P
4295         instead of a list of mode class checks.
4296         (expand_vector_scalar_condition): Likewise.
4297         (type_for_widest_vector_mode): Handle BImode as an inner mode.
4299 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
4300             Alan Hayward  <alan.hayward@arm.com>
4301             David Sherwood  <david.sherwood@arm.com>
4303         * machmode.h (mode_size): Change from unsigned short to
4304         poly_uint16_pod.
4305         (mode_to_bytes): Return a poly_uint16 rather than an unsigned short.
4306         (GET_MODE_SIZE): Return a constant if ONLY_FIXED_SIZE_MODES,
4307         or if measurement_type is not polynomial.
4308         (fixed_size_mode::includes_p): Check for constant-sized modes.
4309         * genmodes.c (emit_mode_size_inline): Make mode_size_inline
4310         return a poly_uint16 rather than an unsigned short.
4311         (emit_mode_size): Change the type of mode_size from unsigned short
4312         to poly_uint16_pod.  Use ZERO_COEFFS for the initializer.
4313         (emit_mode_adjustments): Cope with polynomial vector sizes.
4314         * lto-streamer-in.c (lto_input_mode_table): Use bp_unpack_poly_value
4315         for GET_MODE_SIZE.
4316         * lto-streamer-out.c (lto_write_mode_table): Use bp_pack_poly_value
4317         for GET_MODE_SIZE.
4318         * auto-inc-dec.c (try_merge): Treat GET_MODE_SIZE as polynomial.
4319         * builtins.c (expand_ifn_atomic_compare_exchange_into_call): Likewise.
4320         * caller-save.c (setup_save_areas): Likewise.
4321         (replace_reg_with_saved_mem): Likewise.
4322         * calls.c (emit_library_call_value_1): Likewise.
4323         * combine-stack-adj.c (combine_stack_adjustments_for_block): Likewise.
4324         * combine.c (simplify_set, make_extraction, simplify_shift_const_1)
4325         (gen_lowpart_for_combine): Likewise.
4326         * convert.c (convert_to_integer_1): Likewise.
4327         * cse.c (equiv_constant, cse_insn): Likewise.
4328         * cselib.c (autoinc_split, cselib_hash_rtx): Likewise.
4329         (cselib_subst_to_values): Likewise.
4330         * dce.c (word_dce_process_block): Likewise.
4331         * df-problems.c (df_word_lr_mark_ref): Likewise.
4332         * dwarf2cfi.c (init_one_dwarf_reg_size): Likewise.
4333         * dwarf2out.c (multiple_reg_loc_descriptor, mem_loc_descriptor)
4334         (concat_loc_descriptor, concatn_loc_descriptor, loc_descriptor)
4335         (rtl_for_decl_location): Likewise.
4336         * emit-rtl.c (gen_highpart, widen_memory_access): Likewise.
4337         * expmed.c (extract_bit_field_1, extract_integral_bit_field): Likewise.
4338         * expr.c (emit_group_load_1, clear_storage_hints): Likewise.
4339         (emit_move_complex, emit_move_multi_word, emit_push_insn): Likewise.
4340         (expand_expr_real_1): Likewise.
4341         * function.c (assign_parm_setup_block_p, assign_parm_setup_block)
4342         (pad_below): Likewise.
4343         * gimple-fold.c (optimize_atomic_compare_exchange_p): Likewise.
4344         * gimple-ssa-store-merging.c (rhs_valid_for_store_merging_p): Likewise.
4345         * ira.c (get_subreg_tracking_sizes): Likewise.
4346         * ira-build.c (ira_create_allocno_objects): Likewise.
4347         * ira-color.c (coalesced_pseudo_reg_slot_compare): Likewise.
4348         (ira_sort_regnos_for_alter_reg): Likewise.
4349         * ira-costs.c (record_operand_costs): Likewise.
4350         * lower-subreg.c (interesting_mode_p, simplify_gen_subreg_concatn)
4351         (resolve_simple_move): Likewise.
4352         * lra-constraints.c (get_reload_reg, operands_match_p): Likewise.
4353         (process_addr_reg, simplify_operand_subreg, curr_insn_transform)
4354         (lra_constraints): Likewise.
4355         (CONST_POOL_OK_P): Reject variable-sized modes.
4356         * lra-spills.c (slot, assign_mem_slot, pseudo_reg_slot_compare)
4357         (add_pseudo_to_slot, lra_spill): Likewise.
4358         * omp-low.c (omp_clause_aligned_alignment): Likewise.
4359         * optabs-query.c (get_best_extraction_insn): Likewise.
4360         * optabs-tree.c (expand_vec_cond_expr_p): Likewise.
4361         * optabs.c (expand_vec_perm_var, expand_vec_cond_expr): Likewise.
4362         (expand_mult_highpart, valid_multiword_target_p): Likewise.
4363         * recog.c (offsettable_address_addr_space_p): Likewise.
4364         * regcprop.c (maybe_mode_change): Likewise.
4365         * reginfo.c (choose_hard_reg_mode, record_subregs_of_mode): Likewise.
4366         * regrename.c (build_def_use): Likewise.
4367         * regstat.c (dump_reg_info): Likewise.
4368         * reload.c (complex_word_subreg_p, push_reload, find_dummy_reload)
4369         (find_reloads, find_reloads_subreg_address): Likewise.
4370         * reload1.c (eliminate_regs_1): Likewise.
4371         * rtlanal.c (for_each_inc_dec_find_inc_dec, rtx_cost): Likewise.
4372         * simplify-rtx.c (avoid_constant_pool_reference): Likewise.
4373         (simplify_binary_operation_1, simplify_subreg): Likewise.
4374         * targhooks.c (default_function_arg_padding): Likewise.
4375         (default_hard_regno_nregs, default_class_max_nregs): Likewise.
4376         * tree-cfg.c (verify_gimple_assign_binary): Likewise.
4377         (verify_gimple_assign_ternary): Likewise.
4378         * tree-inline.c (estimate_move_cost): Likewise.
4379         * tree-ssa-forwprop.c (simplify_vector_constructor): Likewise.
4380         * tree-ssa-loop-ivopts.c (add_autoinc_candidates): Likewise.
4381         (get_address_cost_ainc): Likewise.
4382         * tree-vect-data-refs.c (vect_enhance_data_refs_alignment): Likewise.
4383         (vect_supportable_dr_alignment): Likewise.
4384         * tree-vect-loop.c (vect_determine_vectorization_factor): Likewise.
4385         (vectorizable_reduction): Likewise.
4386         * tree-vect-stmts.c (vectorizable_assignment, vectorizable_shift)
4387         (vectorizable_operation, vectorizable_load): Likewise.
4388         * tree.c (build_same_sized_truth_vector_type): Likewise.
4389         * valtrack.c (cleanup_auto_inc_dec): Likewise.
4390         * var-tracking.c (emit_note_insn_var_location): Likewise.
4391         * config/arc/arc.h (ASM_OUTPUT_CASE_END): Use as_a <scalar_int_mode>.
4392         (ADDR_VEC_ALIGN): Likewise.
4394 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
4395             Alan Hayward  <alan.hayward@arm.com>
4396             David Sherwood  <david.sherwood@arm.com>
4398         * machmode.h (mode_to_bits): Return a poly_uint16 rather than an
4399         unsigned short.
4400         (GET_MODE_BITSIZE): Return a constant if ONLY_FIXED_SIZE_MODES,
4401         or if measurement_type is polynomial.
4402         * calls.c (shift_return_value): Treat GET_MODE_BITSIZE as polynomial.
4403         * combine.c (make_extraction): Likewise.
4404         * dse.c (find_shift_sequence): Likewise.
4405         * dwarf2out.c (mem_loc_descriptor): Likewise.
4406         * expmed.c (store_integral_bit_field, extract_bit_field_1): Likewise.
4407         (extract_bit_field, extract_low_bits): Likewise.
4408         * expr.c (convert_move, convert_modes, emit_move_insn_1): Likewise.
4409         (optimize_bitfield_assignment_op, expand_assignment): Likewise.
4410         (store_expr_with_bounds, store_field, expand_expr_real_1): Likewise.
4411         * fold-const.c (optimize_bit_field_compare, merge_ranges): Likewise.
4412         * gimple-fold.c (optimize_atomic_compare_exchange_p): Likewise.
4413         * reload.c (find_reloads): Likewise.
4414         * reload1.c (alter_reg): Likewise.
4415         * stor-layout.c (bitwise_mode_for_mode, compute_record_mode): Likewise.
4416         * targhooks.c (default_secondary_memory_needed_mode): Likewise.
4417         * tree-if-conv.c (predicate_mem_writes): Likewise.
4418         * tree-ssa-strlen.c (handle_builtin_memcmp): Likewise.
4419         * tree-vect-patterns.c (adjust_bool_pattern): Likewise.
4420         * tree-vect-stmts.c (vectorizable_simd_clone_call): Likewise.
4421         * valtrack.c (dead_debug_insert_temp): Likewise.
4422         * varasm.c (mergeable_constant_section): Likewise.
4423         * config/sh/sh.h (LOCAL_ALIGNMENT): Use as_a <fixed_size_mode>.
4425 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
4426             Alan Hayward  <alan.hayward@arm.com>
4427             David Sherwood  <david.sherwood@arm.com>
4429         * expr.c (expand_assignment): Cope with polynomial mode sizes
4430         when assigning to a CONCAT.
4432 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
4433             Alan Hayward  <alan.hayward@arm.com>
4434             David Sherwood  <david.sherwood@arm.com>
4436         * machmode.h (mode_precision): Change from unsigned short to
4437         poly_uint16_pod.
4438         (mode_to_precision): Return a poly_uint16 rather than an unsigned
4439         short.
4440         (GET_MODE_PRECISION): Return a constant if ONLY_FIXED_SIZE_MODES,
4441         or if measurement_type is not polynomial.
4442         (HWI_COMPUTABLE_MODE_P): Turn into a function.  Optimize the case
4443         in which the mode is already known to be a scalar_int_mode.
4444         * genmodes.c (emit_mode_precision): Change the type of mode_precision
4445         from unsigned short to poly_uint16_pod.  Use ZERO_COEFFS for the
4446         initializer.
4447         * lto-streamer-in.c (lto_input_mode_table): Use bp_unpack_poly_value
4448         for GET_MODE_PRECISION.
4449         * lto-streamer-out.c (lto_write_mode_table): Use bp_pack_poly_value
4450         for GET_MODE_PRECISION.
4451         * combine.c (update_rsp_from_reg_equal): Treat GET_MODE_PRECISION
4452         as polynomial.
4453         (try_combine, find_split_point, combine_simplify_rtx): Likewise.
4454         (expand_field_assignment, make_extraction): Likewise.
4455         (make_compound_operation_int, record_dead_and_set_regs_1): Likewise.
4456         (get_last_value): Likewise.
4457         * convert.c (convert_to_integer_1): Likewise.
4458         * cse.c (cse_insn): Likewise.
4459         * expr.c (expand_expr_real_1): Likewise.
4460         * lra-constraints.c (simplify_operand_subreg): Likewise.
4461         * optabs-query.c (can_atomic_load_p): Likewise.
4462         * optabs.c (expand_atomic_load): Likewise.
4463         (expand_atomic_store): Likewise.
4464         * ree.c (combine_reaching_defs): Likewise.
4465         * rtl.h (partial_subreg_p, paradoxical_subreg_p): Likewise.
4466         * rtlanal.c (nonzero_bits1, lsb_bitfield_op_p): Likewise.
4467         * tree.h (type_has_mode_precision_p): Likewise.
4468         * ubsan.c (instrument_si_overflow): Likewise.
4470 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
4471             Alan Hayward  <alan.hayward@arm.com>
4472             David Sherwood  <david.sherwood@arm.com>
4474         * tree.h (TYPE_VECTOR_SUBPARTS): Turn into a function and handle
4475         polynomial numbers of units.
4476         (SET_TYPE_VECTOR_SUBPARTS): Likewise.
4477         (valid_vector_subparts_p): New function.
4478         (build_vector_type): Remove temporary shim and take the number
4479         of units as a poly_uint64 rather than an int.
4480         (build_opaque_vector_type): Take the number of units as a
4481         poly_uint64 rather than an int.
4482         * tree.c (build_vector_from_ctor): Handle polynomial
4483         TYPE_VECTOR_SUBPARTS.
4484         (type_hash_canon_hash, type_cache_hasher::equal): Likewise.
4485         (uniform_vector_p, vector_type_mode, build_vector): Likewise.
4486         (build_vector_from_val): If the number of units is variable,
4487         use build_vec_duplicate_cst for constant operands and
4488         VEC_DUPLICATE_EXPR otherwise.
4489         (make_vector_type): Remove temporary is_constant ().
4490         (build_vector_type, build_opaque_vector_type): Take the number of
4491         units as a poly_uint64 rather than an int.
4492         (check_vector_cst): Handle polynomial TYPE_VECTOR_SUBPARTS and
4493         VECTOR_CST_NELTS.
4494         * cfgexpand.c (expand_debug_expr): Likewise.
4495         * expr.c (count_type_elements, categorize_ctor_elements_1): Likewise.
4496         (store_constructor, expand_expr_real_1): Likewise.
4497         (const_scalar_mask_from_tree): Likewise.
4498         * fold-const-call.c (fold_const_reduction): Likewise.
4499         * fold-const.c (const_binop, const_unop, fold_convert_const): Likewise.
4500         (operand_equal_p, fold_vec_perm, fold_ternary_loc): Likewise.
4501         (native_encode_vector, vec_cst_ctor_to_array): Likewise.
4502         (fold_relational_const): Likewise.
4503         (native_interpret_vector): Likewise.  Change the size from an
4504         int to an unsigned int.
4505         * gimple-fold.c (gimple_fold_stmt_to_constant_1): Handle polynomial
4506         TYPE_VECTOR_SUBPARTS.
4507         (gimple_fold_indirect_ref, gimple_build_vector): Likewise.
4508         (gimple_build_vector_from_val): Use VEC_DUPLICATE_EXPR when
4509         duplicating a non-constant operand into a variable-length vector.
4510         * hsa-brig.c (hsa_op_immed::emit_to_buffer): Handle polynomial
4511         TYPE_VECTOR_SUBPARTS and VECTOR_CST_NELTS.
4512         * ipa-icf.c (sem_variable::equals): Likewise.
4513         * match.pd: Likewise.
4514         * omp-simd-clone.c (simd_clone_subparts): Likewise.
4515         * print-tree.c (print_node): Likewise.
4516         * stor-layout.c (layout_type): Likewise.
4517         * targhooks.c (default_builtin_vectorization_cost): Likewise.
4518         * tree-cfg.c (verify_gimple_comparison): Likewise.
4519         (verify_gimple_assign_binary): Likewise.
4520         (verify_gimple_assign_ternary): Likewise.
4521         (verify_gimple_assign_single): Likewise.
4522         * tree-pretty-print.c (dump_generic_node): Likewise.
4523         * tree-ssa-forwprop.c (simplify_vector_constructor): Likewise.
4524         (simplify_bitfield_ref, is_combined_permutation_identity): Likewise.
4525         * tree-vect-data-refs.c (vect_permute_store_chain): Likewise.
4526         (vect_grouped_load_supported, vect_permute_load_chain): Likewise.
4527         (vect_shift_permute_load_chain): Likewise.
4528         * tree-vect-generic.c (nunits_for_known_piecewise_op): Likewise.
4529         (expand_vector_condition, optimize_vector_constructor): Likewise.
4530         (lower_vec_perm, get_compute_type): Likewise.
4531         * tree-vect-loop.c (vect_determine_vectorization_factor): Likewise.
4532         (get_initial_defs_for_reduction, vect_transform_loop): Likewise.
4533         * tree-vect-patterns.c (vect_recog_bool_pattern): Likewise.
4534         (vect_recog_mask_conversion_pattern): Likewise.
4535         * tree-vect-slp.c (vect_supported_load_permutation_p): Likewise.
4536         (vect_get_constant_vectors, vect_transform_slp_perm_load): Likewise.
4537         * tree-vect-stmts.c (perm_mask_for_reverse): Likewise.
4538         (get_group_load_store_type, vectorizable_mask_load_store): Likewise.
4539         (vectorizable_bswap, simd_clone_subparts, vectorizable_assignment)
4540         (vectorizable_shift, vectorizable_operation, vectorizable_store)
4541         (vectorizable_load, vect_is_simple_cond, vectorizable_comparison)
4542         (supportable_widening_operation): Likewise.
4543         (supportable_narrowing_operation): Likewise.
4544         * tree-vector-builder.c (tree_vector_builder::binary_encoded_nelts):
4545         Likewise.
4546         * varasm.c (output_constant): Likewise.
4548 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
4549             Alan Hayward  <alan.hayward@arm.com>
4550             David Sherwood  <david.sherwood@arm.com>
4552         * tree-vect-data-refs.c (vect_permute_store_chain): Reorganize
4553         so that both the length == 3 and length != 3 cases set up their
4554         own permute vectors.  Add comments explaining why we know the
4555         number of elements is constant.
4556         (vect_permute_load_chain): Likewise.
4558 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
4559             Alan Hayward  <alan.hayward@arm.com>
4560             David Sherwood  <david.sherwood@arm.com>
4562         * machmode.h (mode_nunits): Change from unsigned char to
4563         poly_uint16_pod.
4564         (ONLY_FIXED_SIZE_MODES): New macro.
4565         (pod_mode::measurement_type, scalar_int_mode::measurement_type)
4566         (scalar_float_mode::measurement_type, scalar_mode::measurement_type)
4567         (complex_mode::measurement_type, fixed_size_mode::measurement_type):
4568         New typedefs.
4569         (mode_to_nunits): Return a poly_uint16 rather than an unsigned short.
4570         (GET_MODE_NUNITS): Return a constant if ONLY_FIXED_SIZE_MODES,
4571         or if measurement_type is not polynomial.
4572         * genmodes.c (ZERO_COEFFS): New macro.
4573         (emit_mode_nunits_inline): Make mode_nunits_inline return a
4574         poly_uint16.
4575         (emit_mode_nunits): Change the type of mode_nunits to poly_uint16_pod.
4576         Use ZERO_COEFFS when emitting initializers.
4577         * data-streamer.h (bp_pack_poly_value): New function.
4578         (bp_unpack_poly_value): Likewise.
4579         * lto-streamer-in.c (lto_input_mode_table): Use bp_unpack_poly_value
4580         for GET_MODE_NUNITS.
4581         * lto-streamer-out.c (lto_write_mode_table): Use bp_pack_poly_value
4582         for GET_MODE_NUNITS.
4583         * tree.c (make_vector_type): Remove temporary shim and make
4584         the real function take the number of units as a poly_uint64
4585         rather than an int.
4586         (build_vector_type_for_mode): Handle polynomial nunits.
4587         * dwarf2out.c (loc_descriptor, add_const_value_attribute): Likewise.
4588         * emit-rtl.c (const_vec_series_p_1): Likewise.
4589         (gen_rtx_CONST_VECTOR): Likewise.
4590         * fold-const.c (test_vec_duplicate_folding): Likewise.
4591         * genrecog.c (validate_pattern): Likewise.
4592         * optabs-query.c (can_vec_perm_var_p, can_mult_highpart_p): Likewise.
4593         * optabs-tree.c (expand_vec_cond_expr_p): Likewise.
4594         * optabs.c (expand_vector_broadcast, expand_binop_directly): Likewise.
4595         (shift_amt_for_vec_perm_mask, expand_vec_perm_var): Likewise.
4596         (expand_vec_cond_expr, expand_mult_highpart): Likewise.
4597         * rtlanal.c (subreg_get_info): Likewise.
4598         * tree-vect-data-refs.c (vect_grouped_store_supported): Likewise.
4599         (vect_grouped_load_supported): Likewise.
4600         * tree-vect-generic.c (type_for_widest_vector_mode): Likewise.
4601         * tree-vect-loop.c (have_whole_vector_shift): Likewise.
4602         * simplify-rtx.c (simplify_unary_operation_1): Likewise.
4603         (simplify_const_unary_operation, simplify_binary_operation_1)
4604         (simplify_const_binary_operation, simplify_ternary_operation)
4605         (test_vector_ops_duplicate, test_vector_ops): Likewise.
4606         (simplify_immed_subreg): Use GET_MODE_NUNITS on a fixed_size_mode
4607         instead of CONST_VECTOR_NUNITS.
4608         * varasm.c (output_constant_pool_2): Likewise.
4609         * rtx-vector-builder.c (rtx_vector_builder::build): Only include the
4610         explicit-encoded elements in the XVEC for variable-length vectors.
4612 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
4614         * lra-constraints.c (curr_insn_transform): Use partial_subreg_p.
4616 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
4617             Alan Hayward  <alan.hayward@arm.com>
4618             David Sherwood  <david.sherwood@arm.com>
4620         * coretypes.h (fixed_size_mode): Declare.
4621         (fixed_size_mode_pod): New typedef.
4622         * builtins.h (target_builtins::x_apply_args_mode)
4623         (target_builtins::x_apply_result_mode): Change type to
4624         fixed_size_mode_pod.
4625         * builtins.c (apply_args_size, apply_result_size, result_vector)
4626         (expand_builtin_apply_args_1, expand_builtin_apply)
4627         (expand_builtin_return): Update accordingly.
4629 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
4631         * cse.c (hash_rtx_cb): Hash only the encoded elements.
4632         * cselib.c (cselib_hash_rtx): Likewise.
4633         * expmed.c (make_tree): Build VECTOR_CSTs directly from the
4634         CONST_VECTOR encoding.
4636 2017-01-03  Jakub Jelinek  <jakub@redhat.com>
4637             Jeff Law  <law@redhat.com>
4639         PR target/83641
4640         * config/i386/i386.c (ix86_adjust_stack_and_probe_stack_clash): For
4641         noreturn probe, use gen_pop instead of ix86_emit_restore_reg_using_pop,
4642         only set RTX_FRAME_RELATED_P on both the push and pop if cfa_reg is sp
4643         and add REG_CFA_ADJUST_CFA notes in that case to both insns.
4645         PR target/83641
4646         * config/i386/i386.c (ix86_adjust_stack_and_probe_stack_clash): Do not
4647         explicitly probe *sp in a noreturn function if there were any callee
4648         register saves or frame pointer is needed.
4650 2018-01-03  Jakub Jelinek  <jakub@redhat.com>
4652         PR debug/83621
4653         * cfgexpand.c (expand_debug_expr): Return NULL if mode is
4654         BLKmode for ternary, binary or unary expressions.
4656         PR debug/83645
4657         * var-tracking.c (delete_vta_debug_insn): New inline function.
4658         (delete_vta_debug_insns): Add USE_CFG argument, if true, walk just
4659         insns from get_insns () to NULL instead of each bb separately.
4660         Use delete_vta_debug_insn.  No longer static.
4661         (vt_debug_insns_local, variable_tracking_main_1): Adjust
4662         delete_vta_debug_insns callers.
4663         * rtl.h (delete_vta_debug_insns): Declare.
4664         * final.c (rest_of_handle_final): Call delete_vta_debug_insns
4665         instead of variable_tracking_main.
4667 2018-01-03  Martin Sebor  <msebor@redhat.com>
4669         PR tree-optimization/83603
4670         * calls.c (maybe_warn_nonstring_arg): Avoid accessing function
4671         arguments past the endof the argument list in functions declared
4672         without a prototype.
4673         * gimple-ssa-warn-restrict.c (wrestrict_dom_walker::check_call):
4674         Avoid checking when arguments are null.
4676 2018-01-03  Martin Sebor  <msebor@redhat.com>
4678         PR c/83559
4679         * doc/extend.texi (attribute const): Fix a typo.
4680         * ipa-pure-const.c ((warn_function_const, warn_function_pure): Avoid
4681         issuing -Wsuggest-attribute for void functions.
4683 2018-01-03  Martin Sebor  <msebor@redhat.com>
4685         * gimple-ssa-warn-restrict.c (builtin_memref::builtin_memref): Use
4686         offset_int::from instead of wide_int::to_shwi.
4687         (maybe_diag_overlap): Remove assertion.
4688         Use HOST_WIDE_INT_PRINT_DEC instead of %lli.
4689         * gimple-ssa-sprintf.c (format_directive): Same.
4690         (parse_directive): Same.
4691         (sprintf_dom_walker::compute_format_length): Same.
4692         (try_substitute_return_value): Same.
4694 2017-01-03  Jeff Law  <law@redhat.com>
4696         PR middle-end/83654
4697         * explow.c (anti_adjust_stack_and_probe_stack_clash): Test a
4698         non-constant residual for zero at runtime and avoid probing in
4699         that case.  Reorganize code for trailing problem to mirror handling
4700         of the residual.
4702 2018-01-03  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>
4704         PR tree-optimization/83501
4705         * tree-ssa-strlen.c (get_string_cst): New.
4706         (handle_char_store): Call get_string_cst.
4708 2018-01-03  Martin Liska  <mliska@suse.cz>
4710         PR tree-optimization/83593
4711         * tree-ssa-strlen.c: Include tree-cfg.h.
4712         (strlen_check_and_optimize_stmt): Add new argument cleanup_eh.
4713         (strlen_dom_walker): Add new member variable m_cleanup_cfg.
4714         (strlen_dom_walker::strlen_dom_walker): Initialize m_cleanup_cfg
4715         to false.
4716         (strlen_dom_walker::before_dom_children): Call
4717         gimple_purge_dead_eh_edges. Dump tranformation with details
4718         dump flags.
4719         (strlen_dom_walker::before_dom_children): Update call by adding
4720         new argument cleanup_eh.
4721         (pass_strlen::execute): Return TODO_cleanup_cfg if needed.
4723 2018-01-03  Martin Liska  <mliska@suse.cz>
4725         PR ipa/83549
4726         * cif-code.def (VARIADIC_THUNK): New enum value.
4727         * ipa-fnsummary.c (compute_fn_summary): Do not inline variadic
4728         thunks.
4730 2018-01-03  Jan Beulich  <jbeulich@suse.com>
4732         * sse.md (mov<mode>_internal): Tighten condition for when to use
4733         vmovdqu<ssescalarsize> for TI and OI modes.
4735 2018-01-03  Jakub Jelinek  <jakub@redhat.com>
4737         Update copyright years.
4739 2018-01-03  Martin Liska  <mliska@suse.cz>
4741         PR ipa/83594
4742         * ipa-visibility.c (function_and_variable_visibility): Skip
4743         functions with noipa attribure.
4745 2018-01-03  Jakub Jelinek  <jakub@redhat.com>
4747         * gcc.c (process_command): Update copyright notice dates.
4748         * gcov-dump.c (print_version): Ditto.
4749         * gcov.c (print_version): Ditto.
4750         * gcov-tool.c (print_version): Ditto.
4751         * gengtype.c (create_file): Ditto.
4752         * doc/cpp.texi: Bump @copying's copyright year.
4753         * doc/cppinternals.texi: Ditto.
4754         * doc/gcc.texi: Ditto.
4755         * doc/gccint.texi: Ditto.
4756         * doc/gcov.texi: Ditto.
4757         * doc/install.texi: Ditto.
4758         * doc/invoke.texi: Ditto.
4760 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
4762         * vector-builder.h (vector_builder::m_full_nelts): Change from
4763         unsigned int to poly_uint64.
4764         (vector_builder::full_nelts): Update prototype accordingly.
4765         (vector_builder::new_vector): Likewise.
4766         (vector_builder::encoded_full_vector_p): Handle polynomial full_nelts.
4767         (vector_builder::operator ==): Likewise.
4768         (vector_builder::finalize): Likewise.
4769         * int-vector-builder.h (int_vector_builder::int_vector_builder):
4770         Take the number of elements as a poly_uint64 rather than an
4771         unsigned int.
4772         * vec-perm-indices.h (vec_perm_indices::m_nelts_per_input): Change
4773         from unsigned int to poly_uint64.
4774         (vec_perm_indices::vec_perm_indices): Update prototype accordingly.
4775         (vec_perm_indices::new_vector): Likewise.
4776         (vec_perm_indices::length): Likewise.
4777         (vec_perm_indices::nelts_per_input): Likewise.
4778         (vec_perm_indices::input_nelts): Likewise.
4779         * vec-perm-indices.c (vec_perm_indices::new_vector): Take the
4780         number of elements per input as a poly_uint64 rather than an
4781         unsigned int.  Use the original encoding for variable-length
4782         vectors, rather than clamping each individual element.
4783         For the second and subsequent elements in each pattern,
4784         clamp the step and base before clamping their sum.
4785         (vec_perm_indices::series_p): Handle polynomial element counts.
4786         (vec_perm_indices::all_in_range_p): Likewise.
4787         (vec_perm_indices_to_tree): Likewise.
4788         (vec_perm_indices_to_rtx): Likewise.
4789         * tree-vect-stmts.c (vect_gen_perm_mask_any): Likewise.
4790         * tree-vector-builder.c (tree_vector_builder::new_unary_operation)
4791         (tree_vector_builder::new_binary_operation): Handle polynomial
4792         element counts.  Return false if we need to know the number
4793         of elements at compile time.
4794         * fold-const.c (fold_vec_perm): Punt if the number of elements
4795         isn't known at compile time.
4797 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
4799         * vec-perm-indices.h (vec_perm_builder): Change element type
4800         from HOST_WIDE_INT to poly_int64.
4801         (vec_perm_indices::element_type): Update accordingly.
4802         (vec_perm_indices::clamp): Handle polynomial element_types.
4803         * vec-perm-indices.c (vec_perm_indices::series_p): Likewise.
4804         (vec_perm_indices::all_in_range_p): Likewise.
4805         (tree_to_vec_perm_builder): Check for poly_int64 trees rather
4806         than shwi trees.
4807         * vector-builder.h (vector_builder::stepped_sequence_p): Handle
4808         polynomial vec_perm_indices element types.
4809         * int-vector-builder.h (int_vector_builder::equal_p): Likewise.
4810         * fold-const.c (fold_vec_perm): Likewise.
4811         * optabs.c (shift_amt_for_vec_perm_mask): Likewise.
4812         * tree-vect-generic.c (lower_vec_perm): Likewise.
4813         * tree-vect-slp.c (vect_transform_slp_perm_load): Likewise.
4814         * config/aarch64/aarch64.c (aarch64_evpc_tbl): Cast d->perm
4815         element type to HOST_WIDE_INT.
4817 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
4818             Alan Hayward  <alan.hayward@arm.com>
4819             David Sherwood  <david.sherwood@arm.com>
4821         * alias.c (addr_side_effect_eval): Take the size as a poly_int64
4822         rather than an int.  Use plus_constant.
4823         (memrefs_conflict_p): Take the sizes as poly_int64s rather than ints.
4824         Take the offset "c" as a poly_int64 rather than a HOST_WIDE_INT.
4826 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
4827             Alan Hayward  <alan.hayward@arm.com>
4828             David Sherwood  <david.sherwood@arm.com>
4830         * calls.c (emit_call_1, expand_call): Change struct_value_size from
4831         a HOST_WIDE_INT to a poly_int64.
4833 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
4834             Alan Hayward  <alan.hayward@arm.com>
4835             David Sherwood  <david.sherwood@arm.com>
4837         * calls.c (load_register_parameters): Cope with polynomial
4838         mode sizes.  Require a constant size for BLKmode parameters
4839         that aren't described by a PARALLEL.  If BLOCK_REG_PADDING
4840         forces a parameter to be padded at the lsb end in order to
4841         fill a complete number of words, require the parameter size
4842         to be ordered wrt UNITS_PER_WORD.
4844 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
4845             Alan Hayward  <alan.hayward@arm.com>
4846             David Sherwood  <david.sherwood@arm.com>
4848         * reload1.c (spill_stack_slot_width): Change element type
4849         from unsigned int to poly_uint64_pod.
4850         (alter_reg): Treat mode sizes as polynomial.
4852 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
4853             Alan Hayward  <alan.hayward@arm.com>
4854             David Sherwood  <david.sherwood@arm.com>
4856         * reload.c (complex_word_subreg_p): New function.
4857         (reload_inner_reg_of_subreg, push_reload): Use it.
4859 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
4860             Alan Hayward  <alan.hayward@arm.com>
4861             David Sherwood  <david.sherwood@arm.com>
4863         * lra-constraints.c (process_alt_operands): Reject matched
4864         operands whose sizes aren't ordered.
4865         (match_reload): Refer to this check here.
4867 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
4868             Alan Hayward  <alan.hayward@arm.com>
4869             David Sherwood  <david.sherwood@arm.com>
4871         * builtins.c (expand_ifn_atomic_compare_exchange_into_call): Assert
4872         that the mode size is in the set {1, 2, 4, 8, 16}.
4874 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
4875             Alan Hayward  <alan.hayward@arm.com>
4876             David Sherwood  <david.sherwood@arm.com>
4878         * var-tracking.c (adjust_mems): Treat mode sizes as polynomial.
4879         Use plus_constant instead of gen_rtx_PLUS.
4881 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
4882             Alan Hayward  <alan.hayward@arm.com>
4883             David Sherwood  <david.sherwood@arm.com>
4885         * config/cr16/cr16-protos.h (cr16_push_rounding): Declare.
4886         * config/cr16/cr16.h (PUSH_ROUNDING): Move implementation to...
4887         * config/cr16/cr16.c (cr16_push_rounding): ...this new function.
4888         * config/h8300/h8300-protos.h (h8300_push_rounding): Declare.
4889         * config/h8300/h8300.h (PUSH_ROUNDING): Move implementation to...
4890         * config/h8300/h8300.c (h8300_push_rounding): ...this new function.
4891         * config/i386/i386-protos.h (ix86_push_rounding): Declare.
4892         * config/i386/i386.h (PUSH_ROUNDING): Move implementation to...
4893         * config/i386/i386.c (ix86_push_rounding): ...this new function.
4894         * config/m32c/m32c-protos.h (m32c_push_rounding): Take and return
4895         a poly_int64.
4896         * config/m32c/m32c.c (m32c_push_rounding): Likewise.
4897         * config/m68k/m68k-protos.h (m68k_push_rounding): Declare.
4898         * config/m68k/m68k.h (PUSH_ROUNDING): Move implementation to...
4899         * config/m68k/m68k.c (m68k_push_rounding): ...this new function.
4900         * config/pdp11/pdp11-protos.h (pdp11_push_rounding): Declare.
4901         * config/pdp11/pdp11.h (PUSH_ROUNDING): Move implementation to...
4902         * config/pdp11/pdp11.c (pdp11_push_rounding): ...this new function.
4903         * config/stormy16/stormy16-protos.h (xstormy16_push_rounding): Declare.
4904         * config/stormy16/stormy16.h (PUSH_ROUNDING): Move implementation to...
4905         * config/stormy16/stormy16.c (xstormy16_push_rounding): ...this new
4906         function.
4907         * expr.c (emit_move_resolve_push): Treat the input and result
4908         of PUSH_ROUNDING as a poly_int64.
4909         (emit_move_complex_push, emit_single_push_insn_1): Likewise.
4910         (emit_push_insn): Likewise.
4911         * lra-eliminations.c (mark_not_eliminable): Likewise.
4912         * recog.c (push_operand): Likewise.
4913         * reload1.c (elimination_effects): Likewise.
4914         * rtlanal.c (nonzero_bits1): Likewise.
4915         * calls.c (store_one_arg): Likewise.  Require the padding to be
4916         known at compile time.
4918 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
4919             Alan Hayward  <alan.hayward@arm.com>
4920             David Sherwood  <david.sherwood@arm.com>
4922         * expr.c (emit_single_push_insn_1): Treat mode sizes as polynomial.
4923         Use plus_constant instead of gen_rtx_PLUS.
4925 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
4926             Alan Hayward  <alan.hayward@arm.com>
4927             David Sherwood  <david.sherwood@arm.com>
4929         * auto-inc-dec.c (set_inc_state): Take the mode size as a poly_int64
4930         rather than an int.
4932 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
4933             Alan Hayward  <alan.hayward@arm.com>
4934             David Sherwood  <david.sherwood@arm.com>
4936         * expr.c (expand_expr_real_1): Use tree_to_poly_uint64
4937         instead of int_size_in_bytes when handling VIEW_CONVERT_EXPRs
4938         via stack temporaries.  Treat the mode size as polynomial too.
4940 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
4941             Alan Hayward  <alan.hayward@arm.com>
4942             David Sherwood  <david.sherwood@arm.com>
4944         * expr.c (expand_expr_real_2): When handling conversions involving
4945         unions, apply tree_to_poly_uint64 to the TYPE_SIZE rather than
4946         multiplying int_size_in_bytes by BITS_PER_UNIT.  Treat GET_MODE_BISIZE
4947         as a poly_uint64 too.
4949 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
4950             Alan Hayward  <alan.hayward@arm.com>
4951             David Sherwood  <david.sherwood@arm.com>
4953         * rtlanal.c (subreg_get_info): Handle polynomial mode sizes.
4955 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
4956             Alan Hayward  <alan.hayward@arm.com>
4957             David Sherwood  <david.sherwood@arm.com>
4959         * combine.c (can_change_dest_mode): Handle polynomial
4960         REGMODE_NATURAL_SIZE.
4961         * expmed.c (store_bit_field_1): Likewise.
4962         * expr.c (store_constructor): Likewise.
4963         * emit-rtl.c (validate_subreg): Operate on polynomial mode sizes
4964         and polynomial REGMODE_NATURAL_SIZE.
4965         (gen_lowpart_common): Likewise.
4966         * reginfo.c (record_subregs_of_mode): Likewise.
4967         * rtlanal.c (read_modify_subreg_p): Likewise.
4969 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
4970             Alan Hayward  <alan.hayward@arm.com>
4971             David Sherwood  <david.sherwood@arm.com>
4973         * internal-fn.c (expand_vector_ubsan_overflow): Handle polynomial
4974         numbers of elements.
4976 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
4977             Alan Hayward  <alan.hayward@arm.com>
4978             David Sherwood  <david.sherwood@arm.com>
4980         * match.pd: Cope with polynomial numbers of vector elements.
4982 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
4983             Alan Hayward  <alan.hayward@arm.com>
4984             David Sherwood  <david.sherwood@arm.com>
4986         * fold-const.c (fold_indirect_ref_1): Handle polynomial offsets
4987         in a POINTER_PLUS_EXPR.
4989 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
4990             Alan Hayward  <alan.hayward@arm.com>
4991             David Sherwood  <david.sherwood@arm.com>
4993         * omp-simd-clone.c (simd_clone_subparts): New function.
4994         (simd_clone_init_simd_arrays): Use it instead of TYPE_VECTOR_SUBPARTS.
4995         (ipa_simd_modify_function_body): Likewise.
4997 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
4998             Alan Hayward  <alan.hayward@arm.com>
4999             David Sherwood  <david.sherwood@arm.com>
5001         * tree-vect-generic.c (nunits_for_known_piecewise_op): New function.
5002         (expand_vector_piecewise): Use it instead of TYPE_VECTOR_SUBPARTS.
5003         (expand_vector_addition, add_rshift, expand_vector_divmod): Likewise.
5004         (expand_vector_condition, vector_element): Likewise.
5005         (subparts_gt): New function.
5006         (get_compute_type): Use subparts_gt.
5007         (count_type_subparts): Delete.
5008         (expand_vector_operations_1): Use subparts_gt instead of
5009         count_type_subparts.
5011 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
5012             Alan Hayward  <alan.hayward@arm.com>
5013             David Sherwood  <david.sherwood@arm.com>
5015         * tree-vect-data-refs.c (vect_no_alias_p): Replace with...
5016         (vect_compile_time_alias): ...this new function.  Do the calculation
5017         on poly_ints rather than trees.
5018         (vect_prune_runtime_alias_test_list): Update call accordingly.
5020 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
5021             Alan Hayward  <alan.hayward@arm.com>
5022             David Sherwood  <david.sherwood@arm.com>
5024         * tree-vect-slp.c (vect_build_slp_tree_1): Handle polynomial
5025         numbers of units.
5026         (vect_schedule_slp_instance): Likewise.
5028 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
5029             Alan Hayward  <alan.hayward@arm.com>
5030             David Sherwood  <david.sherwood@arm.com>
5032         * tree-vect-slp.c (vect_get_and_check_slp_defs): Reject
5033         constant and extern definitions for variable-length vectors.
5034         (vect_get_constant_vectors): Note that the number of units
5035         is known to be constant.
5037 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
5038             Alan Hayward  <alan.hayward@arm.com>
5039             David Sherwood  <david.sherwood@arm.com>
5041         * tree-vect-stmts.c (vectorizable_conversion): Treat the number
5042         of units as polynomial.  Choose between WIDE and NARROW based
5043         on multiple_p.
5045 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
5046             Alan Hayward  <alan.hayward@arm.com>
5047             David Sherwood  <david.sherwood@arm.com>
5049         * tree-vect-stmts.c (simd_clone_subparts): New function.
5050         (vectorizable_simd_clone_call): Use it instead of TYPE_VECTOR_SUBPARTS.
5052 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
5053             Alan Hayward  <alan.hayward@arm.com>
5054             David Sherwood  <david.sherwood@arm.com>
5056         * tree-vect-stmts.c (vectorizable_call): Treat the number of
5057         vectors as polynomial.  Use build_index_vector for
5058         IFN_GOMP_SIMD_LANE.
5060 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
5061             Alan Hayward  <alan.hayward@arm.com>
5062             David Sherwood  <david.sherwood@arm.com>
5064         * tree-vect-stmts.c (get_load_store_type): Treat the number of
5065         units as polynomial.  Reject VMAT_ELEMENTWISE and VMAT_STRIDED_SLP
5066         for variable-length vectors.
5067         (vectorizable_mask_load_store): Treat the number of units as
5068         polynomial, asserting that it is constant if the condition has
5069         already been enforced.
5070         (vectorizable_store, vectorizable_load): Likewise.
5072 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
5073             Alan Hayward  <alan.hayward@arm.com>
5074             David Sherwood  <david.sherwood@arm.com>
5076         * tree-vect-loop.c (vectorizable_live_operation): Treat the number
5077         of units as polynomial.  Punt if we can't tell at compile time
5078         which vector contains the final result.
5080 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
5081             Alan Hayward  <alan.hayward@arm.com>
5082             David Sherwood  <david.sherwood@arm.com>
5084         * tree-vect-loop.c (vectorizable_induction): Treat the number
5085         of units as polynomial.  Punt on SLP inductions.  Use an integer
5086         VEC_SERIES_EXPR for variable-length integer reductions.  Use a
5087         cast of such a series for variable-length floating-point
5088         reductions.
5090 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
5091             Alan Hayward  <alan.hayward@arm.com>
5092             David Sherwood  <david.sherwood@arm.com>
5094         * tree.h (build_index_vector): Declare.
5095         * tree.c (build_index_vector): New function.
5096         * tree-vect-loop.c (get_initial_defs_for_reduction): Treat the number
5097         of units as polynomial, forcibly converting it to a constant if
5098         vectorizable_reduction has already enforced the condition.
5099         (vect_create_epilog_for_reduction): Likewise.  Use build_index_vector
5100         to create a {1,2,3,...} vector.
5101         (vectorizable_reduction): Treat the number of units as polynomial.
5102         Choose vectype_in based on the largest scalar element size rather
5103         than the smallest number of units.  Enforce the restrictions
5104         relied on above.
5106 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
5107             Alan Hayward  <alan.hayward@arm.com>
5108             David Sherwood  <david.sherwood@arm.com>
5110         * tree-vect-data-refs.c (vector_alignment_reachable_p): Treat the
5111         number of units as polynomial.
5113 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
5114             Alan Hayward  <alan.hayward@arm.com>
5115             David Sherwood  <david.sherwood@arm.com>
5117         * target.h (vector_sizes, auto_vector_sizes): New typedefs.
5118         * target.def (autovectorize_vector_sizes): Return the vector sizes
5119         by pointer, using vector_sizes rather than a bitmask.
5120         * targhooks.h (default_autovectorize_vector_sizes): Update accordingly.
5121         * targhooks.c (default_autovectorize_vector_sizes): Likewise.
5122         * config/aarch64/aarch64.c (aarch64_autovectorize_vector_sizes):
5123         Likewise.
5124         * config/arc/arc.c (arc_autovectorize_vector_sizes): Likewise.
5125         * config/arm/arm.c (arm_autovectorize_vector_sizes): Likewise.
5126         * config/i386/i386.c (ix86_autovectorize_vector_sizes): Likewise.
5127         * config/mips/mips.c (mips_autovectorize_vector_sizes): Likewise.
5128         * omp-general.c (omp_max_vf): Likewise.
5129         * omp-low.c (omp_clause_aligned_alignment): Likewise.
5130         * optabs-query.c (can_vec_mask_load_store_p): Likewise.
5131         * tree-vect-loop.c (vect_analyze_loop): Likewise.
5132         * tree-vect-slp.c (vect_slp_bb): Likewise.
5133         * doc/tm.texi: Regenerate.
5134         * tree-vectorizer.h (current_vector_size): Change from an unsigned int
5135         to a poly_uint64.
5136         * tree-vect-stmts.c (get_vectype_for_scalar_type_and_size): Take
5137         the vector size as a poly_uint64 rather than an unsigned int.
5138         (current_vector_size): Change from an unsigned int to a poly_uint64.
5139         (get_vectype_for_scalar_type): Update accordingly.
5140         * tree.h (build_truth_vector_type): Take the size and number of
5141         units as a poly_uint64 rather than an unsigned int.
5142         (build_vector_type): Add a temporary overload that takes
5143         the number of units as a poly_uint64 rather than an unsigned int.
5144         * tree.c (make_vector_type): Likewise.
5145         (build_truth_vector_type): Take the number of units as a poly_uint64
5146         rather than an unsigned int.
5148 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
5149             Alan Hayward  <alan.hayward@arm.com>
5150             David Sherwood  <david.sherwood@arm.com>
5152         * target.def (get_mask_mode): Take the number of units and length
5153         as poly_uint64s rather than unsigned ints.
5154         * targhooks.h (default_get_mask_mode): Update accordingly.
5155         * targhooks.c (default_get_mask_mode): Likewise.
5156         * config/i386/i386.c (ix86_get_mask_mode): Likewise.
5157         * doc/tm.texi: Regenerate.
5159 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
5160             Alan Hayward  <alan.hayward@arm.com>
5161             David Sherwood  <david.sherwood@arm.com>
5163         * omp-general.h (omp_max_vf): Return a poly_uint64 instead of an int.
5164         * omp-general.c (omp_max_vf): Likewise.
5165         * omp-expand.c (omp_adjust_chunk_size): Update call to omp_max_vf.
5166         (expand_omp_simd): Handle polynomial safelen.
5167         * omp-low.c (omplow_simd_context): Add a default constructor.
5168         (omplow_simd_context::max_vf): Change from int to poly_uint64.
5169         (lower_rec_simd_input_clauses): Update accordingly.
5170         (lower_rec_input_clauses): Likewise.
5172 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
5173             Alan Hayward  <alan.hayward@arm.com>
5174             David Sherwood  <david.sherwood@arm.com>
5176         * tree-vectorizer.h (vect_nunits_for_cost): New function.
5177         * tree-vect-loop.c (vect_model_reduction_cost): Use it.
5178         * tree-vect-slp.c (vect_analyze_slp_cost_1): Likewise.
5179         (vect_analyze_slp_cost): Likewise.
5180         * tree-vect-stmts.c (vect_model_store_cost): Likewise.
5181         (vect_model_load_cost): Likewise.
5183 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
5184             Alan Hayward  <alan.hayward@arm.com>
5185             David Sherwood  <david.sherwood@arm.com>
5187         * tree-vect-slp.c (vect_record_max_nunits, vect_build_slp_tree_1)
5188         (vect_build_slp_tree_2, vect_build_slp_tree): Change max_nunits
5189         from an unsigned int * to a poly_uint64_pod *.
5190         (calculate_unrolling_factor): New function.
5191         (vect_analyze_slp_instance): Use it.  Track polynomial max_nunits.
5193 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
5194             Alan Hayward  <alan.hayward@arm.com>
5195             David Sherwood  <david.sherwood@arm.com>
5197         * tree-vectorizer.h (_slp_instance::unrolling_factor): Change
5198         from an unsigned int to a poly_uint64.
5199         (_loop_vec_info::slp_unrolling_factor): Likewise.
5200         (_loop_vec_info::vectorization_factor): Change from an int
5201         to a poly_uint64.
5202         (MAX_VECTORIZATION_FACTOR): Bump from 64 to INT_MAX.
5203         (vect_get_num_vectors): New function.
5204         (vect_update_max_nunits, vect_vf_for_cost): Likewise.
5205         (vect_get_num_copies): Use vect_get_num_vectors.
5206         (vect_analyze_data_ref_dependences): Change max_vf from an int *
5207         to an unsigned int *.
5208         (vect_analyze_data_refs): Change min_vf from an int * to a
5209         poly_uint64 *.
5210         (vect_transform_slp_perm_load): Take the vf as a poly_uint64 rather
5211         than an unsigned HOST_WIDE_INT.
5212         * tree-vect-data-refs.c (vect_analyze_possibly_independent_ddr)
5213         (vect_analyze_data_ref_dependence): Change max_vf from an int *
5214         to an unsigned int *.
5215         (vect_analyze_data_ref_dependences): Likewise.
5216         (vect_compute_data_ref_alignment): Handle polynomial vf.
5217         (vect_enhance_data_refs_alignment): Likewise.
5218         (vect_prune_runtime_alias_test_list): Likewise.
5219         (vect_shift_permute_load_chain): Likewise.
5220         (vect_supportable_dr_alignment): Likewise.
5221         (dependence_distance_ge_vf): Take the vectorization factor as a
5222         poly_uint64 rather than an unsigned HOST_WIDE_INT.
5223         (vect_analyze_data_refs): Change min_vf from an int * to a
5224         poly_uint64 *.
5225         * tree-vect-loop-manip.c (vect_gen_scalar_loop_niters): Take
5226         vfm1 as a poly_uint64 rather than an int.  Make the same change
5227         for the returned bound_scalar.
5228         (vect_gen_vector_loop_niters): Handle polynomial vf.
5229         (vect_do_peeling): Likewise.  Update call to
5230         vect_gen_scalar_loop_niters and handle polynomial bound_scalars.
5231         (vect_gen_vector_loop_niters_mult_vf): Assert that the vf must
5232         be constant.
5233         * tree-vect-loop.c (vect_determine_vectorization_factor)
5234         (vect_update_vf_for_slp, vect_analyze_loop_2): Handle polynomial vf.
5235         (vect_get_known_peeling_cost): Likewise.
5236         (vect_estimate_min_profitable_iters, vectorizable_reduction): Likewise.
5237         (vect_worthwhile_without_simd_p, vectorizable_induction): Likewise.
5238         (vect_transform_loop): Likewise.  Use the lowest possible VF when
5239         updating the upper bounds of the loop.
5240         (vect_min_worthwhile_factor): Make static.  Return an unsigned int
5241         rather than an int.
5242         * tree-vect-slp.c (vect_attempt_slp_rearrange_stmts): Cope with
5243         polynomial unroll factors.
5244         (vect_analyze_slp_cost_1, vect_analyze_slp_instance): Likewise.
5245         (vect_make_slp_decision): Likewise.
5246         (vect_supported_load_permutation_p): Likewise, and polynomial
5247         vf too.
5248         (vect_analyze_slp_cost): Handle polynomial vf.
5249         (vect_slp_analyze_node_operations): Likewise.
5250         (vect_slp_analyze_bb_1): Likewise.
5251         (vect_transform_slp_perm_load): Take the vf as a poly_uint64 rather
5252         than an unsigned HOST_WIDE_INT.
5253         * tree-vect-stmts.c (vectorizable_simd_clone_call, vectorizable_store)
5254         (vectorizable_load): Handle polynomial vf.
5255         * tree-vectorizer.c (simduid_to_vf::vf): Change from an int to
5256         a poly_uint64.
5257         (adjust_simduid_builtins, shrink_simd_arrays): Update accordingly.
5259 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
5260             Alan Hayward  <alan.hayward@arm.com>
5261             David Sherwood  <david.sherwood@arm.com>
5263         * match.pd: Handle bit operations involving three constants
5264         and try to fold one pair.
5266 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
5268         * tree-vect-loop-manip.c: Include gimple-fold.h.
5269         (slpeel_make_loop_iterate_ntimes): Add step, final_iv and
5270         niters_maybe_zero parameters.  Handle other cases besides a step of 1.
5271         (vect_gen_vector_loop_niters): Add a step_vector_ptr parameter.
5272         Add a path that uses a step of VF instead of 1, but disable it
5273         for now.
5274         (vect_do_peeling): Add step_vector, niters_vector_mult_vf_var
5275         and niters_no_overflow parameters.  Update calls to
5276         slpeel_make_loop_iterate_ntimes and vect_gen_vector_loop_niters.
5277         Create a new SSA name if the latter choses to use a ste other
5278         than zero, and return it via niters_vector_mult_vf_var.
5279         * tree-vect-loop.c (vect_transform_loop): Update calls to
5280         vect_do_peeling, vect_gen_vector_loop_niters and
5281         slpeel_make_loop_iterate_ntimes.
5282         * tree-vectorizer.h (slpeel_make_loop_iterate_ntimes, vect_do_peeling)
5283         (vect_gen_vector_loop_niters): Update declarations after above changes.
5285 2018-01-02  Michael Meissner  <meissner@linux.vnet.ibm.com>
5287         * config/rs6000/rs6000.md (floor<mode>2): Add support for IEEE
5288         128-bit round to integer instructions.
5289         (ceil<mode>2): Likewise.
5290         (btrunc<mode>2): Likewise.
5291         (round<mode>2): Likewise.
5293 2018-01-02  Aaron Sawdey  <acsawdey@linux.vnet.ibm.com>
5295         * config/rs6000/rs6000-string.c (expand_block_move): Allow the use of
5296         unaligned VSX load/store on P8/P9.
5297         (expand_block_clear): Allow the use of unaligned VSX
5298         load/store on P8/P9.
5300 2018-01-02  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
5302         * config/rs6000/rs6000-p8swap.c (swap_feeds_both_load_and_store):
5303         New function.
5304         (rs6000_analyze_swaps): Mark a web unoptimizable if it contains a
5305         swap associated with both a load and a store.
5307 2018-01-02  Andrew Waterman  <andrew@sifive.com>
5309         * config/riscv/linux.h (ICACHE_FLUSH_FUNC): New.
5310         * config/riscv/riscv.md (clear_cache): Use it.
5312 2018-01-02  Artyom Skrobov  <tyomitch@gmail.com>
5314         * web.c: Remove out-of-date comment.
5316 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
5318         * expr.c (fixup_args_size_notes): Check that any existing
5319         REG_ARGS_SIZE notes are correct, and don't try to re-add them.
5320         (emit_single_push_insn_1): Move stack_pointer_delta adjustment to...
5321         (emit_single_push_insn): ...here.
5323 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
5325         * rtl.h (CONST_VECTOR_ELT): Redefine to const_vector_elt.
5326         (const_vector_encoded_nelts): New function.
5327         (CONST_VECTOR_NUNITS): Redefine to use GET_MODE_NUNITS.
5328         (const_vector_int_elt, const_vector_elt): Declare.
5329         * emit-rtl.c (const_vector_int_elt_1): New function.
5330         (const_vector_elt): Likewise.
5331         * simplify-rtx.c (simplify_immed_subreg): Avoid taking the address
5332         of CONST_VECTOR_ELT.
5334 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
5336         * expr.c: Include rtx-vector-builder.h.
5337         (const_vector_mask_from_tree): Use rtx_vector_builder and operate
5338         directly on the tree encoding.
5339         (const_vector_from_tree): Likewise.
5340         * optabs.c: Include rtx-vector-builder.h.
5341         (expand_vec_perm_var): Use rtx_vector_builder and create a repeating
5342         sequence of "u" values.
5343         * vec-perm-indices.c: Include rtx-vector-builder.h.
5344         (vec_perm_indices_to_rtx): Use rtx_vector_builder and operate
5345         directly on the vec_perm_indices encoding.
5347 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
5349         * doc/rtl.texi (const_vector): Describe new encoding scheme.
5350         * Makefile.in (OBJS): Add rtx-vector-builder.o.
5351         * rtx-vector-builder.h: New file.
5352         * rtx-vector-builder.c: Likewise.
5353         * rtl.h (rtx_def::u2): Add a const_vector field.
5354         (CONST_VECTOR_NPATTERNS): New macro.
5355         (CONST_VECTOR_NELTS_PER_PATTERN): Likewise.
5356         (CONST_VECTOR_DUPLICATE_P): Likewise.
5357         (CONST_VECTOR_STEPPED_P): Likewise.
5358         (CONST_VECTOR_ENCODED_ELT): Likewise.
5359         (const_vec_duplicate_p): Check for a duplicated vector encoding.
5360         (unwrap_const_vec_duplicate): Likewise.
5361         (const_vec_series_p): Check for a non-duplicated vector encoding.
5362         Say that the function only returns true for integer vectors.
5363         * emit-rtl.c: Include rtx-vector-builder.h.
5364         (gen_const_vec_duplicate_1): Delete.
5365         (gen_const_vector): Call gen_const_vec_duplicate instead of
5366         gen_const_vec_duplicate_1.
5367         (const_vec_series_p_1): Operate directly on the CONST_VECTOR encoding.
5368         (gen_const_vec_duplicate): Use rtx_vector_builder.
5369         (gen_const_vec_series): Likewise.
5370         (gen_rtx_CONST_VECTOR): Likewise.
5371         * config/powerpcspe/powerpcspe.c: Include rtx-vector-builder.h.
5372         (swap_const_vector_halves): Take an rtx pointer rather than rtx.
5373         Build a new vector rather than modifying a CONST_VECTOR in-place.
5374         (handle_special_swappables): Update call accordingly.
5375         * config/rs6000/rs6000-p8swap.c: Include rtx-vector-builder.h.
5376         (swap_const_vector_halves): Take an rtx pointer rather than rtx.
5377         Build a new vector rather than modifying a CONST_VECTOR in-place.
5378         (handle_special_swappables): Update call accordingly.
5380 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
5382         * simplify-rtx.c (simplify_const_binary_operation): Use
5383         CONST_VECTOR_ELT instead of XVECEXP.
5385 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
5387         * tree-cfg.c (verify_gimple_assign_ternary): Allow the size of
5388         the selector elements to be different from the data elements
5389         if the selector is a VECTOR_CST.
5390         * tree-vect-stmts.c (vect_gen_perm_mask_any): Use a vector of
5391         ssizetype for the selector.
5393 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
5395         * optabs.c (shift_amt_for_vec_perm_mask): Try using series_p
5396         before testing each element individually.
5397         * tree-vect-generic.c (lower_vec_perm): Likewise.
5399 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
5401         * selftest.h (selftest::vec_perm_indices_c_tests): Declare.
5402         * selftest-run-tests.c (selftest::run_tests): Call it.
5403         * vector-builder.h (vector_builder::operator ==): New function.
5404         (vector_builder::operator !=): Likewise.
5405         * vec-perm-indices.h (vec_perm_indices::series_p): Declare.
5406         (vec_perm_indices::all_from_input_p): New function.
5407         * vec-perm-indices.c (vec_perm_indices::series_p): Likewise.
5408         (test_vec_perm_12, selftest::vec_perm_indices_c_tests): Likewise.
5409         * fold-const.c (fold_ternary_loc): Use tree_to_vec_perm_builder
5410         instead of reading the VECTOR_CST directly.  Detect whether both
5411         vector inputs are the same before constructing the vec_perm_indices,
5412         and update the number of inputs argument accordingly.  Use the
5413         utility functions added above.  Only construct sel2 if we need to.
5415 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
5417         * optabs.c (expand_vec_perm_var): Use an explicit encoding for
5418         the broadcast of the low byte.
5419         (expand_mult_highpart): Use an explicit encoding for the permutes.
5420         * optabs-query.c (can_mult_highpart_p): Likewise.
5421         * tree-vect-loop.c (calc_vec_perm_mask_for_shift): Likewise.
5422         * tree-vect-stmts.c (perm_mask_for_reverse): Likewise.
5423         (vectorizable_bswap): Likewise.
5424         * tree-vect-data-refs.c (vect_grouped_store_supported): Use an
5425         explicit encoding for the power-of-2 permutes.
5426         (vect_permute_store_chain): Likewise.
5427         (vect_grouped_load_supported): Likewise.
5428         (vect_permute_load_chain): Likewise.
5430 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
5432         * vec-perm-indices.h (vec_perm_indices_to_tree): Declare.
5433         * vec-perm-indices.c (vec_perm_indices_to_tree): New function.
5434         * tree-ssa-forwprop.c (simplify_vector_constructor): Use it.
5435         * tree-vect-slp.c (vect_transform_slp_perm_load): Likewise.
5436         * tree-vect-stmts.c (vectorizable_bswap): Likewise.
5437         (vect_gen_perm_mask_any): Likewise.
5439 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
5441         * int-vector-builder.h: New file.
5442         * vec-perm-indices.h: Include int-vector-builder.h.
5443         (vec_perm_indices): Redefine as an int_vector_builder.
5444         (auto_vec_perm_indices): Delete.
5445         (vec_perm_builder): Redefine as a stand-alone class.
5446         (vec_perm_indices::vec_perm_indices): New function.
5447         (vec_perm_indices::clamp): Likewise.
5448         * vec-perm-indices.c: Include fold-const.h and tree-vector-builder.h.
5449         (vec_perm_indices::new_vector): New function.
5450         (vec_perm_indices::new_expanded_vector): Update for new
5451         vec_perm_indices class.
5452         (vec_perm_indices::rotate_inputs): New function.
5453         (vec_perm_indices::all_in_range_p): Operate directly on the
5454         encoded form, without computing elided elements.
5455         (tree_to_vec_perm_builder): Operate directly on the VECTOR_CST
5456         encoding.  Update for new vec_perm_indices class.
5457         * optabs.c (expand_vec_perm_const): Create a vec_perm_indices for
5458         the given vec_perm_builder.
5459         (expand_vec_perm_var): Update vec_perm_builder constructor.
5460         (expand_mult_highpart): Use vec_perm_builder instead of
5461         auto_vec_perm_indices.
5462         * optabs-query.c (can_mult_highpart_p): Use vec_perm_builder and
5463         vec_perm_indices instead of auto_vec_perm_indices.  Use a single
5464         or double series encoding as appropriate.
5465         * fold-const.c (fold_ternary_loc): Use vec_perm_builder and
5466         vec_perm_indices instead of auto_vec_perm_indices.
5467         * tree-ssa-forwprop.c (simplify_vector_constructor): Likewise.
5468         * tree-vect-data-refs.c (vect_grouped_store_supported): Likewise.
5469         (vect_permute_store_chain): Likewise.
5470         (vect_grouped_load_supported): Likewise.
5471         (vect_permute_load_chain): Likewise.
5472         (vect_shift_permute_load_chain): Likewise.
5473         * tree-vect-slp.c (vect_build_slp_tree_1): Likewise.
5474         (vect_transform_slp_perm_load): Likewise.
5475         (vect_schedule_slp_instance): Likewise.
5476         * tree-vect-stmts.c (perm_mask_for_reverse): Likewise.
5477         (vectorizable_mask_load_store): Likewise.
5478         (vectorizable_bswap): Likewise.
5479         (vectorizable_store): Likewise.
5480         (vectorizable_load): Likewise.
5481         * tree-vect-generic.c (lower_vec_perm): Use vec_perm_builder and
5482         vec_perm_indices instead of auto_vec_perm_indices.  Use
5483         tree_to_vec_perm_builder to read the vector from a tree.
5484         * tree-vect-loop.c (calc_vec_perm_mask_for_shift): Take a
5485         vec_perm_builder instead of a vec_perm_indices.
5486         (have_whole_vector_shift): Use vec_perm_builder and
5487         vec_perm_indices instead of auto_vec_perm_indices.  Leave the
5488         truncation to calc_vec_perm_mask_for_shift.
5489         (vect_create_epilog_for_reduction): Likewise.
5490         * config/aarch64/aarch64.c (expand_vec_perm_d::perm): Change
5491         from auto_vec_perm_indices to vec_perm_indices.
5492         (aarch64_expand_vec_perm_const_1): Use rotate_inputs on d.perm
5493         instead of changing individual elements.
5494         (aarch64_vectorize_vec_perm_const): Use new_vector to install
5495         the vector in d.perm.
5496         * config/arm/arm.c (expand_vec_perm_d::perm): Change
5497         from auto_vec_perm_indices to vec_perm_indices.
5498         (arm_expand_vec_perm_const_1): Use rotate_inputs on d.perm
5499         instead of changing individual elements.
5500         (arm_vectorize_vec_perm_const): Use new_vector to install
5501         the vector in d.perm.
5502         * config/powerpcspe/powerpcspe.c (rs6000_expand_extract_even):
5503         Update vec_perm_builder constructor.
5504         (rs6000_expand_interleave): Likewise.
5505         * config/rs6000/rs6000.c (rs6000_expand_extract_even): Likewise.
5506         (rs6000_expand_interleave): Likewise.
5508 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
5510         * optabs-query.c (can_vec_perm_var_p): Check whether lowering
5511         to qimode could truncate the indices.
5512         * optabs.c (expand_vec_perm_var): Likewise.
5514 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
5516         * Makefile.in (OBJS): Add vec-perm-indices.o.
5517         * vec-perm-indices.h: New file.
5518         * vec-perm-indices.c: Likewise.
5519         * target.h (vec_perm_indices): Replace with a forward class
5520         declaration.
5521         (auto_vec_perm_indices): Move to vec-perm-indices.h.
5522         * optabs.h: Include vec-perm-indices.h.
5523         (expand_vec_perm): Delete.
5524         (selector_fits_mode_p, expand_vec_perm_var): Declare.
5525         (expand_vec_perm_const): Declare.
5526         * target.def (vec_perm_const_ok): Replace with...
5527         (vec_perm_const): ...this new hook.
5528         * doc/tm.texi.in (TARGET_VECTORIZE_VEC_PERM_CONST_OK): Replace with...
5529         (TARGET_VECTORIZE_VEC_PERM_CONST): ...this new hook.
5530         * doc/tm.texi: Regenerate.
5531         * optabs.def (vec_perm_const): Delete.
5532         * doc/md.texi (vec_perm_const): Likewise.
5533         (vec_perm): Refer to TARGET_VECTORIZE_VEC_PERM_CONST.
5534         * expr.c (expand_expr_real_2): Use expand_vec_perm_const rather than
5535         expand_vec_perm for constant permutation vectors.  Assert that
5536         the mode of variable permutation vectors is the integer equivalent
5537         of the mode that is being permuted.
5538         * optabs-query.h (selector_fits_mode_p): Declare.
5539         * optabs-query.c: Include vec-perm-indices.h.
5540         (selector_fits_mode_p): New function.
5541         (can_vec_perm_const_p): Check whether targetm.vectorize.vec_perm_const
5542         is defined, instead of checking whether the vec_perm_const_optab
5543         exists.  Use targetm.vectorize.vec_perm_const instead of
5544         targetm.vectorize.vec_perm_const_ok.  Check whether the indices
5545         fit in the vector mode before using a variable permute.
5546         * optabs.c (shift_amt_for_vec_perm_mask): Take a mode and a
5547         vec_perm_indices instead of an rtx.
5548         (expand_vec_perm): Replace with...
5549         (expand_vec_perm_const): ...this new function.  Take the selector
5550         as a vec_perm_indices rather than an rtx.  Also take the mode of
5551         the selector.  Update call to shift_amt_for_vec_perm_mask.
5552         Use targetm.vectorize.vec_perm_const instead of vec_perm_const_optab.
5553         Use vec_perm_indices::new_expanded_vector to expand the original
5554         selector into bytes.  Check whether the indices fit in the vector
5555         mode before using a variable permute.
5556         (expand_vec_perm_var): Make global.
5557         (expand_mult_highpart): Use expand_vec_perm_const.
5558         * fold-const.c: Includes vec-perm-indices.h.
5559         * tree-ssa-forwprop.c: Likewise.
5560         * tree-vect-data-refs.c: Likewise.
5561         * tree-vect-generic.c: Likewise.
5562         * tree-vect-loop.c: Likewise.
5563         * tree-vect-slp.c: Likewise.
5564         * tree-vect-stmts.c: Likewise.
5565         * config/aarch64/aarch64-protos.h (aarch64_expand_vec_perm_const):
5566         Delete.
5567         * config/aarch64/aarch64-simd.md (vec_perm_const<mode>): Delete.
5568         * config/aarch64/aarch64.c (aarch64_expand_vec_perm_const)
5569         (aarch64_vectorize_vec_perm_const_ok): Fuse into...
5570         (aarch64_vectorize_vec_perm_const): ...this new function.
5571         (TARGET_VECTORIZE_VEC_PERM_CONST_OK): Delete.
5572         (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
5573         * config/arm/arm-protos.h (arm_expand_vec_perm_const): Delete.
5574         * config/arm/vec-common.md (vec_perm_const<mode>): Delete.
5575         * config/arm/arm.c (TARGET_VECTORIZE_VEC_PERM_CONST_OK): Delete.
5576         (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
5577         (arm_expand_vec_perm_const, arm_vectorize_vec_perm_const_ok): Merge
5578         into...
5579         (arm_vectorize_vec_perm_const): ...this new function.  Explicitly
5580         check for NEON modes.
5581         * config/i386/i386-protos.h (ix86_expand_vec_perm_const): Delete.
5582         * config/i386/sse.md (VEC_PERM_CONST, vec_perm_const<mode>): Delete.
5583         * config/i386/i386.c (ix86_expand_vec_perm_const_1): Update comment.
5584         (ix86_expand_vec_perm_const, ix86_vectorize_vec_perm_const_ok): Merge
5585         into...
5586         (ix86_vectorize_vec_perm_const): ...this new function.  Incorporate
5587         the old VEC_PERM_CONST conditions.
5588         * config/ia64/ia64-protos.h (ia64_expand_vec_perm_const): Delete.
5589         * config/ia64/vect.md (vec_perm_const<mode>): Delete.
5590         * config/ia64/ia64.c (ia64_expand_vec_perm_const)
5591         (ia64_vectorize_vec_perm_const_ok): Merge into...
5592         (ia64_vectorize_vec_perm_const): ...this new function.
5593         * config/mips/loongson.md (vec_perm_const<mode>): Delete.
5594         * config/mips/mips-msa.md (vec_perm_const<mode>): Delete.
5595         * config/mips/mips-ps-3d.md (vec_perm_constv2sf): Delete.
5596         * config/mips/mips-protos.h (mips_expand_vec_perm_const): Delete.
5597         * config/mips/mips.c (mips_expand_vec_perm_const)
5598         (mips_vectorize_vec_perm_const_ok): Merge into...
5599         (mips_vectorize_vec_perm_const): ...this new function.
5600         * config/powerpcspe/altivec.md (vec_perm_constv16qi): Delete.
5601         * config/powerpcspe/paired.md (vec_perm_constv2sf): Delete.
5602         * config/powerpcspe/spe.md (vec_perm_constv2si): Delete.
5603         * config/powerpcspe/vsx.md (vec_perm_const<mode>): Delete.
5604         * config/powerpcspe/powerpcspe-protos.h (altivec_expand_vec_perm_const)
5605         (rs6000_expand_vec_perm_const): Delete.
5606         * config/powerpcspe/powerpcspe.c (TARGET_VECTORIZE_VEC_PERM_CONST_OK):
5607         Delete.
5608         (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
5609         (altivec_expand_vec_perm_const_le): Take each operand individually.
5610         Operate on constant selectors rather than rtxes.
5611         (altivec_expand_vec_perm_const): Likewise.  Update call to
5612         altivec_expand_vec_perm_const_le.
5613         (rs6000_expand_vec_perm_const): Delete.
5614         (rs6000_vectorize_vec_perm_const_ok): Delete.
5615         (rs6000_vectorize_vec_perm_const): New function.
5616         (rs6000_do_expand_vec_perm): Take a vec_perm_builder instead of
5617         an element count and rtx array.
5618         (rs6000_expand_extract_even): Update call accordingly.
5619         (rs6000_expand_interleave): Likewise.
5620         * config/rs6000/altivec.md (vec_perm_constv16qi): Delete.
5621         * config/rs6000/paired.md (vec_perm_constv2sf): Delete.
5622         * config/rs6000/vsx.md (vec_perm_const<mode>): Delete.
5623         * config/rs6000/rs6000-protos.h (altivec_expand_vec_perm_const)
5624         (rs6000_expand_vec_perm_const): Delete.
5625         * config/rs6000/rs6000.c (TARGET_VECTORIZE_VEC_PERM_CONST_OK): Delete.
5626         (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
5627         (altivec_expand_vec_perm_const_le): Take each operand individually.
5628         Operate on constant selectors rather than rtxes.
5629         (altivec_expand_vec_perm_const): Likewise.  Update call to
5630         altivec_expand_vec_perm_const_le.
5631         (rs6000_expand_vec_perm_const): Delete.
5632         (rs6000_vectorize_vec_perm_const_ok): Delete.
5633         (rs6000_vectorize_vec_perm_const): New function.  Remove stray
5634         reference to the SPE evmerge intructions.
5635         (rs6000_do_expand_vec_perm): Take a vec_perm_builder instead of
5636         an element count and rtx array.
5637         (rs6000_expand_extract_even): Update call accordingly.
5638         (rs6000_expand_interleave): Likewise.
5639         * config/sparc/sparc.md (vec_perm_constv8qi): Delete in favor of...
5640         * config/sparc/sparc.c (sparc_vectorize_vec_perm_const): ...this
5641         new function.
5642         (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
5644 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
5646         * optabs.c (expand_vec_perm_1): Assert that SEL has an integer
5647         vector mode and that that mode matches the mode of the data
5648         being permuted.
5649         (expand_vec_perm): Split handling of non-CONST_VECTOR selectors
5650         out into expand_vec_perm_var.  Do all CONST_VECTOR handling here,
5651         directly using expand_vec_perm_1 when forcing selectors into
5652         registers.
5653         (expand_vec_perm_var): New function, split out from expand_vec_perm.
5655 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
5657         * optabs-query.h (can_vec_perm_p): Delete.
5658         (can_vec_perm_var_p, can_vec_perm_const_p): Declare.
5659         * optabs-query.c (can_vec_perm_p): Split into...
5660         (can_vec_perm_var_p, can_vec_perm_const_p): ...these two functions.
5661         (can_mult_highpart_p): Use can_vec_perm_const_p to test whether a
5662         particular selector is valid.
5663         * tree-ssa-forwprop.c (simplify_vector_constructor): Likewise.
5664         * tree-vect-data-refs.c (vect_grouped_store_supported): Likewise.
5665         (vect_grouped_load_supported): Likewise.
5666         (vect_shift_permute_load_chain): Likewise.
5667         * tree-vect-slp.c (vect_build_slp_tree_1): Likewise.
5668         (vect_transform_slp_perm_load): Likewise.
5669         * tree-vect-stmts.c (perm_mask_for_reverse): Likewise.
5670         (vectorizable_bswap): Likewise.
5671         (vect_gen_perm_mask_checked): Likewise.
5672         * fold-const.c (fold_ternary_loc): Likewise.  Don't take
5673         implementations of variable permutation vectors into account
5674         when deciding which selector to use.
5675         * tree-vect-loop.c (have_whole_vector_shift): Don't check whether
5676         vec_perm_const_optab is supported; instead use can_vec_perm_const_p
5677         with a false third argument.
5678         * tree-vect-generic.c (lower_vec_perm): Use can_vec_perm_const_p
5679         to test whether the constant selector is valid and can_vec_perm_var_p
5680         to test whether a variable selector is valid.
5682 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
5684         * optabs-query.h (can_vec_perm_p): Take a const vec_perm_indices *.
5685         * optabs-query.c (can_vec_perm_p): Likewise.
5686         * fold-const.c (fold_vec_perm): Take a const vec_perm_indices &
5687         instead of vec_perm_indices.
5688         * tree-vectorizer.h (vect_gen_perm_mask_any): Likewise,
5689         (vect_gen_perm_mask_checked): Likewise,
5690         * tree-vect-stmts.c (vect_gen_perm_mask_any): Likewise,
5691         (vect_gen_perm_mask_checked): Likewise,
5693 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
5695         * optabs-query.h (qimode_for_vec_perm): Declare.
5696         * optabs-query.c (can_vec_perm_p): Split out qimode search to...
5697         (qimode_for_vec_perm): ...this new function.
5698         * optabs.c (expand_vec_perm): Use qimode_for_vec_perm.
5700 2018-01-02  Aaron Sawdey  <acsawdey@linux.vnet.ibm.com>
5702         * rtlanal.c (canonicalize_condition): Return 0 if final rtx
5703         does not have a conditional at the top.
5705 2018-01-02  Richard Biener  <rguenther@suse.de>
5707         * ipa-inline.c (big_speedup_p): Fix expression.
5709 2018-01-02  Jan Hubicka  <hubicka@ucw.cz>
5711         PR target/81616
5712         * config/i386/x86-tune-costs.h: Increase cost of integer load costs
5713         for generic 4->6.
5715 2018-01-02  Jan Hubicka  <hubicka@ucw.cz>
5717         PR target/81616
5718         Generic tuning.
5719         * x86-tune-costs.h (generic_cost): Reduce cost of FDIV 20->17,
5720         cost of sqrt 20->14, DIVSS 18->13, DIVSD 32->17, SQRtSS 30->14
5721         and SQRTsD 58->18, cond_not_taken_branch_cost. 2->1. Increase
5722         cond_taken_branch_cost 3->4.
5724 2018-01-01  Jakub Jelinek  <jakub@redhat.com>
5726         PR tree-optimization/83581
5727         * tree-loop-distribution.c (pass_loop_distribution::execute): Return
5728         TODO_cleanup_cfg if any changes have been made.
5730         PR middle-end/83608
5731         * expr.c (store_expr_with_bounds): Use simplify_gen_subreg instead of
5732         convert_modes if target mode has the right side, but different mode
5733         class.
5735         PR middle-end/83609
5736         * expr.c (expand_assignment): Fix up a typo in simplify_gen_subreg
5737         last argument when extracting from CONCAT.  If either from_real or
5738         from_imag is NULL, use expansion through memory.  If result is not
5739         a CONCAT and simplify_gen_subreg fails, try to simplify_gen_subreg
5740         the parts directly to inner mode, if even that fails, use expansion
5741         through memory.
5743         PR middle-end/83623
5744         * expmed.c (expand_shift_1): For 2-byte rotates by BITS_PER_UNIT,
5745         check for bswap in mode rather than HImode and use that in expand_unop
5746         too.
5748 Copyright (C) 2018 Free Software Foundation, Inc.
5750 Copying and distribution of this file, with or without modification,
5751 are permitted in any medium without royalty provided the copyright
5752 notice and this notice are preserved.