Preserving locations for variable-uses and constants (PR c++/43486)
[official-gcc.git] / gcc / ChangeLog
bloba292768d13a23e1edc614863b65fa024dc721984
1 2018-01-10  David Malcolm  <dmalcolm@redhat.com>
3         PR c++/43486
4         * tree-core.h: Document EXPR_LOCATION_WRAPPER_P's usage of
5         "public_flag".
6         * tree.c (tree_nop_conversion): Return true for location wrapper
7         nodes.
8         (maybe_wrap_with_location): New function.
9         (selftest::check_strip_nops): New function.
10         (selftest::test_location_wrappers): New function.
11         (selftest::tree_c_tests): Call it.
12         * tree.h (STRIP_ANY_LOCATION_WRAPPER): New macro.
13         (maybe_wrap_with_location): New decl.
14         (EXPR_LOCATION_WRAPPER_P): New macro.
15         (location_wrapper_p): New inline function.
16         (tree_strip_any_location_wrapper): New inline function.
18 2018-01-10  H.J. Lu  <hongjiu.lu@intel.com>
20         PR target/83735
21         * config/i386/i386.c (ix86_compute_frame_layout): Always adjust
22         stack_realign_offset for the largest alignment of stack slot
23         actually used.
24         (ix86_find_max_used_stack_alignment): New function.
25         (ix86_finalize_stack_frame_flags): Use it.  Set
26         max_used_stack_alignment if we don't realign stack.
27         * config/i386/i386.h (machine_function): Add
28         max_used_stack_alignment.
30 2018-01-10  Christophe Lyon  <christophe.lyon@linaro.org>
32         * config/arm/arm.opt (-mbranch-cost): New option.
33         * config/arm/arm.h (BRANCH_COST): Take arm_branch_cost into
34         account.
36 2018-01-10  Segher Boessenkool  <segher@kernel.crashing.org>
38         PR target/83629
39         * config/rs6000/rs6000.md (load_toc_v4_PIC_2, load_toc_v4_PIC_3b,
40         load_toc_v4_PIC_3c): Wrap const term in CONST RTL.
42 2018-01-10  Richard Biener  <rguenther@suse.de>
44         PR debug/83765
45         * dwarf2out.c (gen_subprogram_die): Hoist old_die && declaration
46         early out so it also covers the case where we have a non-NULL
47         origin.
49 2018-01-10  Richard Sandiford  <richard.sandiford@linaro.org>
51         PR tree-optimization/83753
52         * tree-vect-stmts.c (get_group_load_store_type): Use VMAT_CONTIGUOUS
53         for non-strided grouped accesses if the number of elements is 1.
55 2018-01-10  Jan Hubicka  <hubicka@ucw.cz>
57         PR target/81616
58         * i386.c (ix86_vectorize_builtin_gather): Check TARGET_USE_GATHER.
59         * i386.h (TARGET_USE_GATHER): Define.
60         * x86-tune.def (X86_TUNE_USE_GATHER): New.
62 2018-01-10  Martin Liska  <mliska@suse.cz>
64         PR bootstrap/82831
65         * basic-block.h (CLEANUP_NO_PARTITIONING): New define.
66         * bb-reorder.c (pass_reorder_blocks::execute): Do not clean up
67         partitioning.
68         * cfgcleanup.c (try_optimize_cfg): Fix up partitioning if
69         CLEANUP_NO_PARTITIONING is not set.
71 2018-01-10  Richard Sandiford  <richard.sandiford@linaro.org>
73         * doc/rtl.texi: Remove documentation of (const ...) wrappers
74         for vectors, as a partial revert of r254296.
75         * rtl.h (const_vec_p): Delete.
76         (const_vec_duplicate_p): Don't test for vector CONSTs.
77         (unwrap_const_vec_duplicate, const_vec_series_p): Likewise.
78         * expmed.c (make_tree): Likewise.
80         Revert:
81         * common.md (E, F): Use CONSTANT_P instead of checking for
82         CONST_VECTOR.
83         * emit-rtl.c (gen_lowpart_common): Use const_vec_p instead of
84         checking for CONST_VECTOR.
86 2018-01-09  Jan Hubicka  <hubicka@ucw.cz>
88         PR middle-end/83575
89         * predict.c (force_edge_cold): Handle in more sane way edges
90         with no prediction.
92 2018-01-09  Carl Love  <cel@us.ibm.com>
94         * config/rs6002/altivec.md (p8_vmrgow): Add support for V2DI, V2DF,
95         V4SI, V4SF types.
96         (p8_vmrgew): Add support for V2DI, V2DF, V4SF types.
97         * config/rs6000/rs6000-builtin.def: Add definitions for FLOAT2_V2DF,
98         VMRGEW_V2DI, VMRGEW_V2DF, VMRGEW_V4SF, VMRGOW_V4SI, VMRGOW_V4SF,
99         VMRGOW_V2DI, VMRGOW_V2DF.  Remove definition for VMRGOW.
100         * config/rs6000/rs6000-c.c (VSX_BUILTIN_VEC_FLOAT2,
101         P8V_BUILTIN_VEC_VMRGEW, P8V_BUILTIN_VEC_VMRGOW):  Add definitions.
102         * config/rs6000/rs6000-protos.h: Add extern defition for
103         rs6000_generate_float2_double_code.
104         * config/rs6000/rs6000.c (rs6000_generate_float2_double_code): Add
105         function.
106         * config/rs6000/vsx.md (vsx_xvcdpsp): Add define_insn.
107         (float2_v2df): Add define_expand.
109 2018-01-09  Uros Bizjak  <ubizjak@gmail.com>
111         PR target/83628
112         * combine.c (force_int_to_mode) <case ASHIFT>: Use mode instead of
113         op_mode in the force_to_mode call.
115 2018-01-09  Richard Sandiford  <richard.sandiford@linaro.org>
117         * config/aarch64/aarch64.c (aarch64_evpc_trn): Use d.perm.series_p
118         instead of checking each element individually.
119         (aarch64_evpc_uzp): Likewise.
120         (aarch64_evpc_zip): Likewise.
121         (aarch64_evpc_ext): Likewise.
122         (aarch64_evpc_rev): Likewise.
123         (aarch64_evpc_dup): Test the encoding for a single duplicated element,
124         instead of checking each element individually.  Return true without
125         generating rtl if
126         (aarch64_vectorize_vec_perm_const): Use all_from_input_p to test
127         whether all selected elements come from the same input, instead of
128         checking each element individually.  Remove calls to gen_rtx_REG,
129         start_sequence and end_sequence and instead assert that no rtl is
130         generated.
132 2018-01-09  Richard Sandiford  <richard.sandiford@linaro.org>
134         * config/aarch64/aarch64.c (aarch64_legitimate_constant_p): Fix
135         order of HIGH and CONST checks.
137 2018-01-09  Richard Sandiford  <richard.sandiford@linaro.org>
139         * tree-vect-stmts.c (permute_vec_elements): Create a fresh variable
140         if the destination isn't an SSA_NAME.
142 2018-01-09  Richard Biener  <rguenther@suse.de>
144         PR tree-optimization/83668
145         * graphite.c (canonicalize_loop_closed_ssa): Add edge argument,
146         move prologue...
147         (canonicalize_loop_form): ... here, renamed from ...
148         (canonicalize_loop_closed_ssa_form): ... this and amended to
149         swap successor edges for loop exit blocks to make us use
150         the RPO order we need for initial schedule generation.
152 2018-01-09  Joseph Myers  <joseph@codesourcery.com>
154         PR tree-optimization/64811
155         * match.pd: When optimizing comparisons with Inf, avoid
156         introducing or losing exceptions from comparisons with NaN.
158 2018-01-09  Martin Liska  <mliska@suse.cz>
160         PR sanitizer/82517
161         * asan.c (shadow_mem_size): Add gcc_assert.
163 2018-01-09  Georg-Johann Lay  <avr@gjlay.de>
165         Don't save registers in main().
167         PR target/83738
168         * doc/invoke.texi (AVR Options) [-mmain-is-OS_task]: Document it.
169         * config/avr/avr.opt (-mmain-is-OS_task): New target option.
170         * config/avr/avr.c (avr_set_current_function): Don't error if
171         naked, OS_task or OS_main are specified at the same time.
172         (avr_function_ok_for_sibcall): Don't disable sibcalls for OS_task,
173         OS_main.
174         (avr_insert_attributes) [-mmain-is-OS_task] <main>: Add OS_task
175         attribute.
176         * common/config/avr/avr-common.c (avr_option_optimization_table):
177         Switch on -mmain-is-OS_task for optimizing compilations.
179 2018-01-09  Richard Biener  <rguenther@suse.de>
181         PR tree-optimization/83572
182         * graphite.c: Include cfganal.h.
183         (graphite_transform_loops): Connect infinite loops to exit
184         and remove fake edges at the end.
186 2018-01-09  Jan Hubicka  <hubicka@ucw.cz>
188         * ipa-inline.c (edge_badness): Revert accidental checkin.
190 2018-01-09  Jan Hubicka  <hubicka@ucw.cz>
192         PR ipa/80763
193         * ipa-comdats.c (set_comdat_group): Only set comdat group of real
194         symbols; not inline clones.
196 2018-01-09  Jakub Jelinek  <jakub@redhat.com>
198         PR target/83507
199         * modulo-sched.c (schedule_reg_moves): Punt if we'd need to move
200         hard registers.  Formatting fixes.
202         PR preprocessor/83722
203         * gcc.c (try_generate_repro): Pass
204         &temp_stderr_files[RETRY_ICE_ATTEMPTS - 1] rather than
205         &temp_stdout_files[RETRY_ICE_ATTEMPTS - 1] as last argument to
206         do_report_bug.
208 2018-01-08  Monk Chiang  <sh.chiang04@gmail.com>
209             Kito Cheng  <kito.cheng@gmail.com>
211         * config/riscv/riscv.c (machine_function::is_leaf): Remove field.
212         (riscv_leaf_function_p): Delete.
213         (riscv_function_ok_for_sibcall): Return false when TARGET_SAVE_RESTORE.
215 2018-01-08  Aaron Sawdey  <acsawdey@linux.vnet.ibm.com>
217         * config/rs6000/rs6000-string.c (do_load_for_compare_from_addr): New
218         function.
219         (do_ifelse): New function.
220         (do_isel): New function.
221         (do_sub3): New function.
222         (do_add3): New function.
223         (do_load_mask_compare): New function.
224         (do_overlap_load_compare): New function.
225         (expand_compare_loop): New function.
226         (expand_block_compare): Call expand_compare_loop() when appropriate.
227         * config/rs6000/rs6000.opt (-mblock-compare-inline-limit): Change
228         option description.
229         (-mblock-compare-inline-loop-limit): New option.
231 2018-01-08  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
233         PR target/83677
234         * config/rs6000/altivec.md (*altivec_vpermr_<mode>_internal):
235         Reverse order of second and third operands in first alternative.
236         * config/rs6000/rs6000.c (rs6000_expand_vector_set): Reverse order
237         of first and second elements in UNSPEC_VPERMR vector.
238         (altivec_expand_vec_perm_le): Likewise.
240 2017-01-08  Jeff Law  <law@redhat.com>
242         PR rtl-optimizatin/81308
243         * tree-switch-conversion.c (cfg_altered): New file scoped static.
244         (process_switch): If group_case_labels makes a change, then set
245         cfg_altered.
246         (pass_convert_switch::execute): If a switch is converted, then
247         set cfg_altered.  Return TODO_cfg_cleanup if cfg_altered is true.
249         PR rtl-optimization/81308
250         * recog.c (split_all_insns): Conditionally cleanup the CFG after
251         splitting insns.
253 2018-01-08  Vidya Praveen  <vidyapraveen@arm.com>
255         PR target/83663 - Revert r255946
256         * config/aarch64/aarch64.c (aarch64_expand_vector_init): Modify code
257         generation for cases where splatting a value is not useful.
258         * simplify-rtx.c (simplify_ternary_operation): Simplify vec_merge
259         across a vec_duplicate and a paradoxical subreg forming a vector
260         mode to a vec_concat.
262 2018-01-08  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
264         * config/arm/t-aprofile (MULTILIB_MATCHES): Add mapping rules for
265         -march=armv8.3-a variants.
266         * config/arm/t-multilib: Likewise.
267         * config/arm/t-arm-elf: Likewise.  Handle dotprod extension.
269 2018-01-08  Aaron Sawdey  <acsawdey@linux.vnet.ibm.com>
271         * config/rs6000/rs6000.md (cceq_ior_compare): Remove * so I can use it
272         to generate rtl.
273         (cceq_ior_compare_complement): Give it a name so I can use it, and
274         change boolean_or_operator predicate to boolean_operator so it can
275         be used to generate a crand.
276         (eqne): New code iterator.
277         (bd/bd_neg): New code_attrs.
278         (<bd>_<mode>): New name for ctr<mode>_internal[12] now combined into
279         a single define_insn.
280         (<bd>tf_<mode>): A new insn pattern for the conditional form branch
281         decrement (bdnzt/bdnzf/bdzt/bdzf).
282         * config/rs6000/rs6000.c (rs6000_legitimate_combined_insn): Updated
283         with the new names of the branch decrement patterns, and added the
284         names of the branch decrement conditional patterns.
286 2018-01-08  Richard Biener  <rguenther@suse.de>
288         PR tree-optimization/83563
289         * graphite.c (canonicalize_loop_closed_ssa_form): Reset the SCEV
290         cache.
292 2018-01-08  Richard Biener  <rguenther@suse.de>
294         PR middle-end/83713
295         * convert.c (do_narrow): Properly guard TYPE_OVERFLOW_WRAPS checks.
297 2018-01-08  Richard Biener  <rguenther@suse.de>
299         PR tree-optimization/83685
300         * tree-ssa-pre.c (create_expression_by_pieces): Do not insert
301         references to abnormals.
303 2018-01-08  Richard Biener  <rguenther@suse.de>
305         PR lto/83719
306         * dwarf2out.c (output_indirect_strings): Handle empty
307         skeleton_debug_str_hash.
308         (dwarf2out_early_finish): Index strings for -gsplit-dwarf.
310 2018-01-08  Claudiu Zissulescu  <claziss@synopsys.com>
312         * config/arc/arc.c (TARGET_TRAMPOLINE_ADJUST_ADDRESS): Delete.
313         (emit_store_direct): Likewise.
314         (arc_trampoline_adjust_address): Likewise.
315         (arc_asm_trampoline_template): New function.
316         (arc_initialize_trampoline): Use asm_trampoline_template.
317         (TARGET_ASM_TRAMPOLINE_TEMPLATE): Define.
318         * config/arc/arc.h (TRAMPOLINE_SIZE): Adjust to 16.
319         * config/arc/arc.md (flush_icache): Delete pattern.
321 2018-01-08  Claudiu Zissulescu  <claziss@synopsys.com>
323         * config/arc/arc-c.def (__ARC_UNALIGNED__): New define.
324         * config/arc/arc.h (STRICT_ALIGNMENT): Control this macro using
325         munaligned-access.
327 2018-01-08  Sebastian Huber  <sebastian.huber@embedded-brains.de>
329         PR target/83681
330         * config/epiphany/epiphany.h (make_pass_mode_switch_use): Guard
331         by not USED_FOR_TARGET.
332         (make_pass_resolve_sw_modes): Likewise.
334 2018-01-08  Sebastian Huber  <sebastian.huber@embedded-brains.de>
336         * config/nios2/nios2.h (nios2_section_threshold): Guard by not
337         USED_FOR_TARGET.
339 2018-01-08  Richard Biener  <rguenther@suse.de>
341         PR middle-end/83580
342         * tree-data-ref.c (split_constant_offset): Remove STRIP_NOPS.
344 2018-01-08  Richard Biener  <rguenther@suse.de>
346         PR middle-end/83517
347         * match.pd ((t * 2) / 2) -> t): Add missing :c.
349 2018-01-06  Aldy Hernandez  <aldyh@redhat.com>
351         PR middle-end/81897
352         * tree-ssa-uninit.c (compute_control_dep_chain): Do not bail on
353         basic blocks with a small number of successors.
354         (convert_control_dep_chain_into_preds): Improve handling of
355         forwarder blocks.
356         (dump_predicates): Split apart into...
357         (dump_pred_chain): ...here...
358         (dump_pred_info): ...and here.
359         (can_one_predicate_be_invalidated_p): Add debugging printfs.
360         (can_chain_union_be_invalidated_p): Improve check for invalidation
361         of paths.
362         (uninit_uses_cannot_happen): Avoid unnecessary if
363         convert_control_dep_chain_into_preds yielded nothing.
365 2018-01-06  Martin Sebor  <msebor@redhat.com>
367         PR tree-optimization/83640
368         * gimple-ssa-warn-restrict.c (builtin_access::builtin_access): Avoid
369         subtracting negative offset from size.
370         (builtin_access::overlap): Adjust offset bounds of the access to fall
371         within the size of the object if possible.
373 2018-01-06  Richard Sandiford  <richard.sandiford@linaro.org>
375         PR rtl-optimization/83699
376         * expmed.c (extract_bit_field_1): Restrict the vector usage of
377         extract_bit_field_as_subreg to cases in which the extracted
378         value is also a vector.
380         * lra-constraints.c (process_alt_operands): Test for the equivalence
381         substitutions when detecting a possible reload cycle.
383 2018-01-06  Jakub Jelinek  <jakub@redhat.com>
385         PR debug/83480
386         * toplev.c (process_options): Don't enable debug_nonbind_markers_p
387         by default if flag_selective_schedling{,2}.  Formatting fixes.
389         PR rtl-optimization/83682
390         * rtl.h (const_vec_duplicate_p): Only return true for VEC_DUPLICATE
391         if it has non-VECTOR_MODE element mode.
392         (vec_duplicate_p): Likewise.
394         PR middle-end/83694
395         * cfgexpand.c (expand_debug_expr): Punt if mode1 is VOIDmode
396         and bitsize might be greater than MAX_BITSIZE_MODE_ANY_INT.
398 2018-01-05  Jakub Jelinek  <jakub@redhat.com>
400         PR target/83604
401         * config/i386/i386-builtin.def
402         (__builtin_ia32_vgf2p8affineinvqb_v64qi,
403         __builtin_ia32_vgf2p8affineqb_v64qi, __builtin_ia32_vgf2p8mulb_v64qi):
404         Require also OPTION_MASK_ISA_AVX512F in addition to
405         OPTION_MASK_ISA_GFNI.
406         (__builtin_ia32_vgf2p8affineinvqb_v16qi_mask,
407         __builtin_ia32_vgf2p8affineqb_v16qi_mask): Require
408         OPTION_MASK_ISA_AVX512VL instead of OPTION_MASK_ISA_SSE in addition
409         to OPTION_MASK_ISA_GFNI.
410         (__builtin_ia32_vgf2p8mulb_v32qi_mask): Require
411         OPTION_MASK_ISA_AVX512VL in addition to OPTION_MASK_ISA_GFNI and
412         OPTION_MASK_ISA_AVX512BW.
413         (__builtin_ia32_vgf2p8mulb_v16qi_mask): Require
414         OPTION_MASK_ISA_AVX512VL instead of OPTION_MASK_ISA_AVX512BW in
415         addition to OPTION_MASK_ISA_GFNI.
416         (__builtin_ia32_vgf2p8affineinvqb_v16qi,
417         __builtin_ia32_vgf2p8affineqb_v16qi, __builtin_ia32_vgf2p8mulb_v16qi):
418         Require OPTION_MASK_ISA_SSE2 instead of OPTION_MASK_ISA_SSE in addition
419         to OPTION_MASK_ISA_GFNI.
420         * config/i386/i386.c (def_builtin): Change to builtin isa/isa2 being
421         a requirement for all ISAs rather than any of them with a few
422         exceptions.
423         (ix86_add_new_builtins): Clear OPTION_MASK_ISA_64BIT from isa before
424         processing.
425         (ix86_expand_builtin): Require all ISAs from builtin's isa and isa2
426         bitmasks to be enabled with 3 exceptions, instead of requiring any
427         enabled ISA with lots of exceptions.
428         * config/i386/sse.md (vgf2p8affineinvqb_<mode><mask_name>,
429         vgf2p8affineqb_<mode><mask_name>, vgf2p8mulb_<mode><mask_name>):
430         Change avx512bw in isa attribute to avx512f.
431         * config/i386/sgxintrin.h: Add license boilerplate.
432         * config/i386/vaesintrin.h: Likewise.  Fix macro spelling __AVX512F
433         to __AVX512F__ and __AVX512VL to __AVX512VL__.
434         (_mm256_aesdec_epi128, _mm256_aesdeclast_epi128, _mm256_aesenc_epi128,
435         _mm256_aesenclast_epi128): Enable temporarily avx if __AVX__ is not
436         defined.
437         * config/i386/gfniintrin.h (_mm_gf2p8mul_epi8,
438         _mm_gf2p8affineinv_epi64_epi8, _mm_gf2p8affine_epi64_epi8): Enable
439         temporarily sse2 rather than sse if not enabled already.
441         PR target/83604
442         * config/i386/sse.md (VI248_VLBW): Rename to ...
443         (VI248_AVX512VL): ... this.  Don't guard V32HI with TARGET_AVX512BW.
444         (vpshrd_<mode><mask_name>, vpshld_<mode><mask_name>,
445         vpshrdv_<mode>, vpshrdv_<mode>_mask, vpshrdv_<mode>_maskz,
446         vpshrdv_<mode>_maskz_1, vpshldv_<mode>, vpshldv_<mode>_mask,
447         vpshldv_<mode>_maskz, vpshldv_<mode>_maskz_1): Use VI248_AVX512VL
448         mode iterator instead of VI248_VLBW.
450 2018-01-05  Jan Hubicka  <hubicka@ucw.cz>
452         * ipa-fnsummary.c (record_modified_bb_info): Add OP.
453         (record_modified): Skip clobbers; add debug output.
454         (param_change_prob): Use sreal frequencies.
456 2018-01-05  Richard Sandiford  <richard.sandiford@linaro.org>
458         * tree-vect-data-refs.c (vect_compute_data_ref_alignment): Don't
459         punt for user-aligned variables.
461 2018-01-05  Richard Sandiford  <richard.sandiford@linaro.org>
463         * tree-chrec.c (chrec_contains_symbols): Return true for
464         POLY_INT_CST.
466 2018-01-05  Sudakshina Das  <sudi.das@arm.com>
468         PR target/82439
469         * simplify-rtx.c (simplify_relational_operation_1): Add simplifications
470         of (x|y) == x for BICS pattern.
472 2018-01-05  Jakub Jelinek  <jakub@redhat.com>
474         PR tree-optimization/83605
475         * gimple-ssa-strength-reduction.c: Include tree-eh.h.
476         (find_candidates_dom_walker::before_dom_children): Ignore stmts that
477         can throw.
479 2018-01-05  Sebastian Huber  <sebastian.huber@embedded-brains.de>
481         * config.gcc (epiphany-*-elf*): Add (epiphany-*-rtems*) configuration.
482         * config/epiphany/rtems.h: New file.
484 2018-01-04  Jakub Jelinek  <jakub@redhat.com>
485             Uros Bizjak  <ubizjak@gmail.com>
487         PR target/83554
488         * config/i386/i386.md (*<rotate_insn>hi3_1 splitter): Use
489         QIreg_operand instead of register_operand predicate.
490         * config/i386/i386.c (ix86_rop_should_change_byte_p,
491         set_rop_modrm_reg_bits, ix86_mitigate_rop): Use -mmitigate-rop in
492         comments instead of -fmitigate[-_]rop.
494 2018-01-04  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
496         PR bootstrap/81926
497         * cgraphunit.c (symbol_table::compile): Switch to text_section
498         before calling assembly_start debug hook.
499         * run-rtl-passes.c (run_rtl_passes): Likewise.
500         Include output.h.
502 2018-01-04  Richard Sandiford  <richard.sandiford@linaro.org>
504         * tree-vrp.c (extract_range_from_binary_expr_1): Check
505         range_int_cst_p rather than !symbolic_range_p before calling
506         extract_range_from_multiplicative_op_1.
508 2017-01-04  Jeff Law  <law@redhat.com>
510         * tree-ssa-math-opts.c (execute_cse_reciprocals_1): Remove
511         redundant test in assertion.
513 2018-01-04  Richard Sandiford  <richard.sandiford@linaro.org>
515         * doc/rtl.texi: Document machine_mode wrapper classes.
517 2018-01-04  Richard Sandiford  <richard.sandiford@linaro.org>
519         * fold-const.c (fold_ternary_loc): Check tree_fits_uhwi_p before
520         using tree_to_uhwi.
522 2018-01-04  Richard Sandiford  <richard.sandiford@linaro.org>
524         * tree-ssa-forwprop.c (is_combined_permutation_identity): Allow
525         the VEC_PERM_EXPR fold to fail.
527 2018-01-04  Jakub Jelinek  <jakub@redhat.com>
529         PR debug/83585
530         * bb-reorder.c (insert_section_boundary_note): Set has_bb_partition
531         to switched_sections.
533 2018-01-04  Richard Sandiford  <richard.sandiford@linaro.org>
535         PR target/83680
536         * config/arm/arm.c (arm_vectorize_vec_perm_const): Fix inverted
537         test for d.testing.
539 2018-01-04  Peter Bergner  <bergner@vnet.ibm.com>
541         PR target/83387
542         * config/rs6000/rs6000.c (rs6000_discover_homogeneous_aggregate): Do not
543         allow arguments in FP registers if TARGET_HARD_FLOAT is false.
545 2018-01-04  Jakub Jelinek  <jakub@redhat.com>
547         PR debug/83666
548         * cfgexpand.c (expand_dbeug_expr) <case BIT_FIELD_REF>: Punt if mode
549         is BLKmode and bitpos not zero or mode change is needed.
551 2018-01-04  Richard Sandiford  <richard.sandiford@linaro.org>
553         PR target/83675
554         * config/sparc/sparc.c (sparc_vectorize_vec_perm_const): Require
555         TARGET_VIS2.
557 2018-01-04  Uros Bizjak  <ubizjak@gmail.com>
559         PR target/83628
560         * config/alpha/alpha.md (*sadd<modesuffix>): Use ASHIFT
561         instead of MULT rtx.  Update all corresponding splitters.
562         (*saddl_se): Ditto.
563         (*ssub<modesuffix>): Ditto.
564         (*ssubl_se): Ditto.
565         (*cmp_sadd_di): Update split patterns.
566         (*cmp_sadd_si): Ditto.
567         (*cmp_sadd_sidi): Ditto.
568         (*cmp_ssub_di): Ditto.
569         (*cmp_ssub_si): Ditto.
570         (*cmp_ssub_sidi): Ditto.
571         * config/alpha/predicates.md (const23_operand): New predicate.
572         * config/alpha/alpha.c (alpha_rtx_costs) [PLUS, MINUS]:
573         Look for ASHIFT, not MULT inner operand.
574         (alpha_split_conditional_move): Update for *sadd<modesuffix> change.
576 2018-01-04  Martin Liska  <mliska@suse.cz>
578         PR gcov-profile/83669
579         * gcov.c (output_intermediate_file): Add version to intermediate
580         gcov file.
581         * doc/gcov.texi: Document new field 'version' in intermediate
582         file format. Fix location of '-k' option of gcov command.
584 2018-01-04  Martin Liska  <mliska@suse.cz>
586         PR ipa/82352
587         * ipa-icf.c (sem_function::merge): Do not cross comdat boundary.
589 2018-01-04  Jakub Jelinek  <jakub@redhat.com>
591         * gimple-ssa-sprintf.c (parse_directive): Cast second dir.len to uhwi.
593 2018-01-03  Martin Sebor  <msebor@redhat.com>
595         PR tree-optimization/83655
596         * gimple-ssa-warn-restrict.c (wrestrict_dom_walker::check_call): Avoid
597         checking calls with invalid arguments.
599 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
601         * tree-vect-stmts.c (vect_get_store_rhs): New function.
602         (vectorizable_mask_load_store): Delete.
603         (vectorizable_call): Return false for masked loads and stores.
604         (vectorizable_store): Handle IFN_MASK_STORE.  Use vect_get_store_rhs
605         instead of gimple_assign_rhs1.
606         (vectorizable_load): Handle IFN_MASK_LOAD.
607         (vect_transform_stmt): Don't set is_store for call_vec_info_type.
609 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
611         * tree-vect-stmts.c (vect_build_gather_load_calls): New function,
612         split out from..,
613         (vectorizable_mask_load_store): ...here.
614         (vectorizable_load): ...and here.
616 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
618         * tree-vect-stmts.c (vect_build_all_ones_mask)
619         (vect_build_zero_merge_argument): New functions, split out from...
620         (vectorizable_load): ...here.
622 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
624         * tree-vect-stmts.c (vect_check_store_rhs): New function,
625         split out from...
626         (vectorizable_mask_load_store): ...here.
627         (vectorizable_store): ...and here.
629 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
631         * tree-vect-stmts.c (vect_check_load_store_mask): New function,
632         split out from...
633         (vectorizable_mask_load_store): ...here.
635 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
637         * tree-vectorizer.h (vec_load_store_type): Moved from tree-vec-stmts.c
638         (vect_model_store_cost): Take a vec_load_store_type instead of a
639         vect_def_type.
640         * tree-vect-stmts.c (vec_load_store_type): Move to tree-vectorizer.h.
641         (vect_model_store_cost): Take a vec_load_store_type instead of a
642         vect_def_type.
643         (vectorizable_mask_load_store): Update accordingly.
644         (vectorizable_store): Likewise.
645         * tree-vect-slp.c (vect_analyze_slp_cost_1): Update accordingly.
647 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
649         * tree-vect-loop.c (vect_transform_loop): Stub out scalar
650         IFN_MASK_LOAD calls here rather than...
651         * tree-vect-stmts.c (vectorizable_mask_load_store): ...here.
653 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
654             Alan Hayward  <alan.hayward@arm.com>
655             David Sherwood  <david.sherwood@arm.com>
657         * expmed.c (extract_bit_field_1): For vector extracts,
658         fall back to extract_bit_field_as_subreg if vec_extract
659         isn't available.
661 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
662             Alan Hayward  <alan.hayward@arm.com>
663             David Sherwood  <david.sherwood@arm.com>
665         * lra-spills.c (pseudo_reg_slot_compare): Sort slots by whether
666         they are variable or constant sized.
667         (assign_stack_slot_num_and_sort_pseudos): Don't reuse variable-sized
668         slots for constant-sized data.
670 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
671             Alan Hayward  <alan.hayward@arm.com>
672             David Sherwood  <david.sherwood@arm.com>
674         * tree-vect-patterns.c (vect_recog_mask_conversion_pattern): When
675         handling COND_EXPRs with boolean comparisons, try to find a better
676         basis for the mask type than the boolean itself.
678 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
680         * doc/rtl.texi (MAX_BITSIZE_MODE_ANY_MODE): Describe how the default
681         is calculated and how it can be overridden.
682         * genmodes.c (max_bitsize_mode_any_mode): New variable.
683         (create_modes): Initialize it from MAX_BITSIZE_MODE_ANY_MODE,
684         if defined.
685         (emit_max_int): Use it to set the output MAX_BITSIZE_MODE_ANY_MODE,
686         if nonzero.
688 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
689             Alan Hayward  <alan.hayward@arm.com>
690             David Sherwood  <david.sherwood@arm.com>
692         * config/aarch64/aarch64-protos.h (aarch64_output_simd_mov_immediate):
693         Remove the mode argument.
694         (aarch64_simd_valid_immediate): Remove the mode and inverse
695         arguments.
696         * config/aarch64/iterators.md (bitsize): New iterator.
697         * config/aarch64/aarch64-simd.md (*aarch64_simd_mov<mode>, and<mode>3)
698         (ior<mode>3): Update calls to aarch64_output_simd_mov_immediate.
699         * config/aarch64/constraints.md (Do, Db, Dn): Update calls to
700         aarch64_simd_valid_immediate.
701         * config/aarch64/predicates.md (aarch64_reg_or_orr_imm): Likewise.
702         (aarch64_reg_or_bic_imm): Likewise.
703         * config/aarch64/aarch64.c (simd_immediate_info): Replace mvn
704         with an insn_type enum and msl with a modifier_type enum.
705         Replace element_width with a scalar_mode.  Change the shift
706         to unsigned int.  Add constructors for scalar_float_mode and
707         scalar_int_mode elements.
708         (aarch64_vect_float_const_representable_p): Delete.
709         (aarch64_can_const_movi_rtx_p)
710         (aarch64_simd_scalar_immediate_valid_for_move)
711         (aarch64_simd_make_constant): Update call to
712         aarch64_simd_valid_immediate.
713         (aarch64_advsimd_valid_immediate_hs): New function.
714         (aarch64_advsimd_valid_immediate): Likewise.
715         (aarch64_simd_valid_immediate): Remove mode and inverse
716         arguments.  Rewrite to use the above.  Use const_vec_duplicate_p
717         to detect duplicated constants and use aarch64_float_const_zero_rtx_p
718         and aarch64_float_const_representable_p on the result.
719         (aarch64_output_simd_mov_immediate): Remove mode argument.
720         Update call to aarch64_simd_valid_immediate and use of
721         simd_immediate_info.
722         (aarch64_output_scalar_simd_mov_immediate): Update call
723         accordingly.
725 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
726             Alan Hayward  <alan.hayward@arm.com>
727             David Sherwood  <david.sherwood@arm.com>
729         * machmode.h (mode_precision): Prefix with CONST_MODE_PRECISION.
730         (mode_nunits): Likewise CONST_MODE_NUNITS.
731         * machmode.def (ADJUST_NUNITS): Document.
732         * genmodes.c (mode_data::need_nunits_adj): New field.
733         (blank_mode): Update accordingly.
734         (adj_nunits): New variable.
735         (print_maybe_const_decl): Replace CATEGORY with a NEEDS_ADJ
736         parameter.
737         (emit_mode_size_inline): Set need_bytesize_adj for all modes
738         listed in adj_nunits.
739         (emit_mode_nunits_inline): Set need_nunits_adj for all modes
740         listed in adj_nunits.  Don't emit case statements for such modes.
741         (emit_insn_modes_h): Emit definitions of CONST_MODE_NUNITS
742         and CONST_MODE_PRECISION.  Make CONST_MODE_SIZE expand to
743         nothing if adj_nunits is nonnull.
744         (emit_mode_precision, emit_mode_nunits): Use print_maybe_const_decl.
745         (emit_mode_unit_size, emit_mode_base_align, emit_mode_ibit)
746         (emit_mode_fbit): Update use of print_maybe_const_decl.
747         (emit_move_size): Likewise.  Treat the array as non-const
748         if adj_nunits.
749         (emit_mode_adjustments): Handle adj_nunits.
751 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
753         * machmode.def (VECTOR_MODES_WITH_PREFIX): Document.
754         * genmodes.c (VECTOR_MODES_WITH_PREFIX): New macro.
755         (VECTOR_MODES): Use it.
756         (make_vector_modes): Take the prefix as an argument.
758 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
759             Alan Hayward  <alan.hayward@arm.com>
760             David Sherwood  <david.sherwood@arm.com>
762         * mode-classes.def (MODE_VECTOR_BOOL): New mode class.
763         * machmode.h (INTEGRAL_MODE_P, VECTOR_MODE_P): Return true
764         for MODE_VECTOR_BOOL.
765         * machmode.def (VECTOR_BOOL_MODE): Document.
766         * genmodes.c (VECTOR_BOOL_MODE): New macro.
767         (make_vector_bool_mode): New function.
768         (complete_mode, emit_mode_wider, emit_mode_adjustments): Handle
769         MODE_VECTOR_BOOL.
770         * lto-streamer-in.c (lto_input_mode_table): Likewise.
771         * rtx-vector-builder.c (rtx_vector_builder::find_cached_value):
772         Likewise.
773         * stor-layout.c (int_mode_for_mode): Likewise.
774         * tree.c (build_vector_type_for_mode): Likewise.
775         * varasm.c (output_constant_pool_2): Likewise.
776         * emit-rtl.c (init_emit_once): Make sure that CONST1_RTX (BImode) and
777         CONSTM1_RTX (BImode) are the same thing.  Initialize const_tiny_rtx
778         for MODE_VECTOR_BOOL.
779         * expr.c (expand_expr_real_1): Use VECTOR_MODE_P instead of a list
780         of mode class checks.
781         * tree-vect-generic.c (expand_vector_operation): Use VECTOR_MODE_P
782         instead of a list of mode class checks.
783         (expand_vector_scalar_condition): Likewise.
784         (type_for_widest_vector_mode): Handle BImode as an inner mode.
786 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
787             Alan Hayward  <alan.hayward@arm.com>
788             David Sherwood  <david.sherwood@arm.com>
790         * machmode.h (mode_size): Change from unsigned short to
791         poly_uint16_pod.
792         (mode_to_bytes): Return a poly_uint16 rather than an unsigned short.
793         (GET_MODE_SIZE): Return a constant if ONLY_FIXED_SIZE_MODES,
794         or if measurement_type is not polynomial.
795         (fixed_size_mode::includes_p): Check for constant-sized modes.
796         * genmodes.c (emit_mode_size_inline): Make mode_size_inline
797         return a poly_uint16 rather than an unsigned short.
798         (emit_mode_size): Change the type of mode_size from unsigned short
799         to poly_uint16_pod.  Use ZERO_COEFFS for the initializer.
800         (emit_mode_adjustments): Cope with polynomial vector sizes.
801         * lto-streamer-in.c (lto_input_mode_table): Use bp_unpack_poly_value
802         for GET_MODE_SIZE.
803         * lto-streamer-out.c (lto_write_mode_table): Use bp_pack_poly_value
804         for GET_MODE_SIZE.
805         * auto-inc-dec.c (try_merge): Treat GET_MODE_SIZE as polynomial.
806         * builtins.c (expand_ifn_atomic_compare_exchange_into_call): Likewise.
807         * caller-save.c (setup_save_areas): Likewise.
808         (replace_reg_with_saved_mem): Likewise.
809         * calls.c (emit_library_call_value_1): Likewise.
810         * combine-stack-adj.c (combine_stack_adjustments_for_block): Likewise.
811         * combine.c (simplify_set, make_extraction, simplify_shift_const_1)
812         (gen_lowpart_for_combine): Likewise.
813         * convert.c (convert_to_integer_1): Likewise.
814         * cse.c (equiv_constant, cse_insn): Likewise.
815         * cselib.c (autoinc_split, cselib_hash_rtx): Likewise.
816         (cselib_subst_to_values): Likewise.
817         * dce.c (word_dce_process_block): Likewise.
818         * df-problems.c (df_word_lr_mark_ref): Likewise.
819         * dwarf2cfi.c (init_one_dwarf_reg_size): Likewise.
820         * dwarf2out.c (multiple_reg_loc_descriptor, mem_loc_descriptor)
821         (concat_loc_descriptor, concatn_loc_descriptor, loc_descriptor)
822         (rtl_for_decl_location): Likewise.
823         * emit-rtl.c (gen_highpart, widen_memory_access): Likewise.
824         * expmed.c (extract_bit_field_1, extract_integral_bit_field): Likewise.
825         * expr.c (emit_group_load_1, clear_storage_hints): Likewise.
826         (emit_move_complex, emit_move_multi_word, emit_push_insn): Likewise.
827         (expand_expr_real_1): Likewise.
828         * function.c (assign_parm_setup_block_p, assign_parm_setup_block)
829         (pad_below): Likewise.
830         * gimple-fold.c (optimize_atomic_compare_exchange_p): Likewise.
831         * gimple-ssa-store-merging.c (rhs_valid_for_store_merging_p): Likewise.
832         * ira.c (get_subreg_tracking_sizes): Likewise.
833         * ira-build.c (ira_create_allocno_objects): Likewise.
834         * ira-color.c (coalesced_pseudo_reg_slot_compare): Likewise.
835         (ira_sort_regnos_for_alter_reg): Likewise.
836         * ira-costs.c (record_operand_costs): Likewise.
837         * lower-subreg.c (interesting_mode_p, simplify_gen_subreg_concatn)
838         (resolve_simple_move): Likewise.
839         * lra-constraints.c (get_reload_reg, operands_match_p): Likewise.
840         (process_addr_reg, simplify_operand_subreg, curr_insn_transform)
841         (lra_constraints): Likewise.
842         (CONST_POOL_OK_P): Reject variable-sized modes.
843         * lra-spills.c (slot, assign_mem_slot, pseudo_reg_slot_compare)
844         (add_pseudo_to_slot, lra_spill): Likewise.
845         * omp-low.c (omp_clause_aligned_alignment): Likewise.
846         * optabs-query.c (get_best_extraction_insn): Likewise.
847         * optabs-tree.c (expand_vec_cond_expr_p): Likewise.
848         * optabs.c (expand_vec_perm_var, expand_vec_cond_expr): Likewise.
849         (expand_mult_highpart, valid_multiword_target_p): Likewise.
850         * recog.c (offsettable_address_addr_space_p): Likewise.
851         * regcprop.c (maybe_mode_change): Likewise.
852         * reginfo.c (choose_hard_reg_mode, record_subregs_of_mode): Likewise.
853         * regrename.c (build_def_use): Likewise.
854         * regstat.c (dump_reg_info): Likewise.
855         * reload.c (complex_word_subreg_p, push_reload, find_dummy_reload)
856         (find_reloads, find_reloads_subreg_address): Likewise.
857         * reload1.c (eliminate_regs_1): Likewise.
858         * rtlanal.c (for_each_inc_dec_find_inc_dec, rtx_cost): Likewise.
859         * simplify-rtx.c (avoid_constant_pool_reference): Likewise.
860         (simplify_binary_operation_1, simplify_subreg): Likewise.
861         * targhooks.c (default_function_arg_padding): Likewise.
862         (default_hard_regno_nregs, default_class_max_nregs): Likewise.
863         * tree-cfg.c (verify_gimple_assign_binary): Likewise.
864         (verify_gimple_assign_ternary): Likewise.
865         * tree-inline.c (estimate_move_cost): Likewise.
866         * tree-ssa-forwprop.c (simplify_vector_constructor): Likewise.
867         * tree-ssa-loop-ivopts.c (add_autoinc_candidates): Likewise.
868         (get_address_cost_ainc): Likewise.
869         * tree-vect-data-refs.c (vect_enhance_data_refs_alignment): Likewise.
870         (vect_supportable_dr_alignment): Likewise.
871         * tree-vect-loop.c (vect_determine_vectorization_factor): Likewise.
872         (vectorizable_reduction): Likewise.
873         * tree-vect-stmts.c (vectorizable_assignment, vectorizable_shift)
874         (vectorizable_operation, vectorizable_load): Likewise.
875         * tree.c (build_same_sized_truth_vector_type): Likewise.
876         * valtrack.c (cleanup_auto_inc_dec): Likewise.
877         * var-tracking.c (emit_note_insn_var_location): Likewise.
878         * config/arc/arc.h (ASM_OUTPUT_CASE_END): Use as_a <scalar_int_mode>.
879         (ADDR_VEC_ALIGN): Likewise.
881 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
882             Alan Hayward  <alan.hayward@arm.com>
883             David Sherwood  <david.sherwood@arm.com>
885         * machmode.h (mode_to_bits): Return a poly_uint16 rather than an
886         unsigned short.
887         (GET_MODE_BITSIZE): Return a constant if ONLY_FIXED_SIZE_MODES,
888         or if measurement_type is polynomial.
889         * calls.c (shift_return_value): Treat GET_MODE_BITSIZE as polynomial.
890         * combine.c (make_extraction): Likewise.
891         * dse.c (find_shift_sequence): Likewise.
892         * dwarf2out.c (mem_loc_descriptor): Likewise.
893         * expmed.c (store_integral_bit_field, extract_bit_field_1): Likewise.
894         (extract_bit_field, extract_low_bits): Likewise.
895         * expr.c (convert_move, convert_modes, emit_move_insn_1): Likewise.
896         (optimize_bitfield_assignment_op, expand_assignment): Likewise.
897         (store_expr_with_bounds, store_field, expand_expr_real_1): Likewise.
898         * fold-const.c (optimize_bit_field_compare, merge_ranges): Likewise.
899         * gimple-fold.c (optimize_atomic_compare_exchange_p): Likewise.
900         * reload.c (find_reloads): Likewise.
901         * reload1.c (alter_reg): Likewise.
902         * stor-layout.c (bitwise_mode_for_mode, compute_record_mode): Likewise.
903         * targhooks.c (default_secondary_memory_needed_mode): Likewise.
904         * tree-if-conv.c (predicate_mem_writes): Likewise.
905         * tree-ssa-strlen.c (handle_builtin_memcmp): Likewise.
906         * tree-vect-patterns.c (adjust_bool_pattern): Likewise.
907         * tree-vect-stmts.c (vectorizable_simd_clone_call): Likewise.
908         * valtrack.c (dead_debug_insert_temp): Likewise.
909         * varasm.c (mergeable_constant_section): Likewise.
910         * config/sh/sh.h (LOCAL_ALIGNMENT): Use as_a <fixed_size_mode>.
912 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
913             Alan Hayward  <alan.hayward@arm.com>
914             David Sherwood  <david.sherwood@arm.com>
916         * expr.c (expand_assignment): Cope with polynomial mode sizes
917         when assigning to a CONCAT.
919 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
920             Alan Hayward  <alan.hayward@arm.com>
921             David Sherwood  <david.sherwood@arm.com>
923         * machmode.h (mode_precision): Change from unsigned short to
924         poly_uint16_pod.
925         (mode_to_precision): Return a poly_uint16 rather than an unsigned
926         short.
927         (GET_MODE_PRECISION): Return a constant if ONLY_FIXED_SIZE_MODES,
928         or if measurement_type is not polynomial.
929         (HWI_COMPUTABLE_MODE_P): Turn into a function.  Optimize the case
930         in which the mode is already known to be a scalar_int_mode.
931         * genmodes.c (emit_mode_precision): Change the type of mode_precision
932         from unsigned short to poly_uint16_pod.  Use ZERO_COEFFS for the
933         initializer.
934         * lto-streamer-in.c (lto_input_mode_table): Use bp_unpack_poly_value
935         for GET_MODE_PRECISION.
936         * lto-streamer-out.c (lto_write_mode_table): Use bp_pack_poly_value
937         for GET_MODE_PRECISION.
938         * combine.c (update_rsp_from_reg_equal): Treat GET_MODE_PRECISION
939         as polynomial.
940         (try_combine, find_split_point, combine_simplify_rtx): Likewise.
941         (expand_field_assignment, make_extraction): Likewise.
942         (make_compound_operation_int, record_dead_and_set_regs_1): Likewise.
943         (get_last_value): Likewise.
944         * convert.c (convert_to_integer_1): Likewise.
945         * cse.c (cse_insn): Likewise.
946         * expr.c (expand_expr_real_1): Likewise.
947         * lra-constraints.c (simplify_operand_subreg): Likewise.
948         * optabs-query.c (can_atomic_load_p): Likewise.
949         * optabs.c (expand_atomic_load): Likewise.
950         (expand_atomic_store): Likewise.
951         * ree.c (combine_reaching_defs): Likewise.
952         * rtl.h (partial_subreg_p, paradoxical_subreg_p): Likewise.
953         * rtlanal.c (nonzero_bits1, lsb_bitfield_op_p): Likewise.
954         * tree.h (type_has_mode_precision_p): Likewise.
955         * ubsan.c (instrument_si_overflow): Likewise.
957 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
958             Alan Hayward  <alan.hayward@arm.com>
959             David Sherwood  <david.sherwood@arm.com>
961         * tree.h (TYPE_VECTOR_SUBPARTS): Turn into a function and handle
962         polynomial numbers of units.
963         (SET_TYPE_VECTOR_SUBPARTS): Likewise.
964         (valid_vector_subparts_p): New function.
965         (build_vector_type): Remove temporary shim and take the number
966         of units as a poly_uint64 rather than an int.
967         (build_opaque_vector_type): Take the number of units as a
968         poly_uint64 rather than an int.
969         * tree.c (build_vector_from_ctor): Handle polynomial
970         TYPE_VECTOR_SUBPARTS.
971         (type_hash_canon_hash, type_cache_hasher::equal): Likewise.
972         (uniform_vector_p, vector_type_mode, build_vector): Likewise.
973         (build_vector_from_val): If the number of units is variable,
974         use build_vec_duplicate_cst for constant operands and
975         VEC_DUPLICATE_EXPR otherwise.
976         (make_vector_type): Remove temporary is_constant ().
977         (build_vector_type, build_opaque_vector_type): Take the number of
978         units as a poly_uint64 rather than an int.
979         (check_vector_cst): Handle polynomial TYPE_VECTOR_SUBPARTS and
980         VECTOR_CST_NELTS.
981         * cfgexpand.c (expand_debug_expr): Likewise.
982         * expr.c (count_type_elements, categorize_ctor_elements_1): Likewise.
983         (store_constructor, expand_expr_real_1): Likewise.
984         (const_scalar_mask_from_tree): Likewise.
985         * fold-const-call.c (fold_const_reduction): Likewise.
986         * fold-const.c (const_binop, const_unop, fold_convert_const): Likewise.
987         (operand_equal_p, fold_vec_perm, fold_ternary_loc): Likewise.
988         (native_encode_vector, vec_cst_ctor_to_array): Likewise.
989         (fold_relational_const): Likewise.
990         (native_interpret_vector): Likewise.  Change the size from an
991         int to an unsigned int.
992         * gimple-fold.c (gimple_fold_stmt_to_constant_1): Handle polynomial
993         TYPE_VECTOR_SUBPARTS.
994         (gimple_fold_indirect_ref, gimple_build_vector): Likewise.
995         (gimple_build_vector_from_val): Use VEC_DUPLICATE_EXPR when
996         duplicating a non-constant operand into a variable-length vector.
997         * hsa-brig.c (hsa_op_immed::emit_to_buffer): Handle polynomial
998         TYPE_VECTOR_SUBPARTS and VECTOR_CST_NELTS.
999         * ipa-icf.c (sem_variable::equals): Likewise.
1000         * match.pd: Likewise.
1001         * omp-simd-clone.c (simd_clone_subparts): Likewise.
1002         * print-tree.c (print_node): Likewise.
1003         * stor-layout.c (layout_type): Likewise.
1004         * targhooks.c (default_builtin_vectorization_cost): Likewise.
1005         * tree-cfg.c (verify_gimple_comparison): Likewise.
1006         (verify_gimple_assign_binary): Likewise.
1007         (verify_gimple_assign_ternary): Likewise.
1008         (verify_gimple_assign_single): Likewise.
1009         * tree-pretty-print.c (dump_generic_node): Likewise.
1010         * tree-ssa-forwprop.c (simplify_vector_constructor): Likewise.
1011         (simplify_bitfield_ref, is_combined_permutation_identity): Likewise.
1012         * tree-vect-data-refs.c (vect_permute_store_chain): Likewise.
1013         (vect_grouped_load_supported, vect_permute_load_chain): Likewise.
1014         (vect_shift_permute_load_chain): Likewise.
1015         * tree-vect-generic.c (nunits_for_known_piecewise_op): Likewise.
1016         (expand_vector_condition, optimize_vector_constructor): Likewise.
1017         (lower_vec_perm, get_compute_type): Likewise.
1018         * tree-vect-loop.c (vect_determine_vectorization_factor): Likewise.
1019         (get_initial_defs_for_reduction, vect_transform_loop): Likewise.
1020         * tree-vect-patterns.c (vect_recog_bool_pattern): Likewise.
1021         (vect_recog_mask_conversion_pattern): Likewise.
1022         * tree-vect-slp.c (vect_supported_load_permutation_p): Likewise.
1023         (vect_get_constant_vectors, vect_transform_slp_perm_load): Likewise.
1024         * tree-vect-stmts.c (perm_mask_for_reverse): Likewise.
1025         (get_group_load_store_type, vectorizable_mask_load_store): Likewise.
1026         (vectorizable_bswap, simd_clone_subparts, vectorizable_assignment)
1027         (vectorizable_shift, vectorizable_operation, vectorizable_store)
1028         (vectorizable_load, vect_is_simple_cond, vectorizable_comparison)
1029         (supportable_widening_operation): Likewise.
1030         (supportable_narrowing_operation): Likewise.
1031         * tree-vector-builder.c (tree_vector_builder::binary_encoded_nelts):
1032         Likewise.
1033         * varasm.c (output_constant): Likewise.
1035 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1036             Alan Hayward  <alan.hayward@arm.com>
1037             David Sherwood  <david.sherwood@arm.com>
1039         * tree-vect-data-refs.c (vect_permute_store_chain): Reorganize
1040         so that both the length == 3 and length != 3 cases set up their
1041         own permute vectors.  Add comments explaining why we know the
1042         number of elements is constant.
1043         (vect_permute_load_chain): Likewise.
1045 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1046             Alan Hayward  <alan.hayward@arm.com>
1047             David Sherwood  <david.sherwood@arm.com>
1049         * machmode.h (mode_nunits): Change from unsigned char to
1050         poly_uint16_pod.
1051         (ONLY_FIXED_SIZE_MODES): New macro.
1052         (pod_mode::measurement_type, scalar_int_mode::measurement_type)
1053         (scalar_float_mode::measurement_type, scalar_mode::measurement_type)
1054         (complex_mode::measurement_type, fixed_size_mode::measurement_type):
1055         New typedefs.
1056         (mode_to_nunits): Return a poly_uint16 rather than an unsigned short.
1057         (GET_MODE_NUNITS): Return a constant if ONLY_FIXED_SIZE_MODES,
1058         or if measurement_type is not polynomial.
1059         * genmodes.c (ZERO_COEFFS): New macro.
1060         (emit_mode_nunits_inline): Make mode_nunits_inline return a
1061         poly_uint16.
1062         (emit_mode_nunits): Change the type of mode_nunits to poly_uint16_pod.
1063         Use ZERO_COEFFS when emitting initializers.
1064         * data-streamer.h (bp_pack_poly_value): New function.
1065         (bp_unpack_poly_value): Likewise.
1066         * lto-streamer-in.c (lto_input_mode_table): Use bp_unpack_poly_value
1067         for GET_MODE_NUNITS.
1068         * lto-streamer-out.c (lto_write_mode_table): Use bp_pack_poly_value
1069         for GET_MODE_NUNITS.
1070         * tree.c (make_vector_type): Remove temporary shim and make
1071         the real function take the number of units as a poly_uint64
1072         rather than an int.
1073         (build_vector_type_for_mode): Handle polynomial nunits.
1074         * dwarf2out.c (loc_descriptor, add_const_value_attribute): Likewise.
1075         * emit-rtl.c (const_vec_series_p_1): Likewise.
1076         (gen_rtx_CONST_VECTOR): Likewise.
1077         * fold-const.c (test_vec_duplicate_folding): Likewise.
1078         * genrecog.c (validate_pattern): Likewise.
1079         * optabs-query.c (can_vec_perm_var_p, can_mult_highpart_p): Likewise.
1080         * optabs-tree.c (expand_vec_cond_expr_p): Likewise.
1081         * optabs.c (expand_vector_broadcast, expand_binop_directly): Likewise.
1082         (shift_amt_for_vec_perm_mask, expand_vec_perm_var): Likewise.
1083         (expand_vec_cond_expr, expand_mult_highpart): Likewise.
1084         * rtlanal.c (subreg_get_info): Likewise.
1085         * tree-vect-data-refs.c (vect_grouped_store_supported): Likewise.
1086         (vect_grouped_load_supported): Likewise.
1087         * tree-vect-generic.c (type_for_widest_vector_mode): Likewise.
1088         * tree-vect-loop.c (have_whole_vector_shift): Likewise.
1089         * simplify-rtx.c (simplify_unary_operation_1): Likewise.
1090         (simplify_const_unary_operation, simplify_binary_operation_1)
1091         (simplify_const_binary_operation, simplify_ternary_operation)
1092         (test_vector_ops_duplicate, test_vector_ops): Likewise.
1093         (simplify_immed_subreg): Use GET_MODE_NUNITS on a fixed_size_mode
1094         instead of CONST_VECTOR_NUNITS.
1095         * varasm.c (output_constant_pool_2): Likewise.
1096         * rtx-vector-builder.c (rtx_vector_builder::build): Only include the
1097         explicit-encoded elements in the XVEC for variable-length vectors.
1099 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1101         * lra-constraints.c (curr_insn_transform): Use partial_subreg_p.
1103 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1104             Alan Hayward  <alan.hayward@arm.com>
1105             David Sherwood  <david.sherwood@arm.com>
1107         * coretypes.h (fixed_size_mode): Declare.
1108         (fixed_size_mode_pod): New typedef.
1109         * builtins.h (target_builtins::x_apply_args_mode)
1110         (target_builtins::x_apply_result_mode): Change type to
1111         fixed_size_mode_pod.
1112         * builtins.c (apply_args_size, apply_result_size, result_vector)
1113         (expand_builtin_apply_args_1, expand_builtin_apply)
1114         (expand_builtin_return): Update accordingly.
1116 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1118         * cse.c (hash_rtx_cb): Hash only the encoded elements.
1119         * cselib.c (cselib_hash_rtx): Likewise.
1120         * expmed.c (make_tree): Build VECTOR_CSTs directly from the
1121         CONST_VECTOR encoding.
1123 2017-01-03  Jakub Jelinek  <jakub@redhat.com>
1124             Jeff Law  <law@redhat.com>
1126         PR target/83641
1127         * config/i386/i386.c (ix86_adjust_stack_and_probe_stack_clash): For
1128         noreturn probe, use gen_pop instead of ix86_emit_restore_reg_using_pop,
1129         only set RTX_FRAME_RELATED_P on both the push and pop if cfa_reg is sp
1130         and add REG_CFA_ADJUST_CFA notes in that case to both insns.
1132         PR target/83641
1133         * config/i386/i386.c (ix86_adjust_stack_and_probe_stack_clash): Do not
1134         explicitly probe *sp in a noreturn function if there were any callee
1135         register saves or frame pointer is needed.
1137 2018-01-03  Jakub Jelinek  <jakub@redhat.com>
1139         PR debug/83621
1140         * cfgexpand.c (expand_debug_expr): Return NULL if mode is
1141         BLKmode for ternary, binary or unary expressions.
1143         PR debug/83645
1144         * var-tracking.c (delete_vta_debug_insn): New inline function.
1145         (delete_vta_debug_insns): Add USE_CFG argument, if true, walk just
1146         insns from get_insns () to NULL instead of each bb separately.
1147         Use delete_vta_debug_insn.  No longer static.
1148         (vt_debug_insns_local, variable_tracking_main_1): Adjust
1149         delete_vta_debug_insns callers.
1150         * rtl.h (delete_vta_debug_insns): Declare.
1151         * final.c (rest_of_handle_final): Call delete_vta_debug_insns
1152         instead of variable_tracking_main.
1154 2018-01-03  Martin Sebor  <msebor@redhat.com>
1156         PR tree-optimization/83603
1157         * calls.c (maybe_warn_nonstring_arg): Avoid accessing function
1158         arguments past the endof the argument list in functions declared
1159         without a prototype.
1160         * gimple-ssa-warn-restrict.c (wrestrict_dom_walker::check_call):
1161         Avoid checking when arguments are null.
1163 2018-01-03  Martin Sebor  <msebor@redhat.com>
1165         PR c/83559
1166         * doc/extend.texi (attribute const): Fix a typo.
1167         * ipa-pure-const.c ((warn_function_const, warn_function_pure): Avoid
1168         issuing -Wsuggest-attribute for void functions.
1170 2018-01-03  Martin Sebor  <msebor@redhat.com>
1172         * gimple-ssa-warn-restrict.c (builtin_memref::builtin_memref): Use
1173         offset_int::from instead of wide_int::to_shwi.
1174         (maybe_diag_overlap): Remove assertion.
1175         Use HOST_WIDE_INT_PRINT_DEC instead of %lli.
1176         * gimple-ssa-sprintf.c (format_directive): Same.
1177         (parse_directive): Same.
1178         (sprintf_dom_walker::compute_format_length): Same.
1179         (try_substitute_return_value): Same.
1181 2017-01-03  Jeff Law  <law@redhat.com>
1183         PR middle-end/83654
1184         * explow.c (anti_adjust_stack_and_probe_stack_clash): Test a
1185         non-constant residual for zero at runtime and avoid probing in
1186         that case.  Reorganize code for trailing problem to mirror handling
1187         of the residual.
1189 2018-01-03  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>
1191         PR tree-optimization/83501
1192         * tree-ssa-strlen.c (get_string_cst): New.
1193         (handle_char_store): Call get_string_cst.
1195 2018-01-03  Martin Liska  <mliska@suse.cz>
1197         PR tree-optimization/83593
1198         * tree-ssa-strlen.c: Include tree-cfg.h.
1199         (strlen_check_and_optimize_stmt): Add new argument cleanup_eh.
1200         (strlen_dom_walker): Add new member variable m_cleanup_cfg.
1201         (strlen_dom_walker::strlen_dom_walker): Initialize m_cleanup_cfg
1202         to false.
1203         (strlen_dom_walker::before_dom_children): Call
1204         gimple_purge_dead_eh_edges. Dump tranformation with details
1205         dump flags.
1206         (strlen_dom_walker::before_dom_children): Update call by adding
1207         new argument cleanup_eh.
1208         (pass_strlen::execute): Return TODO_cleanup_cfg if needed.
1210 2018-01-03  Martin Liska  <mliska@suse.cz>
1212         PR ipa/83549
1213         * cif-code.def (VARIADIC_THUNK): New enum value.
1214         * ipa-fnsummary.c (compute_fn_summary): Do not inline variadic
1215         thunks.
1217 2018-01-03  Jan Beulich  <jbeulich@suse.com>
1219         * sse.md (mov<mode>_internal): Tighten condition for when to use
1220         vmovdqu<ssescalarsize> for TI and OI modes.
1222 2018-01-03  Jakub Jelinek  <jakub@redhat.com>
1224         Update copyright years.
1226 2018-01-03  Martin Liska  <mliska@suse.cz>
1228         PR ipa/83594
1229         * ipa-visibility.c (function_and_variable_visibility): Skip
1230         functions with noipa attribure.
1232 2018-01-03  Jakub Jelinek  <jakub@redhat.com>
1234         * gcc.c (process_command): Update copyright notice dates.
1235         * gcov-dump.c (print_version): Ditto.
1236         * gcov.c (print_version): Ditto.
1237         * gcov-tool.c (print_version): Ditto.
1238         * gengtype.c (create_file): Ditto.
1239         * doc/cpp.texi: Bump @copying's copyright year.
1240         * doc/cppinternals.texi: Ditto.
1241         * doc/gcc.texi: Ditto.
1242         * doc/gccint.texi: Ditto.
1243         * doc/gcov.texi: Ditto.
1244         * doc/install.texi: Ditto.
1245         * doc/invoke.texi: Ditto.
1247 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1249         * vector-builder.h (vector_builder::m_full_nelts): Change from
1250         unsigned int to poly_uint64.
1251         (vector_builder::full_nelts): Update prototype accordingly.
1252         (vector_builder::new_vector): Likewise.
1253         (vector_builder::encoded_full_vector_p): Handle polynomial full_nelts.
1254         (vector_builder::operator ==): Likewise.
1255         (vector_builder::finalize): Likewise.
1256         * int-vector-builder.h (int_vector_builder::int_vector_builder):
1257         Take the number of elements as a poly_uint64 rather than an
1258         unsigned int.
1259         * vec-perm-indices.h (vec_perm_indices::m_nelts_per_input): Change
1260         from unsigned int to poly_uint64.
1261         (vec_perm_indices::vec_perm_indices): Update prototype accordingly.
1262         (vec_perm_indices::new_vector): Likewise.
1263         (vec_perm_indices::length): Likewise.
1264         (vec_perm_indices::nelts_per_input): Likewise.
1265         (vec_perm_indices::input_nelts): Likewise.
1266         * vec-perm-indices.c (vec_perm_indices::new_vector): Take the
1267         number of elements per input as a poly_uint64 rather than an
1268         unsigned int.  Use the original encoding for variable-length
1269         vectors, rather than clamping each individual element.
1270         For the second and subsequent elements in each pattern,
1271         clamp the step and base before clamping their sum.
1272         (vec_perm_indices::series_p): Handle polynomial element counts.
1273         (vec_perm_indices::all_in_range_p): Likewise.
1274         (vec_perm_indices_to_tree): Likewise.
1275         (vec_perm_indices_to_rtx): Likewise.
1276         * tree-vect-stmts.c (vect_gen_perm_mask_any): Likewise.
1277         * tree-vector-builder.c (tree_vector_builder::new_unary_operation)
1278         (tree_vector_builder::new_binary_operation): Handle polynomial
1279         element counts.  Return false if we need to know the number
1280         of elements at compile time.
1281         * fold-const.c (fold_vec_perm): Punt if the number of elements
1282         isn't known at compile time.
1284 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1286         * vec-perm-indices.h (vec_perm_builder): Change element type
1287         from HOST_WIDE_INT to poly_int64.
1288         (vec_perm_indices::element_type): Update accordingly.
1289         (vec_perm_indices::clamp): Handle polynomial element_types.
1290         * vec-perm-indices.c (vec_perm_indices::series_p): Likewise.
1291         (vec_perm_indices::all_in_range_p): Likewise.
1292         (tree_to_vec_perm_builder): Check for poly_int64 trees rather
1293         than shwi trees.
1294         * vector-builder.h (vector_builder::stepped_sequence_p): Handle
1295         polynomial vec_perm_indices element types.
1296         * int-vector-builder.h (int_vector_builder::equal_p): Likewise.
1297         * fold-const.c (fold_vec_perm): Likewise.
1298         * optabs.c (shift_amt_for_vec_perm_mask): Likewise.
1299         * tree-vect-generic.c (lower_vec_perm): Likewise.
1300         * tree-vect-slp.c (vect_transform_slp_perm_load): Likewise.
1301         * config/aarch64/aarch64.c (aarch64_evpc_tbl): Cast d->perm
1302         element type to HOST_WIDE_INT.
1304 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1305             Alan Hayward  <alan.hayward@arm.com>
1306             David Sherwood  <david.sherwood@arm.com>
1308         * alias.c (addr_side_effect_eval): Take the size as a poly_int64
1309         rather than an int.  Use plus_constant.
1310         (memrefs_conflict_p): Take the sizes as poly_int64s rather than ints.
1311         Take the offset "c" as a poly_int64 rather than a HOST_WIDE_INT.
1313 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1314             Alan Hayward  <alan.hayward@arm.com>
1315             David Sherwood  <david.sherwood@arm.com>
1317         * calls.c (emit_call_1, expand_call): Change struct_value_size from
1318         a HOST_WIDE_INT to a poly_int64.
1320 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1321             Alan Hayward  <alan.hayward@arm.com>
1322             David Sherwood  <david.sherwood@arm.com>
1324         * calls.c (load_register_parameters): Cope with polynomial
1325         mode sizes.  Require a constant size for BLKmode parameters
1326         that aren't described by a PARALLEL.  If BLOCK_REG_PADDING
1327         forces a parameter to be padded at the lsb end in order to
1328         fill a complete number of words, require the parameter size
1329         to be ordered wrt UNITS_PER_WORD.
1331 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1332             Alan Hayward  <alan.hayward@arm.com>
1333             David Sherwood  <david.sherwood@arm.com>
1335         * reload1.c (spill_stack_slot_width): Change element type
1336         from unsigned int to poly_uint64_pod.
1337         (alter_reg): Treat mode sizes as polynomial.
1339 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1340             Alan Hayward  <alan.hayward@arm.com>
1341             David Sherwood  <david.sherwood@arm.com>
1343         * reload.c (complex_word_subreg_p): New function.
1344         (reload_inner_reg_of_subreg, push_reload): Use it.
1346 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1347             Alan Hayward  <alan.hayward@arm.com>
1348             David Sherwood  <david.sherwood@arm.com>
1350         * lra-constraints.c (process_alt_operands): Reject matched
1351         operands whose sizes aren't ordered.
1352         (match_reload): Refer to this check here.
1354 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1355             Alan Hayward  <alan.hayward@arm.com>
1356             David Sherwood  <david.sherwood@arm.com>
1358         * builtins.c (expand_ifn_atomic_compare_exchange_into_call): Assert
1359         that the mode size is in the set {1, 2, 4, 8, 16}.
1361 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1362             Alan Hayward  <alan.hayward@arm.com>
1363             David Sherwood  <david.sherwood@arm.com>
1365         * var-tracking.c (adjust_mems): Treat mode sizes as polynomial.
1366         Use plus_constant instead of gen_rtx_PLUS.
1368 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1369             Alan Hayward  <alan.hayward@arm.com>
1370             David Sherwood  <david.sherwood@arm.com>
1372         * config/cr16/cr16-protos.h (cr16_push_rounding): Declare.
1373         * config/cr16/cr16.h (PUSH_ROUNDING): Move implementation to...
1374         * config/cr16/cr16.c (cr16_push_rounding): ...this new function.
1375         * config/h8300/h8300-protos.h (h8300_push_rounding): Declare.
1376         * config/h8300/h8300.h (PUSH_ROUNDING): Move implementation to...
1377         * config/h8300/h8300.c (h8300_push_rounding): ...this new function.
1378         * config/i386/i386-protos.h (ix86_push_rounding): Declare.
1379         * config/i386/i386.h (PUSH_ROUNDING): Move implementation to...
1380         * config/i386/i386.c (ix86_push_rounding): ...this new function.
1381         * config/m32c/m32c-protos.h (m32c_push_rounding): Take and return
1382         a poly_int64.
1383         * config/m32c/m32c.c (m32c_push_rounding): Likewise.
1384         * config/m68k/m68k-protos.h (m68k_push_rounding): Declare.
1385         * config/m68k/m68k.h (PUSH_ROUNDING): Move implementation to...
1386         * config/m68k/m68k.c (m68k_push_rounding): ...this new function.
1387         * config/pdp11/pdp11-protos.h (pdp11_push_rounding): Declare.
1388         * config/pdp11/pdp11.h (PUSH_ROUNDING): Move implementation to...
1389         * config/pdp11/pdp11.c (pdp11_push_rounding): ...this new function.
1390         * config/stormy16/stormy16-protos.h (xstormy16_push_rounding): Declare.
1391         * config/stormy16/stormy16.h (PUSH_ROUNDING): Move implementation to...
1392         * config/stormy16/stormy16.c (xstormy16_push_rounding): ...this new
1393         function.
1394         * expr.c (emit_move_resolve_push): Treat the input and result
1395         of PUSH_ROUNDING as a poly_int64.
1396         (emit_move_complex_push, emit_single_push_insn_1): Likewise.
1397         (emit_push_insn): Likewise.
1398         * lra-eliminations.c (mark_not_eliminable): Likewise.
1399         * recog.c (push_operand): Likewise.
1400         * reload1.c (elimination_effects): Likewise.
1401         * rtlanal.c (nonzero_bits1): Likewise.
1402         * calls.c (store_one_arg): Likewise.  Require the padding to be
1403         known at compile time.
1405 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1406             Alan Hayward  <alan.hayward@arm.com>
1407             David Sherwood  <david.sherwood@arm.com>
1409         * expr.c (emit_single_push_insn_1): Treat mode sizes as polynomial.
1410         Use plus_constant instead of gen_rtx_PLUS.
1412 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1413             Alan Hayward  <alan.hayward@arm.com>
1414             David Sherwood  <david.sherwood@arm.com>
1416         * auto-inc-dec.c (set_inc_state): Take the mode size as a poly_int64
1417         rather than an int.
1419 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1420             Alan Hayward  <alan.hayward@arm.com>
1421             David Sherwood  <david.sherwood@arm.com>
1423         * expr.c (expand_expr_real_1): Use tree_to_poly_uint64
1424         instead of int_size_in_bytes when handling VIEW_CONVERT_EXPRs
1425         via stack temporaries.  Treat the mode size as polynomial too.
1427 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1428             Alan Hayward  <alan.hayward@arm.com>
1429             David Sherwood  <david.sherwood@arm.com>
1431         * expr.c (expand_expr_real_2): When handling conversions involving
1432         unions, apply tree_to_poly_uint64 to the TYPE_SIZE rather than
1433         multiplying int_size_in_bytes by BITS_PER_UNIT.  Treat GET_MODE_BISIZE
1434         as a poly_uint64 too.
1436 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1437             Alan Hayward  <alan.hayward@arm.com>
1438             David Sherwood  <david.sherwood@arm.com>
1440         * rtlanal.c (subreg_get_info): Handle polynomial mode sizes.
1442 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1443             Alan Hayward  <alan.hayward@arm.com>
1444             David Sherwood  <david.sherwood@arm.com>
1446         * combine.c (can_change_dest_mode): Handle polynomial
1447         REGMODE_NATURAL_SIZE.
1448         * expmed.c (store_bit_field_1): Likewise.
1449         * expr.c (store_constructor): Likewise.
1450         * emit-rtl.c (validate_subreg): Operate on polynomial mode sizes
1451         and polynomial REGMODE_NATURAL_SIZE.
1452         (gen_lowpart_common): Likewise.
1453         * reginfo.c (record_subregs_of_mode): Likewise.
1454         * rtlanal.c (read_modify_subreg_p): Likewise.
1456 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1457             Alan Hayward  <alan.hayward@arm.com>
1458             David Sherwood  <david.sherwood@arm.com>
1460         * internal-fn.c (expand_vector_ubsan_overflow): Handle polynomial
1461         numbers of elements.
1463 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1464             Alan Hayward  <alan.hayward@arm.com>
1465             David Sherwood  <david.sherwood@arm.com>
1467         * match.pd: Cope with polynomial numbers of vector elements.
1469 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1470             Alan Hayward  <alan.hayward@arm.com>
1471             David Sherwood  <david.sherwood@arm.com>
1473         * fold-const.c (fold_indirect_ref_1): Handle polynomial offsets
1474         in a POINTER_PLUS_EXPR.
1476 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1477             Alan Hayward  <alan.hayward@arm.com>
1478             David Sherwood  <david.sherwood@arm.com>
1480         * omp-simd-clone.c (simd_clone_subparts): New function.
1481         (simd_clone_init_simd_arrays): Use it instead of TYPE_VECTOR_SUBPARTS.
1482         (ipa_simd_modify_function_body): Likewise.
1484 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1485             Alan Hayward  <alan.hayward@arm.com>
1486             David Sherwood  <david.sherwood@arm.com>
1488         * tree-vect-generic.c (nunits_for_known_piecewise_op): New function.
1489         (expand_vector_piecewise): Use it instead of TYPE_VECTOR_SUBPARTS.
1490         (expand_vector_addition, add_rshift, expand_vector_divmod): Likewise.
1491         (expand_vector_condition, vector_element): Likewise.
1492         (subparts_gt): New function.
1493         (get_compute_type): Use subparts_gt.
1494         (count_type_subparts): Delete.
1495         (expand_vector_operations_1): Use subparts_gt instead of
1496         count_type_subparts.
1498 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1499             Alan Hayward  <alan.hayward@arm.com>
1500             David Sherwood  <david.sherwood@arm.com>
1502         * tree-vect-data-refs.c (vect_no_alias_p): Replace with...
1503         (vect_compile_time_alias): ...this new function.  Do the calculation
1504         on poly_ints rather than trees.
1505         (vect_prune_runtime_alias_test_list): Update call accordingly.
1507 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1508             Alan Hayward  <alan.hayward@arm.com>
1509             David Sherwood  <david.sherwood@arm.com>
1511         * tree-vect-slp.c (vect_build_slp_tree_1): Handle polynomial
1512         numbers of units.
1513         (vect_schedule_slp_instance): Likewise.
1515 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1516             Alan Hayward  <alan.hayward@arm.com>
1517             David Sherwood  <david.sherwood@arm.com>
1519         * tree-vect-slp.c (vect_get_and_check_slp_defs): Reject
1520         constant and extern definitions for variable-length vectors.
1521         (vect_get_constant_vectors): Note that the number of units
1522         is known to be constant.
1524 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1525             Alan Hayward  <alan.hayward@arm.com>
1526             David Sherwood  <david.sherwood@arm.com>
1528         * tree-vect-stmts.c (vectorizable_conversion): Treat the number
1529         of units as polynomial.  Choose between WIDE and NARROW based
1530         on multiple_p.
1532 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1533             Alan Hayward  <alan.hayward@arm.com>
1534             David Sherwood  <david.sherwood@arm.com>
1536         * tree-vect-stmts.c (simd_clone_subparts): New function.
1537         (vectorizable_simd_clone_call): Use it instead of TYPE_VECTOR_SUBPARTS.
1539 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1540             Alan Hayward  <alan.hayward@arm.com>
1541             David Sherwood  <david.sherwood@arm.com>
1543         * tree-vect-stmts.c (vectorizable_call): Treat the number of
1544         vectors as polynomial.  Use build_index_vector for
1545         IFN_GOMP_SIMD_LANE.
1547 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1548             Alan Hayward  <alan.hayward@arm.com>
1549             David Sherwood  <david.sherwood@arm.com>
1551         * tree-vect-stmts.c (get_load_store_type): Treat the number of
1552         units as polynomial.  Reject VMAT_ELEMENTWISE and VMAT_STRIDED_SLP
1553         for variable-length vectors.
1554         (vectorizable_mask_load_store): Treat the number of units as
1555         polynomial, asserting that it is constant if the condition has
1556         already been enforced.
1557         (vectorizable_store, vectorizable_load): Likewise.
1559 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1560             Alan Hayward  <alan.hayward@arm.com>
1561             David Sherwood  <david.sherwood@arm.com>
1563         * tree-vect-loop.c (vectorizable_live_operation): Treat the number
1564         of units as polynomial.  Punt if we can't tell at compile time
1565         which vector contains the final result.
1567 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1568             Alan Hayward  <alan.hayward@arm.com>
1569             David Sherwood  <david.sherwood@arm.com>
1571         * tree-vect-loop.c (vectorizable_induction): Treat the number
1572         of units as polynomial.  Punt on SLP inductions.  Use an integer
1573         VEC_SERIES_EXPR for variable-length integer reductions.  Use a
1574         cast of such a series for variable-length floating-point
1575         reductions.
1577 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1578             Alan Hayward  <alan.hayward@arm.com>
1579             David Sherwood  <david.sherwood@arm.com>
1581         * tree.h (build_index_vector): Declare.
1582         * tree.c (build_index_vector): New function.
1583         * tree-vect-loop.c (get_initial_defs_for_reduction): Treat the number
1584         of units as polynomial, forcibly converting it to a constant if
1585         vectorizable_reduction has already enforced the condition.
1586         (vect_create_epilog_for_reduction): Likewise.  Use build_index_vector
1587         to create a {1,2,3,...} vector.
1588         (vectorizable_reduction): Treat the number of units as polynomial.
1589         Choose vectype_in based on the largest scalar element size rather
1590         than the smallest number of units.  Enforce the restrictions
1591         relied on above.
1593 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1594             Alan Hayward  <alan.hayward@arm.com>
1595             David Sherwood  <david.sherwood@arm.com>
1597         * tree-vect-data-refs.c (vector_alignment_reachable_p): Treat the
1598         number of units as polynomial.
1600 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1601             Alan Hayward  <alan.hayward@arm.com>
1602             David Sherwood  <david.sherwood@arm.com>
1604         * target.h (vector_sizes, auto_vector_sizes): New typedefs.
1605         * target.def (autovectorize_vector_sizes): Return the vector sizes
1606         by pointer, using vector_sizes rather than a bitmask.
1607         * targhooks.h (default_autovectorize_vector_sizes): Update accordingly.
1608         * targhooks.c (default_autovectorize_vector_sizes): Likewise.
1609         * config/aarch64/aarch64.c (aarch64_autovectorize_vector_sizes):
1610         Likewise.
1611         * config/arc/arc.c (arc_autovectorize_vector_sizes): Likewise.
1612         * config/arm/arm.c (arm_autovectorize_vector_sizes): Likewise.
1613         * config/i386/i386.c (ix86_autovectorize_vector_sizes): Likewise.
1614         * config/mips/mips.c (mips_autovectorize_vector_sizes): Likewise.
1615         * omp-general.c (omp_max_vf): Likewise.
1616         * omp-low.c (omp_clause_aligned_alignment): Likewise.
1617         * optabs-query.c (can_vec_mask_load_store_p): Likewise.
1618         * tree-vect-loop.c (vect_analyze_loop): Likewise.
1619         * tree-vect-slp.c (vect_slp_bb): Likewise.
1620         * doc/tm.texi: Regenerate.
1621         * tree-vectorizer.h (current_vector_size): Change from an unsigned int
1622         to a poly_uint64.
1623         * tree-vect-stmts.c (get_vectype_for_scalar_type_and_size): Take
1624         the vector size as a poly_uint64 rather than an unsigned int.
1625         (current_vector_size): Change from an unsigned int to a poly_uint64.
1626         (get_vectype_for_scalar_type): Update accordingly.
1627         * tree.h (build_truth_vector_type): Take the size and number of
1628         units as a poly_uint64 rather than an unsigned int.
1629         (build_vector_type): Add a temporary overload that takes
1630         the number of units as a poly_uint64 rather than an unsigned int.
1631         * tree.c (make_vector_type): Likewise.
1632         (build_truth_vector_type): Take the number of units as a poly_uint64
1633         rather than an unsigned int.
1635 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1636             Alan Hayward  <alan.hayward@arm.com>
1637             David Sherwood  <david.sherwood@arm.com>
1639         * target.def (get_mask_mode): Take the number of units and length
1640         as poly_uint64s rather than unsigned ints.
1641         * targhooks.h (default_get_mask_mode): Update accordingly.
1642         * targhooks.c (default_get_mask_mode): Likewise.
1643         * config/i386/i386.c (ix86_get_mask_mode): Likewise.
1644         * doc/tm.texi: Regenerate.
1646 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1647             Alan Hayward  <alan.hayward@arm.com>
1648             David Sherwood  <david.sherwood@arm.com>
1650         * omp-general.h (omp_max_vf): Return a poly_uint64 instead of an int.
1651         * omp-general.c (omp_max_vf): Likewise.
1652         * omp-expand.c (omp_adjust_chunk_size): Update call to omp_max_vf.
1653         (expand_omp_simd): Handle polynomial safelen.
1654         * omp-low.c (omplow_simd_context): Add a default constructor.
1655         (omplow_simd_context::max_vf): Change from int to poly_uint64.
1656         (lower_rec_simd_input_clauses): Update accordingly.
1657         (lower_rec_input_clauses): Likewise.
1659 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1660             Alan Hayward  <alan.hayward@arm.com>
1661             David Sherwood  <david.sherwood@arm.com>
1663         * tree-vectorizer.h (vect_nunits_for_cost): New function.
1664         * tree-vect-loop.c (vect_model_reduction_cost): Use it.
1665         * tree-vect-slp.c (vect_analyze_slp_cost_1): Likewise.
1666         (vect_analyze_slp_cost): Likewise.
1667         * tree-vect-stmts.c (vect_model_store_cost): Likewise.
1668         (vect_model_load_cost): Likewise.
1670 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1671             Alan Hayward  <alan.hayward@arm.com>
1672             David Sherwood  <david.sherwood@arm.com>
1674         * tree-vect-slp.c (vect_record_max_nunits, vect_build_slp_tree_1)
1675         (vect_build_slp_tree_2, vect_build_slp_tree): Change max_nunits
1676         from an unsigned int * to a poly_uint64_pod *.
1677         (calculate_unrolling_factor): New function.
1678         (vect_analyze_slp_instance): Use it.  Track polynomial max_nunits.
1680 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1681             Alan Hayward  <alan.hayward@arm.com>
1682             David Sherwood  <david.sherwood@arm.com>
1684         * tree-vectorizer.h (_slp_instance::unrolling_factor): Change
1685         from an unsigned int to a poly_uint64.
1686         (_loop_vec_info::slp_unrolling_factor): Likewise.
1687         (_loop_vec_info::vectorization_factor): Change from an int
1688         to a poly_uint64.
1689         (MAX_VECTORIZATION_FACTOR): Bump from 64 to INT_MAX.
1690         (vect_get_num_vectors): New function.
1691         (vect_update_max_nunits, vect_vf_for_cost): Likewise.
1692         (vect_get_num_copies): Use vect_get_num_vectors.
1693         (vect_analyze_data_ref_dependences): Change max_vf from an int *
1694         to an unsigned int *.
1695         (vect_analyze_data_refs): Change min_vf from an int * to a
1696         poly_uint64 *.
1697         (vect_transform_slp_perm_load): Take the vf as a poly_uint64 rather
1698         than an unsigned HOST_WIDE_INT.
1699         * tree-vect-data-refs.c (vect_analyze_possibly_independent_ddr)
1700         (vect_analyze_data_ref_dependence): Change max_vf from an int *
1701         to an unsigned int *.
1702         (vect_analyze_data_ref_dependences): Likewise.
1703         (vect_compute_data_ref_alignment): Handle polynomial vf.
1704         (vect_enhance_data_refs_alignment): Likewise.
1705         (vect_prune_runtime_alias_test_list): Likewise.
1706         (vect_shift_permute_load_chain): Likewise.
1707         (vect_supportable_dr_alignment): Likewise.
1708         (dependence_distance_ge_vf): Take the vectorization factor as a
1709         poly_uint64 rather than an unsigned HOST_WIDE_INT.
1710         (vect_analyze_data_refs): Change min_vf from an int * to a
1711         poly_uint64 *.
1712         * tree-vect-loop-manip.c (vect_gen_scalar_loop_niters): Take
1713         vfm1 as a poly_uint64 rather than an int.  Make the same change
1714         for the returned bound_scalar.
1715         (vect_gen_vector_loop_niters): Handle polynomial vf.
1716         (vect_do_peeling): Likewise.  Update call to
1717         vect_gen_scalar_loop_niters and handle polynomial bound_scalars.
1718         (vect_gen_vector_loop_niters_mult_vf): Assert that the vf must
1719         be constant.
1720         * tree-vect-loop.c (vect_determine_vectorization_factor)
1721         (vect_update_vf_for_slp, vect_analyze_loop_2): Handle polynomial vf.
1722         (vect_get_known_peeling_cost): Likewise.
1723         (vect_estimate_min_profitable_iters, vectorizable_reduction): Likewise.
1724         (vect_worthwhile_without_simd_p, vectorizable_induction): Likewise.
1725         (vect_transform_loop): Likewise.  Use the lowest possible VF when
1726         updating the upper bounds of the loop.
1727         (vect_min_worthwhile_factor): Make static.  Return an unsigned int
1728         rather than an int.
1729         * tree-vect-slp.c (vect_attempt_slp_rearrange_stmts): Cope with
1730         polynomial unroll factors.
1731         (vect_analyze_slp_cost_1, vect_analyze_slp_instance): Likewise.
1732         (vect_make_slp_decision): Likewise.
1733         (vect_supported_load_permutation_p): Likewise, and polynomial
1734         vf too.
1735         (vect_analyze_slp_cost): Handle polynomial vf.
1736         (vect_slp_analyze_node_operations): Likewise.
1737         (vect_slp_analyze_bb_1): Likewise.
1738         (vect_transform_slp_perm_load): Take the vf as a poly_uint64 rather
1739         than an unsigned HOST_WIDE_INT.
1740         * tree-vect-stmts.c (vectorizable_simd_clone_call, vectorizable_store)
1741         (vectorizable_load): Handle polynomial vf.
1742         * tree-vectorizer.c (simduid_to_vf::vf): Change from an int to
1743         a poly_uint64.
1744         (adjust_simduid_builtins, shrink_simd_arrays): Update accordingly.
1746 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1747             Alan Hayward  <alan.hayward@arm.com>
1748             David Sherwood  <david.sherwood@arm.com>
1750         * match.pd: Handle bit operations involving three constants
1751         and try to fold one pair.
1753 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1755         * tree-vect-loop-manip.c: Include gimple-fold.h.
1756         (slpeel_make_loop_iterate_ntimes): Add step, final_iv and
1757         niters_maybe_zero parameters.  Handle other cases besides a step of 1.
1758         (vect_gen_vector_loop_niters): Add a step_vector_ptr parameter.
1759         Add a path that uses a step of VF instead of 1, but disable it
1760         for now.
1761         (vect_do_peeling): Add step_vector, niters_vector_mult_vf_var
1762         and niters_no_overflow parameters.  Update calls to
1763         slpeel_make_loop_iterate_ntimes and vect_gen_vector_loop_niters.
1764         Create a new SSA name if the latter choses to use a ste other
1765         than zero, and return it via niters_vector_mult_vf_var.
1766         * tree-vect-loop.c (vect_transform_loop): Update calls to
1767         vect_do_peeling, vect_gen_vector_loop_niters and
1768         slpeel_make_loop_iterate_ntimes.
1769         * tree-vectorizer.h (slpeel_make_loop_iterate_ntimes, vect_do_peeling)
1770         (vect_gen_vector_loop_niters): Update declarations after above changes.
1772 2018-01-02  Michael Meissner  <meissner@linux.vnet.ibm.com>
1774         * config/rs6000/rs6000.md (floor<mode>2): Add support for IEEE
1775         128-bit round to integer instructions.
1776         (ceil<mode>2): Likewise.
1777         (btrunc<mode>2): Likewise.
1778         (round<mode>2): Likewise.
1780 2018-01-02  Aaron Sawdey  <acsawdey@linux.vnet.ibm.com>
1782         * config/rs6000/rs6000-string.c (expand_block_move): Allow the use of
1783         unaligned VSX load/store on P8/P9.
1784         (expand_block_clear): Allow the use of unaligned VSX
1785         load/store on P8/P9.
1787 2018-01-02  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
1789         * config/rs6000/rs6000-p8swap.c (swap_feeds_both_load_and_store):
1790         New function.
1791         (rs6000_analyze_swaps): Mark a web unoptimizable if it contains a
1792         swap associated with both a load and a store.
1794 2018-01-02  Andrew Waterman  <andrew@sifive.com>
1796         * config/riscv/linux.h (ICACHE_FLUSH_FUNC): New.
1797         * config/riscv/riscv.md (clear_cache): Use it.
1799 2018-01-02  Artyom Skrobov  <tyomitch@gmail.com>
1801         * web.c: Remove out-of-date comment.
1803 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
1805         * expr.c (fixup_args_size_notes): Check that any existing
1806         REG_ARGS_SIZE notes are correct, and don't try to re-add them.
1807         (emit_single_push_insn_1): Move stack_pointer_delta adjustment to...
1808         (emit_single_push_insn): ...here.
1810 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
1812         * rtl.h (CONST_VECTOR_ELT): Redefine to const_vector_elt.
1813         (const_vector_encoded_nelts): New function.
1814         (CONST_VECTOR_NUNITS): Redefine to use GET_MODE_NUNITS.
1815         (const_vector_int_elt, const_vector_elt): Declare.
1816         * emit-rtl.c (const_vector_int_elt_1): New function.
1817         (const_vector_elt): Likewise.
1818         * simplify-rtx.c (simplify_immed_subreg): Avoid taking the address
1819         of CONST_VECTOR_ELT.
1821 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
1823         * expr.c: Include rtx-vector-builder.h.
1824         (const_vector_mask_from_tree): Use rtx_vector_builder and operate
1825         directly on the tree encoding.
1826         (const_vector_from_tree): Likewise.
1827         * optabs.c: Include rtx-vector-builder.h.
1828         (expand_vec_perm_var): Use rtx_vector_builder and create a repeating
1829         sequence of "u" values.
1830         * vec-perm-indices.c: Include rtx-vector-builder.h.
1831         (vec_perm_indices_to_rtx): Use rtx_vector_builder and operate
1832         directly on the vec_perm_indices encoding.
1834 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
1836         * doc/rtl.texi (const_vector): Describe new encoding scheme.
1837         * Makefile.in (OBJS): Add rtx-vector-builder.o.
1838         * rtx-vector-builder.h: New file.
1839         * rtx-vector-builder.c: Likewise.
1840         * rtl.h (rtx_def::u2): Add a const_vector field.
1841         (CONST_VECTOR_NPATTERNS): New macro.
1842         (CONST_VECTOR_NELTS_PER_PATTERN): Likewise.
1843         (CONST_VECTOR_DUPLICATE_P): Likewise.
1844         (CONST_VECTOR_STEPPED_P): Likewise.
1845         (CONST_VECTOR_ENCODED_ELT): Likewise.
1846         (const_vec_duplicate_p): Check for a duplicated vector encoding.
1847         (unwrap_const_vec_duplicate): Likewise.
1848         (const_vec_series_p): Check for a non-duplicated vector encoding.
1849         Say that the function only returns true for integer vectors.
1850         * emit-rtl.c: Include rtx-vector-builder.h.
1851         (gen_const_vec_duplicate_1): Delete.
1852         (gen_const_vector): Call gen_const_vec_duplicate instead of
1853         gen_const_vec_duplicate_1.
1854         (const_vec_series_p_1): Operate directly on the CONST_VECTOR encoding.
1855         (gen_const_vec_duplicate): Use rtx_vector_builder.
1856         (gen_const_vec_series): Likewise.
1857         (gen_rtx_CONST_VECTOR): Likewise.
1858         * config/powerpcspe/powerpcspe.c: Include rtx-vector-builder.h.
1859         (swap_const_vector_halves): Take an rtx pointer rather than rtx.
1860         Build a new vector rather than modifying a CONST_VECTOR in-place.
1861         (handle_special_swappables): Update call accordingly.
1862         * config/rs6000/rs6000-p8swap.c: Include rtx-vector-builder.h.
1863         (swap_const_vector_halves): Take an rtx pointer rather than rtx.
1864         Build a new vector rather than modifying a CONST_VECTOR in-place.
1865         (handle_special_swappables): Update call accordingly.
1867 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
1869         * simplify-rtx.c (simplify_const_binary_operation): Use
1870         CONST_VECTOR_ELT instead of XVECEXP.
1872 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
1874         * tree-cfg.c (verify_gimple_assign_ternary): Allow the size of
1875         the selector elements to be different from the data elements
1876         if the selector is a VECTOR_CST.
1877         * tree-vect-stmts.c (vect_gen_perm_mask_any): Use a vector of
1878         ssizetype for the selector.
1880 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
1882         * optabs.c (shift_amt_for_vec_perm_mask): Try using series_p
1883         before testing each element individually.
1884         * tree-vect-generic.c (lower_vec_perm): Likewise.
1886 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
1888         * selftest.h (selftest::vec_perm_indices_c_tests): Declare.
1889         * selftest-run-tests.c (selftest::run_tests): Call it.
1890         * vector-builder.h (vector_builder::operator ==): New function.
1891         (vector_builder::operator !=): Likewise.
1892         * vec-perm-indices.h (vec_perm_indices::series_p): Declare.
1893         (vec_perm_indices::all_from_input_p): New function.
1894         * vec-perm-indices.c (vec_perm_indices::series_p): Likewise.
1895         (test_vec_perm_12, selftest::vec_perm_indices_c_tests): Likewise.
1896         * fold-const.c (fold_ternary_loc): Use tree_to_vec_perm_builder
1897         instead of reading the VECTOR_CST directly.  Detect whether both
1898         vector inputs are the same before constructing the vec_perm_indices,
1899         and update the number of inputs argument accordingly.  Use the
1900         utility functions added above.  Only construct sel2 if we need to.
1902 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
1904         * optabs.c (expand_vec_perm_var): Use an explicit encoding for
1905         the broadcast of the low byte.
1906         (expand_mult_highpart): Use an explicit encoding for the permutes.
1907         * optabs-query.c (can_mult_highpart_p): Likewise.
1908         * tree-vect-loop.c (calc_vec_perm_mask_for_shift): Likewise.
1909         * tree-vect-stmts.c (perm_mask_for_reverse): Likewise.
1910         (vectorizable_bswap): Likewise.
1911         * tree-vect-data-refs.c (vect_grouped_store_supported): Use an
1912         explicit encoding for the power-of-2 permutes.
1913         (vect_permute_store_chain): Likewise.
1914         (vect_grouped_load_supported): Likewise.
1915         (vect_permute_load_chain): Likewise.
1917 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
1919         * vec-perm-indices.h (vec_perm_indices_to_tree): Declare.
1920         * vec-perm-indices.c (vec_perm_indices_to_tree): New function.
1921         * tree-ssa-forwprop.c (simplify_vector_constructor): Use it.
1922         * tree-vect-slp.c (vect_transform_slp_perm_load): Likewise.
1923         * tree-vect-stmts.c (vectorizable_bswap): Likewise.
1924         (vect_gen_perm_mask_any): Likewise.
1926 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
1928         * int-vector-builder.h: New file.
1929         * vec-perm-indices.h: Include int-vector-builder.h.
1930         (vec_perm_indices): Redefine as an int_vector_builder.
1931         (auto_vec_perm_indices): Delete.
1932         (vec_perm_builder): Redefine as a stand-alone class.
1933         (vec_perm_indices::vec_perm_indices): New function.
1934         (vec_perm_indices::clamp): Likewise.
1935         * vec-perm-indices.c: Include fold-const.h and tree-vector-builder.h.
1936         (vec_perm_indices::new_vector): New function.
1937         (vec_perm_indices::new_expanded_vector): Update for new
1938         vec_perm_indices class.
1939         (vec_perm_indices::rotate_inputs): New function.
1940         (vec_perm_indices::all_in_range_p): Operate directly on the
1941         encoded form, without computing elided elements.
1942         (tree_to_vec_perm_builder): Operate directly on the VECTOR_CST
1943         encoding.  Update for new vec_perm_indices class.
1944         * optabs.c (expand_vec_perm_const): Create a vec_perm_indices for
1945         the given vec_perm_builder.
1946         (expand_vec_perm_var): Update vec_perm_builder constructor.
1947         (expand_mult_highpart): Use vec_perm_builder instead of
1948         auto_vec_perm_indices.
1949         * optabs-query.c (can_mult_highpart_p): Use vec_perm_builder and
1950         vec_perm_indices instead of auto_vec_perm_indices.  Use a single
1951         or double series encoding as appropriate.
1952         * fold-const.c (fold_ternary_loc): Use vec_perm_builder and
1953         vec_perm_indices instead of auto_vec_perm_indices.
1954         * tree-ssa-forwprop.c (simplify_vector_constructor): Likewise.
1955         * tree-vect-data-refs.c (vect_grouped_store_supported): Likewise.
1956         (vect_permute_store_chain): Likewise.
1957         (vect_grouped_load_supported): Likewise.
1958         (vect_permute_load_chain): Likewise.
1959         (vect_shift_permute_load_chain): Likewise.
1960         * tree-vect-slp.c (vect_build_slp_tree_1): Likewise.
1961         (vect_transform_slp_perm_load): Likewise.
1962         (vect_schedule_slp_instance): Likewise.
1963         * tree-vect-stmts.c (perm_mask_for_reverse): Likewise.
1964         (vectorizable_mask_load_store): Likewise.
1965         (vectorizable_bswap): Likewise.
1966         (vectorizable_store): Likewise.
1967         (vectorizable_load): Likewise.
1968         * tree-vect-generic.c (lower_vec_perm): Use vec_perm_builder and
1969         vec_perm_indices instead of auto_vec_perm_indices.  Use
1970         tree_to_vec_perm_builder to read the vector from a tree.
1971         * tree-vect-loop.c (calc_vec_perm_mask_for_shift): Take a
1972         vec_perm_builder instead of a vec_perm_indices.
1973         (have_whole_vector_shift): Use vec_perm_builder and
1974         vec_perm_indices instead of auto_vec_perm_indices.  Leave the
1975         truncation to calc_vec_perm_mask_for_shift.
1976         (vect_create_epilog_for_reduction): Likewise.
1977         * config/aarch64/aarch64.c (expand_vec_perm_d::perm): Change
1978         from auto_vec_perm_indices to vec_perm_indices.
1979         (aarch64_expand_vec_perm_const_1): Use rotate_inputs on d.perm
1980         instead of changing individual elements.
1981         (aarch64_vectorize_vec_perm_const): Use new_vector to install
1982         the vector in d.perm.
1983         * config/arm/arm.c (expand_vec_perm_d::perm): Change
1984         from auto_vec_perm_indices to vec_perm_indices.
1985         (arm_expand_vec_perm_const_1): Use rotate_inputs on d.perm
1986         instead of changing individual elements.
1987         (arm_vectorize_vec_perm_const): Use new_vector to install
1988         the vector in d.perm.
1989         * config/powerpcspe/powerpcspe.c (rs6000_expand_extract_even):
1990         Update vec_perm_builder constructor.
1991         (rs6000_expand_interleave): Likewise.
1992         * config/rs6000/rs6000.c (rs6000_expand_extract_even): Likewise.
1993         (rs6000_expand_interleave): Likewise.
1995 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
1997         * optabs-query.c (can_vec_perm_var_p): Check whether lowering
1998         to qimode could truncate the indices.
1999         * optabs.c (expand_vec_perm_var): Likewise.
2001 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
2003         * Makefile.in (OBJS): Add vec-perm-indices.o.
2004         * vec-perm-indices.h: New file.
2005         * vec-perm-indices.c: Likewise.
2006         * target.h (vec_perm_indices): Replace with a forward class
2007         declaration.
2008         (auto_vec_perm_indices): Move to vec-perm-indices.h.
2009         * optabs.h: Include vec-perm-indices.h.
2010         (expand_vec_perm): Delete.
2011         (selector_fits_mode_p, expand_vec_perm_var): Declare.
2012         (expand_vec_perm_const): Declare.
2013         * target.def (vec_perm_const_ok): Replace with...
2014         (vec_perm_const): ...this new hook.
2015         * doc/tm.texi.in (TARGET_VECTORIZE_VEC_PERM_CONST_OK): Replace with...
2016         (TARGET_VECTORIZE_VEC_PERM_CONST): ...this new hook.
2017         * doc/tm.texi: Regenerate.
2018         * optabs.def (vec_perm_const): Delete.
2019         * doc/md.texi (vec_perm_const): Likewise.
2020         (vec_perm): Refer to TARGET_VECTORIZE_VEC_PERM_CONST.
2021         * expr.c (expand_expr_real_2): Use expand_vec_perm_const rather than
2022         expand_vec_perm for constant permutation vectors.  Assert that
2023         the mode of variable permutation vectors is the integer equivalent
2024         of the mode that is being permuted.
2025         * optabs-query.h (selector_fits_mode_p): Declare.
2026         * optabs-query.c: Include vec-perm-indices.h.
2027         (selector_fits_mode_p): New function.
2028         (can_vec_perm_const_p): Check whether targetm.vectorize.vec_perm_const
2029         is defined, instead of checking whether the vec_perm_const_optab
2030         exists.  Use targetm.vectorize.vec_perm_const instead of
2031         targetm.vectorize.vec_perm_const_ok.  Check whether the indices
2032         fit in the vector mode before using a variable permute.
2033         * optabs.c (shift_amt_for_vec_perm_mask): Take a mode and a
2034         vec_perm_indices instead of an rtx.
2035         (expand_vec_perm): Replace with...
2036         (expand_vec_perm_const): ...this new function.  Take the selector
2037         as a vec_perm_indices rather than an rtx.  Also take the mode of
2038         the selector.  Update call to shift_amt_for_vec_perm_mask.
2039         Use targetm.vectorize.vec_perm_const instead of vec_perm_const_optab.
2040         Use vec_perm_indices::new_expanded_vector to expand the original
2041         selector into bytes.  Check whether the indices fit in the vector
2042         mode before using a variable permute.
2043         (expand_vec_perm_var): Make global.
2044         (expand_mult_highpart): Use expand_vec_perm_const.
2045         * fold-const.c: Includes vec-perm-indices.h.
2046         * tree-ssa-forwprop.c: Likewise.
2047         * tree-vect-data-refs.c: Likewise.
2048         * tree-vect-generic.c: Likewise.
2049         * tree-vect-loop.c: Likewise.
2050         * tree-vect-slp.c: Likewise.
2051         * tree-vect-stmts.c: Likewise.
2052         * config/aarch64/aarch64-protos.h (aarch64_expand_vec_perm_const):
2053         Delete.
2054         * config/aarch64/aarch64-simd.md (vec_perm_const<mode>): Delete.
2055         * config/aarch64/aarch64.c (aarch64_expand_vec_perm_const)
2056         (aarch64_vectorize_vec_perm_const_ok): Fuse into...
2057         (aarch64_vectorize_vec_perm_const): ...this new function.
2058         (TARGET_VECTORIZE_VEC_PERM_CONST_OK): Delete.
2059         (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
2060         * config/arm/arm-protos.h (arm_expand_vec_perm_const): Delete.
2061         * config/arm/vec-common.md (vec_perm_const<mode>): Delete.
2062         * config/arm/arm.c (TARGET_VECTORIZE_VEC_PERM_CONST_OK): Delete.
2063         (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
2064         (arm_expand_vec_perm_const, arm_vectorize_vec_perm_const_ok): Merge
2065         into...
2066         (arm_vectorize_vec_perm_const): ...this new function.  Explicitly
2067         check for NEON modes.
2068         * config/i386/i386-protos.h (ix86_expand_vec_perm_const): Delete.
2069         * config/i386/sse.md (VEC_PERM_CONST, vec_perm_const<mode>): Delete.
2070         * config/i386/i386.c (ix86_expand_vec_perm_const_1): Update comment.
2071         (ix86_expand_vec_perm_const, ix86_vectorize_vec_perm_const_ok): Merge
2072         into...
2073         (ix86_vectorize_vec_perm_const): ...this new function.  Incorporate
2074         the old VEC_PERM_CONST conditions.
2075         * config/ia64/ia64-protos.h (ia64_expand_vec_perm_const): Delete.
2076         * config/ia64/vect.md (vec_perm_const<mode>): Delete.
2077         * config/ia64/ia64.c (ia64_expand_vec_perm_const)
2078         (ia64_vectorize_vec_perm_const_ok): Merge into...
2079         (ia64_vectorize_vec_perm_const): ...this new function.
2080         * config/mips/loongson.md (vec_perm_const<mode>): Delete.
2081         * config/mips/mips-msa.md (vec_perm_const<mode>): Delete.
2082         * config/mips/mips-ps-3d.md (vec_perm_constv2sf): Delete.
2083         * config/mips/mips-protos.h (mips_expand_vec_perm_const): Delete.
2084         * config/mips/mips.c (mips_expand_vec_perm_const)
2085         (mips_vectorize_vec_perm_const_ok): Merge into...
2086         (mips_vectorize_vec_perm_const): ...this new function.
2087         * config/powerpcspe/altivec.md (vec_perm_constv16qi): Delete.
2088         * config/powerpcspe/paired.md (vec_perm_constv2sf): Delete.
2089         * config/powerpcspe/spe.md (vec_perm_constv2si): Delete.
2090         * config/powerpcspe/vsx.md (vec_perm_const<mode>): Delete.
2091         * config/powerpcspe/powerpcspe-protos.h (altivec_expand_vec_perm_const)
2092         (rs6000_expand_vec_perm_const): Delete.
2093         * config/powerpcspe/powerpcspe.c (TARGET_VECTORIZE_VEC_PERM_CONST_OK):
2094         Delete.
2095         (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
2096         (altivec_expand_vec_perm_const_le): Take each operand individually.
2097         Operate on constant selectors rather than rtxes.
2098         (altivec_expand_vec_perm_const): Likewise.  Update call to
2099         altivec_expand_vec_perm_const_le.
2100         (rs6000_expand_vec_perm_const): Delete.
2101         (rs6000_vectorize_vec_perm_const_ok): Delete.
2102         (rs6000_vectorize_vec_perm_const): New function.
2103         (rs6000_do_expand_vec_perm): Take a vec_perm_builder instead of
2104         an element count and rtx array.
2105         (rs6000_expand_extract_even): Update call accordingly.
2106         (rs6000_expand_interleave): Likewise.
2107         * config/rs6000/altivec.md (vec_perm_constv16qi): Delete.
2108         * config/rs6000/paired.md (vec_perm_constv2sf): Delete.
2109         * config/rs6000/vsx.md (vec_perm_const<mode>): Delete.
2110         * config/rs6000/rs6000-protos.h (altivec_expand_vec_perm_const)
2111         (rs6000_expand_vec_perm_const): Delete.
2112         * config/rs6000/rs6000.c (TARGET_VECTORIZE_VEC_PERM_CONST_OK): Delete.
2113         (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
2114         (altivec_expand_vec_perm_const_le): Take each operand individually.
2115         Operate on constant selectors rather than rtxes.
2116         (altivec_expand_vec_perm_const): Likewise.  Update call to
2117         altivec_expand_vec_perm_const_le.
2118         (rs6000_expand_vec_perm_const): Delete.
2119         (rs6000_vectorize_vec_perm_const_ok): Delete.
2120         (rs6000_vectorize_vec_perm_const): New function.  Remove stray
2121         reference to the SPE evmerge intructions.
2122         (rs6000_do_expand_vec_perm): Take a vec_perm_builder instead of
2123         an element count and rtx array.
2124         (rs6000_expand_extract_even): Update call accordingly.
2125         (rs6000_expand_interleave): Likewise.
2126         * config/sparc/sparc.md (vec_perm_constv8qi): Delete in favor of...
2127         * config/sparc/sparc.c (sparc_vectorize_vec_perm_const): ...this
2128         new function.
2129         (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
2131 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
2133         * optabs.c (expand_vec_perm_1): Assert that SEL has an integer
2134         vector mode and that that mode matches the mode of the data
2135         being permuted.
2136         (expand_vec_perm): Split handling of non-CONST_VECTOR selectors
2137         out into expand_vec_perm_var.  Do all CONST_VECTOR handling here,
2138         directly using expand_vec_perm_1 when forcing selectors into
2139         registers.
2140         (expand_vec_perm_var): New function, split out from expand_vec_perm.
2142 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
2144         * optabs-query.h (can_vec_perm_p): Delete.
2145         (can_vec_perm_var_p, can_vec_perm_const_p): Declare.
2146         * optabs-query.c (can_vec_perm_p): Split into...
2147         (can_vec_perm_var_p, can_vec_perm_const_p): ...these two functions.
2148         (can_mult_highpart_p): Use can_vec_perm_const_p to test whether a
2149         particular selector is valid.
2150         * tree-ssa-forwprop.c (simplify_vector_constructor): Likewise.
2151         * tree-vect-data-refs.c (vect_grouped_store_supported): Likewise.
2152         (vect_grouped_load_supported): Likewise.
2153         (vect_shift_permute_load_chain): Likewise.
2154         * tree-vect-slp.c (vect_build_slp_tree_1): Likewise.
2155         (vect_transform_slp_perm_load): Likewise.
2156         * tree-vect-stmts.c (perm_mask_for_reverse): Likewise.
2157         (vectorizable_bswap): Likewise.
2158         (vect_gen_perm_mask_checked): Likewise.
2159         * fold-const.c (fold_ternary_loc): Likewise.  Don't take
2160         implementations of variable permutation vectors into account
2161         when deciding which selector to use.
2162         * tree-vect-loop.c (have_whole_vector_shift): Don't check whether
2163         vec_perm_const_optab is supported; instead use can_vec_perm_const_p
2164         with a false third argument.
2165         * tree-vect-generic.c (lower_vec_perm): Use can_vec_perm_const_p
2166         to test whether the constant selector is valid and can_vec_perm_var_p
2167         to test whether a variable selector is valid.
2169 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
2171         * optabs-query.h (can_vec_perm_p): Take a const vec_perm_indices *.
2172         * optabs-query.c (can_vec_perm_p): Likewise.
2173         * fold-const.c (fold_vec_perm): Take a const vec_perm_indices &
2174         instead of vec_perm_indices.
2175         * tree-vectorizer.h (vect_gen_perm_mask_any): Likewise,
2176         (vect_gen_perm_mask_checked): Likewise,
2177         * tree-vect-stmts.c (vect_gen_perm_mask_any): Likewise,
2178         (vect_gen_perm_mask_checked): Likewise,
2180 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
2182         * optabs-query.h (qimode_for_vec_perm): Declare.
2183         * optabs-query.c (can_vec_perm_p): Split out qimode search to...
2184         (qimode_for_vec_perm): ...this new function.
2185         * optabs.c (expand_vec_perm): Use qimode_for_vec_perm.
2187 2018-01-02  Aaron Sawdey  <acsawdey@linux.vnet.ibm.com>
2189         * rtlanal.c (canonicalize_condition): Return 0 if final rtx
2190         does not have a conditional at the top.
2192 2018-01-02  Richard Biener  <rguenther@suse.de>
2194         * ipa-inline.c (big_speedup_p): Fix expression.
2196 2018-01-02  Jan Hubicka  <hubicka@ucw.cz>
2198         PR target/81616
2199         * config/i386/x86-tune-costs.h: Increase cost of integer load costs
2200         for generic 4->6.
2202 2018-01-02  Jan Hubicka  <hubicka@ucw.cz>
2204         PR target/81616
2205         Generic tuning.
2206         * x86-tune-costs.h (generic_cost): Reduce cost of FDIV 20->17,
2207         cost of sqrt 20->14, DIVSS 18->13, DIVSD 32->17, SQRtSS 30->14
2208         and SQRTsD 58->18, cond_not_taken_branch_cost. 2->1. Increase
2209         cond_taken_branch_cost 3->4.
2211 2018-01-01  Jakub Jelinek  <jakub@redhat.com>
2213         PR tree-optimization/83581
2214         * tree-loop-distribution.c (pass_loop_distribution::execute): Return
2215         TODO_cleanup_cfg if any changes have been made.
2217         PR middle-end/83608
2218         * expr.c (store_expr_with_bounds): Use simplify_gen_subreg instead of
2219         convert_modes if target mode has the right side, but different mode
2220         class.
2222         PR middle-end/83609
2223         * expr.c (expand_assignment): Fix up a typo in simplify_gen_subreg
2224         last argument when extracting from CONCAT.  If either from_real or
2225         from_imag is NULL, use expansion through memory.  If result is not
2226         a CONCAT and simplify_gen_subreg fails, try to simplify_gen_subreg
2227         the parts directly to inner mode, if even that fails, use expansion
2228         through memory.
2230         PR middle-end/83623
2231         * expmed.c (expand_shift_1): For 2-byte rotates by BITS_PER_UNIT,
2232         check for bswap in mode rather than HImode and use that in expand_unop
2233         too.
2235 Copyright (C) 2018 Free Software Foundation, Inc.
2237 Copying and distribution of this file, with or without modification,
2238 are permitted in any medium without royalty provided the copyright
2239 notice and this notice are preserved.