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