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