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