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