Improve canonicalisation of TARGET_MEM_REFs
[official-gcc.git] / gcc / ChangeLog
blob561fd708dae5ab25fad58b67daee80de347d59c2
1 2018-01-13  Richard Sandiford  <richard.sandiford@linaro.org>
2             Alan Hayward  <alan.hayward@arm.com>
3             David Sherwood  <david.sherwood@arm.com>
5         * tree-ssa-address.c (mem_ref_valid_without_offset_p): New function.
6         (add_offset_to_base): New function, split out from...
7         (create_mem_ref): ...here.  When handling a scale other than 1,
8         check first whether the address is valid without the offset.
9         Add it into the base if so, leaving the index and scale as-is.
11 2018-01-12  Jakub Jelinek  <jakub@redhat.com>
13         PR c++/83778
14         * config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin): Call
15         fold_for_warn before checking if arg2 is INTEGER_CST.
17 2018-01-12  Segher Boessenkool  <segher@kernel.crashing.org>
19         * config/rs6000/predicates.md (load_multiple_operation): Delete.
20         (store_multiple_operation): Delete.
21         * config/rs6000/rs6000-cpus.def (601): Remove MASK_STRING.
22         * config/rs6000/rs6000-protos.h (rs6000_output_load_multiple): Delete.
23         * config/rs6000/rs6000-string.c (expand_block_move): Delete everything
24         guarded by TARGET_STRING.
25         (rs6000_output_load_multiple): Delete.
26         * config/rs6000/rs6000.c (rs6000_option_override_internal): Delete
27         OPTION_MASK_STRING / TARGET_STRING handling.
28         (print_operand) <'N', 'O'>: Add comment that these are unused now.
29         (const rs6000_opt_masks) <"string">: Change mask to 0.
30         * config/rs6000/rs6000.h (TARGET_DEFAULT): Remove MASK_STRING.
31         (MASK_STRING): Delete.
32         * config/rs6000/rs6000.md (*mov<mode>_string): Delete TARGET_STRING
33         parts.  Simplify.
34         (load_multiple): Delete.
35         (*ldmsi8): Delete.
36         (*ldmsi7): Delete.
37         (*ldmsi6): Delete.
38         (*ldmsi5): Delete.
39         (*ldmsi4): Delete.
40         (*ldmsi3): Delete.
41         (store_multiple): Delete.
42         (*stmsi8): Delete.
43         (*stmsi7): Delete.
44         (*stmsi6): Delete.
45         (*stmsi5): Delete.
46         (*stmsi4): Delete.
47         (*stmsi3): Delete.
48         (movmemsi_8reg): Delete.
49         (corresponding unnamed define_insn): Delete.
50         (movmemsi_6reg): Delete.
51         (corresponding unnamed define_insn): Delete.
52         (movmemsi_4reg): Delete.
53         (corresponding unnamed define_insn): Delete.
54         (movmemsi_2reg): Delete.
55         (corresponding unnamed define_insn): Delete.
56         (movmemsi_1reg): Delete.
57         (corresponding unnamed define_insn): Delete.
58         * config/rs6000/rs6000.opt (mno-string): New.
59         (mstring): Replace by deprecation warning stub.
60         * doc/invoke.texi (RS/6000 and PowerPC Options): Delete -mstring.
62 2018-01-12  Jakub Jelinek  <jakub@redhat.com>
64         * regrename.c (regrename_do_replace): If replacing the same
65         reg multiple times, try to reuse last created gen_raw_REG.
67         PR debug/81155
68         * bb-reorder.c (pass_partition_blocks::gate): In lto don't partition
69         main to workaround a bug in GDB.
71 2018-01-12  Tom de Vries  <tom@codesourcery.com>
73         PR target/83737
74         * config.gcc (nvptx*-*-*): Set use_gcc_stdint=wrap.
76 2018-01-12  Vladimir Makarov  <vmakarov@redhat.com>
78         PR rtl-optimization/80481
79         * ira-color.c (get_cap_member): New function.
80         (allocnos_conflict_by_live_ranges_p): Use it.
81         (slot_coalesced_allocno_live_ranges_intersect_p): Add assert.
82         (setup_slot_coalesced_allocno_live_ranges): Ditto.
84 2018-01-12  Uros Bizjak  <ubizjak@gmail.com>
86         PR target/83628
87         * config/alpha/alpha.md (*saddsi_1): New insn_ans_split pattern.
88         (*saddl_se_1): Ditto.
89         (*ssubsi_1): Ditto.
90         (*saddl_se_1): Ditto.
92 2018-01-12  Richard Sandiford  <richard.sandiford@linaro.org>
94         * tree-predcom.c (aff_combination_dr_offset): Use wi::to_poly_widest
95         rather than wi::to_widest for DR_INITs.
96         * tree-vect-data-refs.c (vect_find_same_alignment_drs): Use
97         wi::to_poly_offset rather than wi::to_offset for DR_INIT.
98         (vect_analyze_data_ref_accesses): Require both DR_INITs to be
99         INTEGER_CSTs.
100         (vect_analyze_group_access_1): Note that here.
102 2018-01-12  Richard Sandiford  <richard.sandiford@linaro.org>
104         * tree-vectorizer.c (get_vec_alignment_for_array_type): Handle
105         polynomial type sizes.
107 2018-01-12  Richard Sandiford  <richard.sandiford@linaro.org>
109         * gimplify.c (gimple_add_tmp_var_fn): Allow variables to have a
110         poly_uint64 size, rather than requiring an unsigned HOST_WIDE_INT size.
111         (gimple_add_tmp_var): Likewise.
113 2018-01-12  Martin Liska  <mliska@suse.cz>
115         * gimple.c (gimple_alloc_counts): Use uint64_t instead of int.
116         (gimple_alloc_sizes): Likewise.
117         (dump_gimple_statistics): Use PRIu64 in printf format.
118         * gimple.h: Change uint64_t to int.
120 2018-01-12  Martin Liska  <mliska@suse.cz>
122         * tree-core.h: Use uint64_t instead of int.
123         * tree.c (tree_node_counts): Likewise.
124         (tree_node_sizes): Likewise.
125         (dump_tree_statistics): Use PRIu64 in printf format.
127 2018-01-12  Martin Liska  <mliska@suse.cz>
129         * Makefile.in: As qsort_chk is implemented in vec.c, add
130         vec.o to linkage of gencfn-macros.
131         * tree.c (build_new_poly_int_cst): Add CXX_MEM_STAT_INFO as it's
132         passing the info to record_node_allocation_statistics.
133         (test_vector_cst_patterns): Add CXX_MEM_STAT_INFO to declaration
134         and pass the info.
135         * ggc-common.c (struct ggc_usage): Add operator== and use
136         it in operator< and compare function.
137         * mem-stats.h (struct mem_usage): Likewise.
138         * vec.c (struct vec_usage): Remove operator< and compare
139         function. Can be simply inherited.
141 2018-01-12  Martin Jambor  <mjambor@suse.cz>
143         PR target/81616
144         * params.def: New parameter PARAM_AVOID_FMA_MAX_BITS.
145         * tree-ssa-math-opts.c: Include domwalk.h.
146         (convert_mult_to_fma_1): New function.
147         (fma_transformation_info): New type.
148         (fma_deferring_state): Likewise.
149         (cancel_fma_deferring): New function.
150         (result_of_phi): Likewise.
151         (last_fma_candidate_feeds_initial_phi): Likewise.
152         (convert_mult_to_fma): Added deferring logic, split actual
153         transformation to convert_mult_to_fma_1.
154         (math_opts_dom_walker): New type.
155         (math_opts_dom_walker::after_dom_children): New method, body moved
156         here from pass_optimize_widening_mul::execute, added deferring logic
157         bits.
158         (pass_optimize_widening_mul::execute): Moved most of code to
159         math_opts_dom_walker::after_dom_children.
160         * config/i386/x86-tune.def (X86_TUNE_AVOID_128FMA_CHAINS): New.
161         * config/i386/i386.c (ix86_option_override_internal): Added
162         maybe_setting of PARAM_AVOID_FMA_MAX_BITS.
164 2018-01-12  Richard Biener  <rguenther@suse.de>
166         PR debug/83157
167         * dwarf2out.c (gen_variable_die): Do not reset old_die for
168         inline instance vars.
170 2018-01-12  Oleg Endo  <olegendo@gcc.gnu.org>
172         PR target/81819
173         * config/rx/rx.c (rx_is_restricted_memory_address):
174         Handle SUBREG case.
176 2018-01-12  Richard Biener  <rguenther@suse.de>
178         PR tree-optimization/80846
179         * target.def (split_reduction): New target hook.
180         * targhooks.c (default_split_reduction): New function.
181         * targhooks.h (default_split_reduction): Declare.
182         * tree-vect-loop.c (vect_create_epilog_for_reduction): If the
183         target requests first reduce vectors by combining low and high
184         parts.
185         * tree-vect-stmts.c (vect_gen_perm_mask_any): Adjust.
186         (get_vectype_for_scalar_type_and_size): Export.
187         * tree-vectorizer.h (get_vectype_for_scalar_type_and_size): Declare.
188         * doc/tm.texi.in (TARGET_VECTORIZE_SPLIT_REDUCTION): Document.
189         * doc/tm.texi: Regenerate.
190         * config/i386/i386.c (ix86_split_reduction): Implement
191         TARGET_VECTORIZE_SPLIT_REDUCTION.
193 2018-01-12  Eric Botcazou  <ebotcazou@adacore.com>
195         PR target/83368
196         * config/sparc/sparc.h (PIC_OFFSET_TABLE_REGNUM): Set to INVALID_REGNUM
197         in PIC mode except for TARGET_VXWORKS_RTP.
198         * config/sparc/sparc.c: Include cfgrtl.h.
199         (TARGET_INIT_PIC_REG): Define.
200         (TARGET_USE_PSEUDO_PIC_REG): Likewise.
201         (sparc_pic_register_p): New predicate.
202         (sparc_legitimate_address_p): Use it.
203         (sparc_legitimize_pic_address): Likewise.
204         (sparc_delegitimize_address): Likewise.
205         (sparc_mode_dependent_address_p): Likewise.
206         (gen_load_pcrel_sym): Remove 4th parameter.
207         (load_got_register): Adjust call to above.  Remove obsolete stuff.
208         (sparc_expand_prologue): Do not call load_got_register here.
209         (sparc_flat_expand_prologue): Likewise.
210         (sparc_output_mi_thunk): Set the pic_offset_table_rtx object.
211         (sparc_use_pseudo_pic_reg): New function.
212         (sparc_init_pic_reg): Likewise.
213         * config/sparc/sparc.md (vxworks_load_got): Set the GOT register.
214         (builtin_setjmp_receiver): Enable only for TARGET_VXWORKS_RTP.
216 2018-01-12  Christophe Lyon  <christophe.lyon@linaro.org>
218         * doc/sourcebuild.texi (Effective-Target Keywords, Other attributes):
219         Add item for branch_cost.
221 2018-01-12  Eric Botcazou  <ebotcazou@adacore.com>
223         PR rtl-optimization/83565
224         * rtlanal.c (nonzero_bits1): On WORD_REGISTER_OPERATIONS machines, do
225         not extend the result to a larger mode for rotate operations.
226         (num_sign_bit_copies1): Likewise.
228 2018-01-12  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
230         PR target/40411
231         * config/sol2.h (STARTFILE_ARCH_SPEC): Don't use with -shared or
232         -symbolic.
233         Use values-Xc.o for -pedantic.
234         Link with values-xpg4.o for C90, values-xpg6.o otherwise.
236 2018-01-12  Martin Liska  <mliska@suse.cz>
238         PR ipa/83054
239         * ipa-devirt.c (final_warning_record::grow_type_warnings):
240         New function.
241         (possible_polymorphic_call_targets): Use it.
242         (ipa_devirt): Likewise.
244 2018-01-12  Martin Liska  <mliska@suse.cz>
246         * profile-count.h (enum profile_quality): Use 0 as invalid
247         enum value of profile_quality.
249 2018-01-12  Chung-Ju Wu  <jasonwucj@gmail.com>
251         * doc/invoke.texi (NDS32 Options): Add -mext-perf, -mext-perf2 and
252         -mext-string options.
254 2018-01-12  Richard Biener  <rguenther@suse.de>
256         * lto-streamer-out.c (DFS::DFS_write_tree_body): Process
257         DECL_DEBUG_EXPR conditional on DECL_HAS_DEBUG_EXPR_P.
258         * tree-streamer-in.c (lto_input_ts_decl_common_tree_pointers):
259         Likewise.
260         * tree-streamer-out.c (write_ts_decl_common_tree_pointers): Likewise.
262 2018-01-11  Michael Meissner  <meissner@linux.vnet.ibm.com>
264         * configure.ac (--with-long-double-format): Add support for the
265         configuration option to change the default long double format on
266         PowerPC systems.
267         * config.gcc (powerpc*-linux*-*): Likewise.
268         * configure: Regenerate.
269         * config/rs6000/rs6000-c.c (rs6000_cpu_cpp_builtins): If long
270         double is IEEE, define __KC__ and __KF__ to allow floatn.h to be
271         used without modification.
273 2018-01-11  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
275         * config/rs6000/rs6000-builtin.def (BU_P7_MISC_X): New #define.
276         (SPEC_BARRIER): New instantiation of BU_P7_MISC_X.
277         * config/rs6000/rs6000.c (rs6000_expand_builtin): Handle
278         MISC_BUILTIN_SPEC_BARRIER.
279         (rs6000_init_builtins): Likewise.
280         * config/rs6000/rs6000.md (UNSPECV_SPEC_BARRIER): New UNSPECV
281         enum value.
282         (speculation_barrier): New define_insn.
283         * doc/extend.texi: Document __builtin_speculation_barrier.
285 2018-01-11  Jakub Jelinek  <jakub@redhat.com>
287         PR target/83203
288         * config/i386/i386.c (ix86_expand_vector_init_one_nonzero): If one_var
289         is 0, for V{8,16}S[IF] and V[48]D[IF]mode use gen_vec_set<mode>_0.
290         * config/i386/sse.md (VI8_AVX_AVX512F, VI4F_256_512): New mode
291         iterators.
292         (ssescalarmodesuffix): Add 512-bit vectors.  Use "d" or "q" for
293         integral modes instead of "ss" and "sd".
294         (vec_set<mode>_0): New define_insns for 256-bit and 512-bit
295         vectors with 32-bit and 64-bit elements.
296         (vecdupssescalarmodesuffix): New mode attribute.
297         (vec_dup<mode>): Use it.
299 2018-01-11  H.J. Lu  <hongjiu.lu@intel.com>
301         PR target/83330
302         * config/i386/i386.c (ix86_compute_frame_layout): Align stack
303         frame if argument is passed on stack.
305 2018-01-11  Jakub Jelinek  <jakub@redhat.com>
307         PR target/82682
308         * ree.c (combine_reaching_defs): Optimize also
309         reg2=exp; reg1=reg2; reg2=any_extend(reg1); into
310         reg2=any_extend(exp); reg1=reg2;, formatting fix.
312 2018-01-11  Jan Hubicka  <hubicka@ucw.cz>
314         PR middle-end/83189
315         * gimple-ssa-isolate-paths.c (isolate_path): Fix profile update.
317 2018-01-11  Jan Hubicka  <hubicka@ucw.cz>
319         PR middle-end/83718
320         * tree-inline.c (copy_cfg_body): Adjust num&den for scaling
321         after they are computed.
323 2018-01-11  Bin Cheng  <bin.cheng@arm.com>
325         PR tree-optimization/83695
326         * gimple-loop-linterchange.cc
327         (tree_loop_interchange::interchange_loops): Call scev_reset_htab to
328         reset cached scev information after interchange.
329         (pass_linterchange::execute): Remove call to scev_reset_htab.
331 2018-01-11  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
333         * config/arm/arm_neon.h (vfmlal_lane_low_u32, vfmlal_lane_high_u32,
334         vfmlalq_laneq_low_u32, vfmlalq_lane_low_u32, vfmlal_laneq_low_u32,
335         vfmlalq_laneq_high_u32, vfmlalq_lane_high_u32, vfmlal_laneq_high_u32,
336         vfmlsl_lane_low_u32, vfmlsl_lane_high_u32, vfmlslq_laneq_low_u32,
337         vfmlslq_lane_low_u32, vfmlsl_laneq_low_u32, vfmlslq_laneq_high_u32,
338         vfmlslq_lane_high_u32, vfmlsl_laneq_high_u32): Define.
339         * config/arm/arm_neon_builtins.def (vfmal_lane_low,
340         vfmal_lane_lowv4hf, vfmal_lane_lowv8hf, vfmal_lane_high,
341         vfmal_lane_highv4hf, vfmal_lane_highv8hf, vfmsl_lane_low,
342         vfmsl_lane_lowv4hf, vfmsl_lane_lowv8hf, vfmsl_lane_high,
343         vfmsl_lane_highv4hf, vfmsl_lane_highv8hf): New sets of builtins.
344         * config/arm/iterators.md (VFMLSEL2, vfmlsel2): New mode attributes.
345         (V_lane_reg): Likewise.
346         * config/arm/neon.md (neon_vfm<vfml_op>l_lane_<vfml_half><VCVTF:mode>):
347         New define_expand.
348         (neon_vfm<vfml_op>l_lane_<vfml_half><vfmlsel2><mode>): Likewise.
349         (vfmal_lane_low<mode>_intrinsic,
350         vfmal_lane_low<vfmlsel2><mode>_intrinsic,
351         vfmal_lane_high<vfmlsel2><mode>_intrinsic,
352         vfmal_lane_high<mode>_intrinsic, vfmsl_lane_low<mode>_intrinsic,
353         vfmsl_lane_low<vfmlsel2><mode>_intrinsic,
354         vfmsl_lane_high<vfmlsel2><mode>_intrinsic,
355         vfmsl_lane_high<mode>_intrinsic): New define_insns.
357 2018-01-11  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
359         * config/arm/arm-cpus.in (fp16fml): New feature.
360         (ALL_SIMD): Add fp16fml.
361         (armv8.2-a): Add fp16fml as an option.
362         (armv8.3-a): Likewise.
363         (armv8.4-a): Add fp16fml as part of fp16.
364         * config/arm/arm.h (TARGET_FP16FML): Define.
365         * config/arm/arm-c.c (arm_cpu_builtins): Define __ARM_FEATURE_FP16_FML
366         when appropriate.
367         * config/arm/arm-modes.def (V2HF): Define.
368         * config/arm/arm_neon.h (vfmlal_low_u32, vfmlsl_low_u32,
369         vfmlal_high_u32, vfmlsl_high_u32, vfmlalq_low_u32,
370         vfmlslq_low_u32, vfmlalq_high_u32, vfmlslq_high_u32): Define.
371         * config/arm/arm_neon_builtins.def (vfmal_low, vfmal_high,
372         vfmsl_low, vfmsl_high): New set of builtins.
373         * config/arm/iterators.md (PLUSMINUS): New code iterator.
374         (vfml_op): New code attribute.
375         (VFMLHALVES): New int iterator.
376         (VFML, VFMLSEL): New mode attributes.
377         (V_reg): Define mapping for V2HF.
378         (V_hi, V_lo): New mode attributes.
379         (VF_constraint): Likewise.
380         (vfml_half, vfml_half_selector): New int attributes.
381         * config/arm/neon.md (neon_vfm<vfml_op>l_<vfml_half><mode>): New
382         define_expand.
383         (vfmal_low<mode>_intrinsic, vfmsl_high<mode>_intrinsic,
384         vfmal_high<mode>_intrinsic, vfmsl_low<mode>_intrinsic):
385         New define_insn.
386         * config/arm/t-arm-elf (v8_fps): Add fp16fml.
387         * config/arm/t-multilib (v8_2_a_simd_variants): Add fp16fml.
388         * config/arm/unspecs.md (UNSPEC_VFML_LO, UNSPEC_VFML_HI): New unspecs.
389         * doc/invoke.texi (ARM Options): Document fp16fml.  Update armv8.4-a
390         documentation.
391         * doc/sourcebuild.texi (arm_fp16fml_neon_ok, arm_fp16fml_neon):
392         Document new effective target and option set.
394 2017-01-11  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
396         * config/arm/arm-cpus.in (armv8_4): New feature.
397         (ARMv8_4a): New fgroup.
398         (armv8.4-a): New arch.
399         * config/arm/arm-tables.opt: Regenerate.
400         * config/arm/t-aprofile: Add matching rules for -march=armv8.4-a.
401         * config/arm/t-arm-elf (all_v8_archs): Add armv8.4-a.
402         * config/arm/t-multilib (v8_4_a_simd_variants): New variable.
403         Add matching rules for -march=armv8.4-a and extensions.
404         * doc/invoke.texi (ARM Options): Document -march=armv8.4-a.
406 2018-01-11  Oleg Endo  <olegendo@gcc.gnu.org>
408         PR target/81821
409         * config/rx/rx.md (BW): New mode attribute.
410         (sync_lock_test_and_setsi): Add mode suffix to insn output.
412 2018-01-11  Richard Biener  <rguenther@suse.de>
414         PR tree-optimization/83435
415         * graphite.c (canonicalize_loop_form): Ignore fake loop exit edges.
416         * graphite-scop-detection.c (scop_detection::get_sese): Likewise.
417         * tree-vrp.c (add_assert_info): Drop TREE_OVERFLOW if they appear.
419 2018-01-11  Richard Sandiford  <richard.sandiford@linaro.org>
420             Alan Hayward  <alan.hayward@arm.com>
421             David Sherwood  <david.sherwood@arm.com>
423         * config/aarch64/aarch64.c (aarch64_address_info): Add a const_offset
424         field.
425         (aarch64_classify_address): Initialize it.  Track polynomial offsets.
426         (aarch64_print_address_internal): Use it to check for a zero offset.
428 2018-01-11  Richard Sandiford  <richard.sandiford@linaro.org>
429             Alan Hayward  <alan.hayward@arm.com>
430             David Sherwood  <david.sherwood@arm.com>
432         * config/aarch64/aarch64-modes.def (NUM_POLY_INT_COEFFS): Set to 2.
433         * config/aarch64/aarch64-protos.h (aarch64_initial_elimination_offset):
434         Return a poly_int64 rather than a HOST_WIDE_INT.
435         (aarch64_offset_7bit_signed_scaled_p): Take the offset as a poly_int64
436         rather than a HOST_WIDE_INT.
437         * config/aarch64/aarch64.h (aarch64_frame): Protect with
438         HAVE_POLY_INT_H rather than HOST_WIDE_INT.  Change locals_offset,
439         hard_fp_offset, frame_size, initial_adjust, callee_offset and
440         final_offset from HOST_WIDE_INT to poly_int64.
441         * config/aarch64/aarch64-builtins.c (aarch64_simd_expand_args): Use
442         to_constant when getting the number of units in an Advanced SIMD
443         mode.
444         (aarch64_builtin_vectorized_function): Check for a constant number
445         of units.
446         * config/aarch64/aarch64-simd.md (mov<mode>): Handle polynomial
447         GET_MODE_SIZE.
448         (aarch64_ld<VSTRUCT:nregs>_lane<VALLDIF:mode>): Use the nunits
449         attribute instead of GET_MODE_NUNITS.
450         * config/aarch64/aarch64.c (aarch64_hard_regno_nregs)
451         (aarch64_class_max_nregs): Use the constant_lowest_bound of the
452         GET_MODE_SIZE for fixed-size registers.
453         (aarch64_const_vec_all_same_in_range_p): Use const_vec_duplicate_p.
454         (aarch64_hard_regno_call_part_clobbered, aarch64_classify_index)
455         (aarch64_mode_valid_for_sched_fusion_p, aarch64_classify_address)
456         (aarch64_legitimize_address_displacement, aarch64_secondary_reload)
457         (aarch64_print_operand, aarch64_print_address_internal)
458         (aarch64_address_cost, aarch64_rtx_costs, aarch64_register_move_cost)
459         (aarch64_short_vector_p, aapcs_vfp_sub_candidate)
460         (aarch64_simd_attr_length_rglist, aarch64_operands_ok_for_ldpstp):
461         Handle polynomial GET_MODE_SIZE.
462         (aarch64_hard_regno_caller_save_mode): Likewise.  Return modes
463         wider than SImode without modification.
464         (tls_symbolic_operand_type): Use strip_offset instead of split_const.
465         (aarch64_pass_by_reference, aarch64_layout_arg, aarch64_pad_reg_upward)
466         (aarch64_gimplify_va_arg_expr): Assert that we don't yet handle
467         passing and returning SVE modes.
468         (aarch64_function_value, aarch64_layout_arg): Use gen_int_mode
469         rather than GEN_INT.
470         (aarch64_emit_probe_stack_range): Take the size as a poly_int64
471         rather than a HOST_WIDE_INT, but call sorry if it isn't constant.
472         (aarch64_allocate_and_probe_stack_space): Likewise.
473         (aarch64_layout_frame): Cope with polynomial offsets.
474         (aarch64_save_callee_saves, aarch64_restore_callee_saves): Take the
475         start_offset as a poly_int64 rather than a HOST_WIDE_INT.  Track
476         polynomial offsets.
477         (offset_9bit_signed_unscaled_p, offset_12bit_unsigned_scaled_p)
478         (aarch64_offset_7bit_signed_scaled_p): Take the offset as a
479         poly_int64 rather than a HOST_WIDE_INT.
480         (aarch64_get_separate_components, aarch64_process_components)
481         (aarch64_expand_prologue, aarch64_expand_epilogue)
482         (aarch64_use_return_insn_p): Handle polynomial frame offsets.
483         (aarch64_anchor_offset): New function, split out from...
484         (aarch64_legitimize_address): ...here.
485         (aarch64_builtin_vectorization_cost): Handle polynomial
486         TYPE_VECTOR_SUBPARTS.
487         (aarch64_simd_check_vect_par_cnst_half): Handle polynomial
488         GET_MODE_NUNITS.
489         (aarch64_simd_make_constant, aarch64_expand_vector_init): Get the
490         number of elements from the PARALLEL rather than the mode.
491         (aarch64_shift_truncation_mask): Use GET_MODE_UNIT_BITSIZE
492         rather than GET_MODE_BITSIZE.
493         (aarch64_evpc_trn, aarch64_evpc_uzp, aarch64_evpc_ext)
494         (aarch64_evpc_rev, aarch64_evpc_dup, aarch64_evpc_zip)
495         (aarch64_expand_vec_perm_const_1): Handle polynomial
496         d->perm.length () and d->perm elements.
497         (aarch64_evpc_tbl): Likewise.  Use nelt rather than GET_MODE_NUNITS.
498         Apply to_constant to d->perm elements.
499         (aarch64_simd_valid_immediate, aarch64_vec_fpconst_pow_of_2): Handle
500         polynomial CONST_VECTOR_NUNITS.
501         (aarch64_move_pointer): Take amount as a poly_int64 rather
502         than an int.
503         (aarch64_progress_pointer): Avoid temporary variable.
504         * config/aarch64/aarch64.md (aarch64_<crc_variant>): Use
505         the mode attribute instead of GET_MODE.
507 2018-01-11  Richard Sandiford  <richard.sandiford@linaro.org>
508             Alan Hayward  <alan.hayward@arm.com>
509             David Sherwood  <david.sherwood@arm.com>
511         * config/aarch64/aarch64.c (aarch64_force_temporary): Assert that
512         x exists before using it.
513         (aarch64_add_constant_internal): Rename to...
514         (aarch64_add_offset_1): ...this.  Replace regnum with separate
515         src and dest rtxes.  Handle the case in which they're different,
516         including when the offset is zero.  Replace scratchreg with an rtx.
517         Use 2 additions if there is no spare register into which we can
518         move a 16-bit constant.
519         (aarch64_add_constant): Delete.
520         (aarch64_add_offset): Replace reg with separate src and dest
521         rtxes.  Take a poly_int64 offset instead of a HOST_WIDE_INT.
522         Use aarch64_add_offset_1.
523         (aarch64_add_sp, aarch64_sub_sp): Take the scratch register as
524         an rtx rather than an int.  Take the delta as a poly_int64
525         rather than a HOST_WIDE_INT.  Use aarch64_add_offset.
526         (aarch64_expand_mov_immediate): Update uses of aarch64_add_offset.
527         (aarch64_expand_prologue): Update calls to aarch64_sub_sp,
528         aarch64_allocate_and_probe_stack_space and aarch64_add_offset.
529         (aarch64_expand_epilogue): Update calls to aarch64_add_offset
530         and aarch64_add_sp.
531         (aarch64_output_mi_thunk): Use aarch64_add_offset rather than
532         aarch64_add_constant.
534 2018-01-11  Richard Sandiford  <richard.sandiford@linaro.org>
536         * config/aarch64/aarch64.c (aarch64_reinterpret_float_as_int):
537         Use scalar_float_mode.
539 2018-01-11  Richard Sandiford  <richard.sandiford@linaro.org>
541         * config/aarch64/aarch64-simd.md
542         (aarch64_fml<f16mac1>l<f16quad>_low<mode>): Avoid GET_MODE_NUNITS.
543         (aarch64_fml<f16mac1>l<f16quad>_high<mode>): Likewise.
544         (aarch64_fml<f16mac1>l_lane_lowv2sf): Likewise.
545         (aarch64_fml<f16mac1>l_lane_highv2sf): Likewise.
546         (aarch64_fml<f16mac1>lq_laneq_lowv4sf): Likewise.
547         (aarch64_fml<f16mac1>lq_laneq_highv4sf): Likewise.
548         (aarch64_fml<f16mac1>l_laneq_lowv2sf): Likewise.
549         (aarch64_fml<f16mac1>l_laneq_highv2sf): Likewise.
550         (aarch64_fml<f16mac1>lq_lane_lowv4sf): Likewise.
551         (aarch64_fml<f16mac1>lq_lane_highv4sf): Likewise.
553 2018-01-11  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>
555         PR target/83514
556         * config/arm/arm.c (arm_declare_function_name): Set arch_to_print if
557         targ_options->x_arm_arch_string is non NULL.
559 2018-01-11  Tamar Christina  <tamar.christina@arm.com>
561         * config/aarch64/aarch64.h
562         (AARCH64_FL_FOR_ARCH8_4): Add  AARCH64_FL_DOTPROD.
564 2018-01-11  Sudakshina Das  <sudi.das@arm.com>
566         PR target/82096
567         * expmed.c (emit_store_flag_force): Swap if const op0
568         and change VOIDmode to mode of op0.
570 2018-01-11  Richard Sandiford  <richard.sandiford@linaro.org>
572         PR rtl-optimization/83761
573         * caller-save.c (replace_reg_with_saved_mem): Pass bits rather
574         than bytes to mode_for_size.
576 2018-01-10  Jan Hubicka  <hubicka@ucw.cz>
578         PR middle-end/83189
579         * gfortran.fortran-torture/compile/pr83189.f90: New testcase.
580         * tree-ssa-loop-manip.c (tree_transform_and_unroll_loop): Handle zero
581         profile.
583 2018-01-10  Jan Hubicka  <hubicka@ucw.cz>
585         PR middle-end/83575
586         * cfgrtl.c (rtl_verify_edges): Only verify fixability of partition
587         when in layout mode.
588         (cfg_layout_finalize): Do not verify cfg before we are out of layout.
589         * cfgcleanup.c (try_optimize_cfg): Only verify flow info when doing
590         partition fixup.
592 2018-01-10  Michael Collison  <michael.collison@arm.com>
594         * config/aarch64/aarch64-modes.def (V2HF): New VECTOR_MODE.
595         * config/aarch64/aarch64-option-extension.def: Add
596         AARCH64_OPT_EXTENSION of 'fp16fml'.
597         * config/aarch64/aarch64-c.c (aarch64_update_cpp_builtins):
598         (__ARM_FEATURE_FP16_FML): Define if TARGET_F16FML is true.
599         * config/aarch64/predicates.md (aarch64_lane_imm3): New predicate.
600         * config/aarch64/constraints.md (Ui7): New constraint.
601         * config/aarch64/iterators.md (VFMLA_W): New mode iterator.
602         (VFMLA_SEL_W): Ditto.
603         (f16quad): Ditto.
604         (f16mac1): Ditto.
605         (VFMLA16_LOW): New int iterator.
606         (VFMLA16_HIGH): Ditto.
607         (UNSPEC_FMLAL): New unspec.
608         (UNSPEC_FMLSL): Ditto.
609         (UNSPEC_FMLAL2): Ditto.
610         (UNSPEC_FMLSL2): Ditto.
611         (f16mac): New code attribute.
612         * config/aarch64/aarch64-simd-builtins.def
613         (aarch64_fmlal_lowv2sf): Ditto.
614         (aarch64_fmlsl_lowv2sf): Ditto.
615         (aarch64_fmlalq_lowv4sf): Ditto.
616         (aarch64_fmlslq_lowv4sf): Ditto.
617         (aarch64_fmlal_highv2sf): Ditto.
618         (aarch64_fmlsl_highv2sf): Ditto.
619         (aarch64_fmlalq_highv4sf): Ditto.
620         (aarch64_fmlslq_highv4sf): Ditto.
621         (aarch64_fmlal_lane_lowv2sf): Ditto.
622         (aarch64_fmlsl_lane_lowv2sf): Ditto.
623         (aarch64_fmlal_laneq_lowv2sf): Ditto.
624         (aarch64_fmlsl_laneq_lowv2sf): Ditto.
625         (aarch64_fmlalq_lane_lowv4sf): Ditto.
626         (aarch64_fmlsl_lane_lowv4sf): Ditto.
627         (aarch64_fmlalq_laneq_lowv4sf): Ditto.
628         (aarch64_fmlsl_laneq_lowv4sf): Ditto.
629         (aarch64_fmlal_lane_highv2sf): Ditto.
630         (aarch64_fmlsl_lane_highv2sf): Ditto.
631         (aarch64_fmlal_laneq_highv2sf): Ditto.
632         (aarch64_fmlsl_laneq_highv2sf): Ditto.
633         (aarch64_fmlalq_lane_highv4sf): Ditto.
634         (aarch64_fmlsl_lane_highv4sf): Ditto.
635         (aarch64_fmlalq_laneq_highv4sf): Ditto.
636         (aarch64_fmlsl_laneq_highv4sf): Ditto.
637         * config/aarch64/aarch64-simd.md:
638         (aarch64_fml<f16mac1>l<f16quad>_low<mode>): New pattern.
639         (aarch64_fml<f16mac1>l<f16quad>_high<mode>): Ditto.
640         (aarch64_simd_fml<f16mac1>l<f16quad>_low<mode>): Ditto.
641         (aarch64_simd_fml<f16mac1>l<f16quad>_high<mode>): Ditto.
642         (aarch64_fml<f16mac1>l_lane_lowv2sf): Ditto.
643         (aarch64_fml<f16mac1>l_lane_highv2sf): Ditto.
644         (aarch64_simd_fml<f16mac>l_lane_lowv2sf): Ditto.
645         (aarch64_simd_fml<f16mac>l_lane_highv2sf): Ditto.
646         (aarch64_fml<f16mac1>lq_laneq_lowv4sf): Ditto.
647         (aarch64_fml<f16mac1>lq_laneq_highv4sf): Ditto.
648         (aarch64_simd_fml<f16mac>lq_laneq_lowv4sf): Ditto.
649         (aarch64_simd_fml<f16mac>lq_laneq_highv4sf): Ditto.
650         (aarch64_fml<f16mac1>l_laneq_lowv2sf): Ditto.
651         (aarch64_fml<f16mac1>l_laneq_highv2sf): Ditto.
652         (aarch64_simd_fml<f16mac>l_laneq_lowv2sf): Ditto.
653         (aarch64_simd_fml<f16mac>l_laneq_highv2sf): Ditto.
654         (aarch64_fml<f16mac1>lq_lane_lowv4sf): Ditto.
655         (aarch64_fml<f16mac1>lq_lane_highv4sf): Ditto.
656         (aarch64_simd_fml<f16mac>lq_lane_lowv4sf): Ditto.
657         (aarch64_simd_fml<f16mac>lq_lane_highv4sf): Ditto.
658         * config/aarch64/arm_neon.h (vfmlal_low_u32): New intrinsic.
659         (vfmlsl_low_u32): Ditto.
660         (vfmlalq_low_u32): Ditto.
661         (vfmlslq_low_u32): Ditto.
662         (vfmlal_high_u32): Ditto.
663         (vfmlsl_high_u32): Ditto.
664         (vfmlalq_high_u32): Ditto.
665         (vfmlslq_high_u32): Ditto.
666         (vfmlal_lane_low_u32): Ditto.
667         (vfmlsl_lane_low_u32): Ditto.
668         (vfmlal_laneq_low_u32): Ditto.
669         (vfmlsl_laneq_low_u32): Ditto.
670         (vfmlalq_lane_low_u32): Ditto.
671         (vfmlslq_lane_low_u32): Ditto.
672         (vfmlalq_laneq_low_u32): Ditto.
673         (vfmlslq_laneq_low_u32): Ditto.
674         (vfmlal_lane_high_u32): Ditto.
675         (vfmlsl_lane_high_u32): Ditto.
676         (vfmlal_laneq_high_u32): Ditto.
677         (vfmlsl_laneq_high_u32): Ditto.
678         (vfmlalq_lane_high_u32): Ditto.
679         (vfmlslq_lane_high_u32): Ditto.
680         (vfmlalq_laneq_high_u32): Ditto.
681         (vfmlslq_laneq_high_u32): Ditto.
682         * config/aarch64/aarch64.h (AARCH64_FL_F16SML): New flag.
683         (AARCH64_FL_FOR_ARCH8_4): New.
684         (AARCH64_ISA_F16FML): New ISA flag.
685         (TARGET_F16FML): New feature flag for fp16fml.
686         (doc/invoke.texi): Document new fp16fml option.
688 2018-01-10  Michael Collison  <michael.collison@arm.com>
690         * config/aarch64/aarch64-builtins.c:
691         (aarch64_types_ternopu_imm_qualifiers, TYPES_TERNOPUI): New.
692         * config/aarch64/aarch64-c.c (aarch64_update_cpp_builtins):
693         (__ARM_FEATURE_SHA3): Define if TARGET_SHA3 is true.
694         * config/aarch64/aarch64.h (AARCH64_FL_SHA3): New flags.
695         (AARCH64_ISA_SHA3): New ISA flag.
696         (TARGET_SHA3): New feature flag for sha3.
697         * config/aarch64/iterators.md (sha512_op): New int attribute.
698         (CRYPTO_SHA512): New int iterator.
699         (UNSPEC_SHA512H): New unspec.
700         (UNSPEC_SHA512H2): Ditto.
701         (UNSPEC_SHA512SU0): Ditto.
702         (UNSPEC_SHA512SU1): Ditto.
703         * config/aarch64/aarch64-simd-builtins.def
704         (aarch64_crypto_sha512hqv2di): New builtin.
705         (aarch64_crypto_sha512h2qv2di): Ditto.
706         (aarch64_crypto_sha512su0qv2di): Ditto.
707         (aarch64_crypto_sha512su1qv2di): Ditto.
708         (aarch64_eor3qv8hi): Ditto.
709         (aarch64_rax1qv2di): Ditto.
710         (aarch64_xarqv2di): Ditto.
711         (aarch64_bcaxqv8hi): Ditto.
712         * config/aarch64/aarch64-simd.md:
713         (aarch64_crypto_sha512h<sha512_op>qv2di): New pattern.
714         (aarch64_crypto_sha512su0qv2di): Ditto.
715         (aarch64_crypto_sha512su1qv2di): Ditto.
716         (aarch64_eor3qv8hi): Ditto.
717         (aarch64_rax1qv2di): Ditto.
718         (aarch64_xarqv2di): Ditto.
719         (aarch64_bcaxqv8hi): Ditto.
720         * config/aarch64/arm_neon.h (vsha512hq_u64): New intrinsic.
721         (vsha512h2q_u64): Ditto.
722         (vsha512su0q_u64): Ditto.
723         (vsha512su1q_u64): Ditto.
724         (veor3q_u16): Ditto.
725         (vrax1q_u64): Ditto.
726         (vxarq_u64): Ditto.
727         (vbcaxq_u16): Ditto.
728         * config/arm/types.md (crypto_sha512): New type attribute.
729         (crypto_sha3): Ditto.
730         (doc/invoke.texi): Document new sha3 option.
732 2018-01-10  Michael Collison  <michael.collison@arm.com>
734         * config/aarch64/aarch64-builtins.c:
735         (aarch64_types_quadopu_imm_qualifiers, TYPES_QUADOPUI): New.
736         * config/aarch64/aarch64-c.c (aarch64_update_cpp_builtins):
737         (__ARM_FEATURE_SM3): Define if TARGET_SM4 is true.
738         (__ARM_FEATURE_SM4): Define if TARGET_SM4 is true.
739         * config/aarch64/aarch64.h (AARCH64_FL_SM4): New flags.
740         (AARCH64_ISA_SM4): New ISA flag.
741         (TARGET_SM4): New feature flag for sm4.
742         * config/aarch64/aarch64-simd-builtins.def
743         (aarch64_sm3ss1qv4si): Ditto.
744         (aarch64_sm3tt1aq4si): Ditto.
745         (aarch64_sm3tt1bq4si): Ditto.
746         (aarch64_sm3tt2aq4si): Ditto.
747         (aarch64_sm3tt2bq4si): Ditto.
748         (aarch64_sm3partw1qv4si): Ditto.
749         (aarch64_sm3partw2qv4si): Ditto.
750         (aarch64_sm4eqv4si): Ditto.
751         (aarch64_sm4ekeyqv4si): Ditto.
752         * config/aarch64/aarch64-simd.md:
753         (aarch64_sm3ss1qv4si): Ditto.
754         (aarch64_sm3tt<sm3tt_op>qv4si): Ditto.
755         (aarch64_sm3partw<sm3part_op>qv4si): Ditto.
756         (aarch64_sm4eqv4si): Ditto.
757         (aarch64_sm4ekeyqv4si): Ditto.
758         * config/aarch64/iterators.md (sm3tt_op): New int iterator.
759         (sm3part_op): Ditto.
760         (CRYPTO_SM3TT): Ditto.
761         (CRYPTO_SM3PART): Ditto.
762         (UNSPEC_SM3SS1): New unspec.
763         (UNSPEC_SM3TT1A): Ditto.
764         (UNSPEC_SM3TT1B): Ditto.
765         (UNSPEC_SM3TT2A): Ditto.
766         (UNSPEC_SM3TT2B): Ditto.
767         (UNSPEC_SM3PARTW1): Ditto.
768         (UNSPEC_SM3PARTW2): Ditto.
769         (UNSPEC_SM4E): Ditto.
770         (UNSPEC_SM4EKEY): Ditto.
771         * config/aarch64/constraints.md (Ui2): New constraint.
772         * config/aarch64/predicates.md (aarch64_imm2): New predicate.
773         * config/arm/types.md (crypto_sm3): New type attribute.
774         (crypto_sm4): Ditto.
775         * config/aarch64/arm_neon.h (vsm3ss1q_u32): New intrinsic.
776         (vsm3tt1aq_u32): Ditto.
777         (vsm3tt1bq_u32): Ditto.
778         (vsm3tt2aq_u32): Ditto.
779         (vsm3tt2bq_u32): Ditto.
780         (vsm3partw1q_u32): Ditto.
781         (vsm3partw2q_u32): Ditto.
782         (vsm4eq_u32): Ditto.
783         (vsm4ekeyq_u32): Ditto.
784         (doc/invoke.texi): Document new sm4 option.
786 2018-01-10  Michael Collison  <michael.collison@arm.com>
788         * config/aarch64/aarch64-arches.def (armv8.4-a): New architecture.
789         * config/aarch64/aarch64.h (AARCH64_ISA_V8_4): New ISA flag.
790         (AARCH64_FL_FOR_ARCH8_4): New.
791         (AARCH64_FL_V8_4): New flag.
792         (doc/invoke.texi): Document new armv8.4-a option.
794 2018-01-10  Michael Collison  <michael.collison@arm.com>
796         * config/aarch64/aarch64-c.c (aarch64_update_cpp_builtins):
797         (__ARM_FEATURE_AES): Define if TARGET_AES is true.
798         (__ARM_FEATURE_SHA2): Define if TARGET_SHA2 is true.
799         * config/aarch64/aarch64-option-extension.def: Add
800         AARCH64_OPT_EXTENSION of 'sha2'.
801         (aes): Add AARCH64_OPT_EXTENSION of 'aes'.
802         (crypto): Disable sha2 and aes if crypto disabled.
803         (crypto): Enable aes and sha2 if enabled.
804         (simd): Disable sha2 and aes if simd disabled.
805         * config/aarch64/aarch64.h (AARCH64_FL_AES, AARCH64_FL_SHA2):
806         New flags.
807         (AARCH64_ISA_AES, AARCH64_ISA_SHA2): New ISA flags.
808         (TARGET_SHA2): New feature flag for sha2.
809         (TARGET_AES): New feature flag for aes.
810         * config/aarch64/aarch64-simd.md:
811         (aarch64_crypto_aes<aes_op>v16qi): Make pattern
812         conditional on TARGET_AES.
813         (aarch64_crypto_aes<aesmc_op>v16qi): Ditto.
814         (aarch64_crypto_sha1hsi): Make pattern conditional
815         on TARGET_SHA2.
816         (aarch64_crypto_sha1hv4si): Ditto.
817         (aarch64_be_crypto_sha1hv4si): Ditto.
818         (aarch64_crypto_sha1su1v4si): Ditto.
819         (aarch64_crypto_sha1<sha1_op>v4si): Ditto.
820         (aarch64_crypto_sha1su0v4si): Ditto.
821         (aarch64_crypto_sha256h<sha256_op>v4si): Ditto.
822         (aarch64_crypto_sha256su0v4si): Ditto.
823         (aarch64_crypto_sha256su1v4si): Ditto.
824         (doc/invoke.texi): Document new aes and sha2 options.
826 2018-01-10  Martin Sebor  <msebor@redhat.com>
828         PR tree-optimization/83781
829         * gimple-fold.c (get_range_strlen): Avoid treating arrays of pointers
830         as string arrays.
832 2018-01-11  Martin Sebor  <msebor@gmail.com>
833             Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>
835         PR tree-optimization/83501
836         PR tree-optimization/81703
838         * tree-ssa-strlen.c (get_string_cst): Rename...
839         (get_string_len): ...to this.  Handle global constants.
840         (handle_char_store): Adjust.
842 2018-01-10  Kito Cheng  <kito.cheng@gmail.com>
843             Jim Wilson  <jimw@sifive.com>
845         * config/riscv/riscv-protos.h (riscv_output_return): New.
846         * config/riscv/riscv.c (struct machine_function): New naked_p field.
847         (riscv_attribute_table, riscv_output_return),
848         (riscv_handle_fndecl_attribute, riscv_naked_function_p),
849         (riscv_allocate_stack_slots_for_args, riscv_warn_func_return): New.
850         (riscv_compute_frame_info): Only compute frame->mask if not a naked
851         function.
852         (riscv_expand_prologue): Add early return for naked function.
853         (riscv_expand_epilogue): Likewise.
854         (riscv_function_ok_for_sibcall): Return false for naked function.
855         (riscv_set_current_function): New.
856         (TARGET_SET_CURRENT_FUNCTION, TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS),
857         (TARGET_ATTRIBUTE_TABLE, TARGET_WARN_FUNC_RETURN): New.
858         * config/riscv/riscv.md (simple_return): Call riscv_output_return.
859         * doc/extend.texi (RISC-V Function Attributes): New.
861 2018-01-10  Michael Meissner  <meissner@linux.vnet.ibm.com>
863         * config/rs6000/rs6000.c (is_complex_IBM_long_double): Explicitly
864         check for 128-bit long double before checking TCmode.
865         * config/rs6000/rs6000.h (FLOAT128_IEEE_P): Explicitly check for
866         128-bit long doubles before checking TFmode or TCmode.
867         (FLOAT128_IBM_P): Likewise.
869 2018-01-10  Martin Sebor  <msebor@redhat.com>
871         PR tree-optimization/83671
872         * builtins.c (c_strlen): Unconditionally return zero for the empty
873         string.
874         Use -Warray-bounds for warnings.
875         * gimple-fold.c (get_range_strlen): Handle non-constant lengths
876         for non-constant array indices with COMPONENT_REF, arrays of
877         arrays, and pointers to arrays.
878         (gimple_fold_builtin_strlen): Determine and set length range for
879         non-constant character arrays.
881 2018-01-10  Aldy Hernandez  <aldyh@redhat.com>
883         PR middle-end/81897
884         * tree-ssa-uninit.c (convert_control_dep_chain_into_preds): Skip
885         empty blocks.
887 2018-01-10  Eric Botcazou  <ebotcazou@adacore.com>
889         * dwarf2out.c (dwarf2out_var_location): Do not pass NULL to fprintf.
891 2018-01-10  Peter Bergner  <bergner@vnet.ibm.com>
893         PR target/83399
894         * config/rs6000/rs6000.c (print_operand) <'y'>: Use
895         VECTOR_MEM_ALTIVEC_OR_VSX_P.
896         * config/rs6000/vsx.md (*vsx_le_perm_load_<mode> for VSX_D): Use
897         indexed_or_indirect_operand predicate.
898         (*vsx_le_perm_load_<mode> for VSX_W): Likewise.
899         (*vsx_le_perm_load_v8hi): Likewise.
900         (*vsx_le_perm_load_v16qi): Likewise.
901         (*vsx_le_perm_store_<mode> for VSX_D): Likewise.
902         (*vsx_le_perm_store_<mode> for VSX_W): Likewise.
903         (*vsx_le_perm_store_v8hi): Likewise.
904         (*vsx_le_perm_store_v16qi): Likewise.
905         (eight unnamed splitters): Likewise.
907 2018-01-10  Peter Bergner  <bergner@vnet.ibm.com>
909         * config/rs6000/x86intrin.h: Change #warning to #error. Update message.
910         * config/rs6000/emmintrin.h: Likewise.
911         * config/rs6000/mmintrin.h: Likewise.
912         * config/rs6000/xmmintrin.h: Likewise.
914 2018-01-10  David Malcolm  <dmalcolm@redhat.com>
916         PR c++/43486
917         * tree-core.h: Document EXPR_LOCATION_WRAPPER_P's usage of
918         "public_flag".
919         * tree.c (tree_nop_conversion): Return true for location wrapper
920         nodes.
921         (maybe_wrap_with_location): New function.
922         (selftest::check_strip_nops): New function.
923         (selftest::test_location_wrappers): New function.
924         (selftest::tree_c_tests): Call it.
925         * tree.h (STRIP_ANY_LOCATION_WRAPPER): New macro.
926         (maybe_wrap_with_location): New decl.
927         (EXPR_LOCATION_WRAPPER_P): New macro.
928         (location_wrapper_p): New inline function.
929         (tree_strip_any_location_wrapper): New inline function.
931 2018-01-10  H.J. Lu  <hongjiu.lu@intel.com>
933         PR target/83735
934         * config/i386/i386.c (ix86_compute_frame_layout): Always adjust
935         stack_realign_offset for the largest alignment of stack slot
936         actually used.
937         (ix86_find_max_used_stack_alignment): New function.
938         (ix86_finalize_stack_frame_flags): Use it.  Set
939         max_used_stack_alignment if we don't realign stack.
940         * config/i386/i386.h (machine_function): Add
941         max_used_stack_alignment.
943 2018-01-10  Christophe Lyon  <christophe.lyon@linaro.org>
945         * config/arm/arm.opt (-mbranch-cost): New option.
946         * config/arm/arm.h (BRANCH_COST): Take arm_branch_cost into
947         account.
949 2018-01-10  Segher Boessenkool  <segher@kernel.crashing.org>
951         PR target/83629
952         * config/rs6000/rs6000.md (load_toc_v4_PIC_2, load_toc_v4_PIC_3b,
953         load_toc_v4_PIC_3c): Wrap const term in CONST RTL.
955 2018-01-10  Richard Biener  <rguenther@suse.de>
957         PR debug/83765
958         * dwarf2out.c (gen_subprogram_die): Hoist old_die && declaration
959         early out so it also covers the case where we have a non-NULL
960         origin.
962 2018-01-10  Richard Sandiford  <richard.sandiford@linaro.org>
964         PR tree-optimization/83753
965         * tree-vect-stmts.c (get_group_load_store_type): Use VMAT_CONTIGUOUS
966         for non-strided grouped accesses if the number of elements is 1.
968 2018-01-10  Jan Hubicka  <hubicka@ucw.cz>
970         PR target/81616
971         * i386.c (ix86_vectorize_builtin_gather): Check TARGET_USE_GATHER.
972         * i386.h (TARGET_USE_GATHER): Define.
973         * x86-tune.def (X86_TUNE_USE_GATHER): New.
975 2018-01-10  Martin Liska  <mliska@suse.cz>
977         PR bootstrap/82831
978         * basic-block.h (CLEANUP_NO_PARTITIONING): New define.
979         * bb-reorder.c (pass_reorder_blocks::execute): Do not clean up
980         partitioning.
981         * cfgcleanup.c (try_optimize_cfg): Fix up partitioning if
982         CLEANUP_NO_PARTITIONING is not set.
984 2018-01-10  Richard Sandiford  <richard.sandiford@linaro.org>
986         * doc/rtl.texi: Remove documentation of (const ...) wrappers
987         for vectors, as a partial revert of r254296.
988         * rtl.h (const_vec_p): Delete.
989         (const_vec_duplicate_p): Don't test for vector CONSTs.
990         (unwrap_const_vec_duplicate, const_vec_series_p): Likewise.
991         * expmed.c (make_tree): Likewise.
993         Revert:
994         * common.md (E, F): Use CONSTANT_P instead of checking for
995         CONST_VECTOR.
996         * emit-rtl.c (gen_lowpart_common): Use const_vec_p instead of
997         checking for CONST_VECTOR.
999 2018-01-09  Jan Hubicka  <hubicka@ucw.cz>
1001         PR middle-end/83575
1002         * predict.c (force_edge_cold): Handle in more sane way edges
1003         with no prediction.
1005 2018-01-09  Carl Love  <cel@us.ibm.com>
1007         * config/rs6002/altivec.md (p8_vmrgow): Add support for V2DI, V2DF,
1008         V4SI, V4SF types.
1009         (p8_vmrgew): Add support for V2DI, V2DF, V4SF types.
1010         * config/rs6000/rs6000-builtin.def: Add definitions for FLOAT2_V2DF,
1011         VMRGEW_V2DI, VMRGEW_V2DF, VMRGEW_V4SF, VMRGOW_V4SI, VMRGOW_V4SF,
1012         VMRGOW_V2DI, VMRGOW_V2DF.  Remove definition for VMRGOW.
1013         * config/rs6000/rs6000-c.c (VSX_BUILTIN_VEC_FLOAT2,
1014         P8V_BUILTIN_VEC_VMRGEW, P8V_BUILTIN_VEC_VMRGOW):  Add definitions.
1015         * config/rs6000/rs6000-protos.h: Add extern defition for
1016         rs6000_generate_float2_double_code.
1017         * config/rs6000/rs6000.c (rs6000_generate_float2_double_code): Add
1018         function.
1019         * config/rs6000/vsx.md (vsx_xvcdpsp): Add define_insn.
1020         (float2_v2df): Add define_expand.
1022 2018-01-09  Uros Bizjak  <ubizjak@gmail.com>
1024         PR target/83628
1025         * combine.c (force_int_to_mode) <case ASHIFT>: Use mode instead of
1026         op_mode in the force_to_mode call.
1028 2018-01-09  Richard Sandiford  <richard.sandiford@linaro.org>
1030         * config/aarch64/aarch64.c (aarch64_evpc_trn): Use d.perm.series_p
1031         instead of checking each element individually.
1032         (aarch64_evpc_uzp): Likewise.
1033         (aarch64_evpc_zip): Likewise.
1034         (aarch64_evpc_ext): Likewise.
1035         (aarch64_evpc_rev): Likewise.
1036         (aarch64_evpc_dup): Test the encoding for a single duplicated element,
1037         instead of checking each element individually.  Return true without
1038         generating rtl if
1039         (aarch64_vectorize_vec_perm_const): Use all_from_input_p to test
1040         whether all selected elements come from the same input, instead of
1041         checking each element individually.  Remove calls to gen_rtx_REG,
1042         start_sequence and end_sequence and instead assert that no rtl is
1043         generated.
1045 2018-01-09  Richard Sandiford  <richard.sandiford@linaro.org>
1047         * config/aarch64/aarch64.c (aarch64_legitimate_constant_p): Fix
1048         order of HIGH and CONST checks.
1050 2018-01-09  Richard Sandiford  <richard.sandiford@linaro.org>
1052         * tree-vect-stmts.c (permute_vec_elements): Create a fresh variable
1053         if the destination isn't an SSA_NAME.
1055 2018-01-09  Richard Biener  <rguenther@suse.de>
1057         PR tree-optimization/83668
1058         * graphite.c (canonicalize_loop_closed_ssa): Add edge argument,
1059         move prologue...
1060         (canonicalize_loop_form): ... here, renamed from ...
1061         (canonicalize_loop_closed_ssa_form): ... this and amended to
1062         swap successor edges for loop exit blocks to make us use
1063         the RPO order we need for initial schedule generation.
1065 2018-01-09  Joseph Myers  <joseph@codesourcery.com>
1067         PR tree-optimization/64811
1068         * match.pd: When optimizing comparisons with Inf, avoid
1069         introducing or losing exceptions from comparisons with NaN.
1071 2018-01-09  Martin Liska  <mliska@suse.cz>
1073         PR sanitizer/82517
1074         * asan.c (shadow_mem_size): Add gcc_assert.
1076 2018-01-09  Georg-Johann Lay  <avr@gjlay.de>
1078         Don't save registers in main().
1080         PR target/83738
1081         * doc/invoke.texi (AVR Options) [-mmain-is-OS_task]: Document it.
1082         * config/avr/avr.opt (-mmain-is-OS_task): New target option.
1083         * config/avr/avr.c (avr_set_current_function): Don't error if
1084         naked, OS_task or OS_main are specified at the same time.
1085         (avr_function_ok_for_sibcall): Don't disable sibcalls for OS_task,
1086         OS_main.
1087         (avr_insert_attributes) [-mmain-is-OS_task] <main>: Add OS_task
1088         attribute.
1089         * common/config/avr/avr-common.c (avr_option_optimization_table):
1090         Switch on -mmain-is-OS_task for optimizing compilations.
1092 2018-01-09  Richard Biener  <rguenther@suse.de>
1094         PR tree-optimization/83572
1095         * graphite.c: Include cfganal.h.
1096         (graphite_transform_loops): Connect infinite loops to exit
1097         and remove fake edges at the end.
1099 2018-01-09  Jan Hubicka  <hubicka@ucw.cz>
1101         * ipa-inline.c (edge_badness): Revert accidental checkin.
1103 2018-01-09  Jan Hubicka  <hubicka@ucw.cz>
1105         PR ipa/80763
1106         * ipa-comdats.c (set_comdat_group): Only set comdat group of real
1107         symbols; not inline clones.
1109 2018-01-09  Jakub Jelinek  <jakub@redhat.com>
1111         PR target/83507
1112         * modulo-sched.c (schedule_reg_moves): Punt if we'd need to move
1113         hard registers.  Formatting fixes.
1115         PR preprocessor/83722
1116         * gcc.c (try_generate_repro): Pass
1117         &temp_stderr_files[RETRY_ICE_ATTEMPTS - 1] rather than
1118         &temp_stdout_files[RETRY_ICE_ATTEMPTS - 1] as last argument to
1119         do_report_bug.
1121 2018-01-08  Monk Chiang  <sh.chiang04@gmail.com>
1122             Kito Cheng  <kito.cheng@gmail.com>
1124         * config/riscv/riscv.c (machine_function::is_leaf): Remove field.
1125         (riscv_leaf_function_p): Delete.
1126         (riscv_function_ok_for_sibcall): Return false when TARGET_SAVE_RESTORE.
1128 2018-01-08  Aaron Sawdey  <acsawdey@linux.vnet.ibm.com>
1130         * config/rs6000/rs6000-string.c (do_load_for_compare_from_addr): New
1131         function.
1132         (do_ifelse): New function.
1133         (do_isel): New function.
1134         (do_sub3): New function.
1135         (do_add3): New function.
1136         (do_load_mask_compare): New function.
1137         (do_overlap_load_compare): New function.
1138         (expand_compare_loop): New function.
1139         (expand_block_compare): Call expand_compare_loop() when appropriate.
1140         * config/rs6000/rs6000.opt (-mblock-compare-inline-limit): Change
1141         option description.
1142         (-mblock-compare-inline-loop-limit): New option.
1144 2018-01-08  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
1146         PR target/83677
1147         * config/rs6000/altivec.md (*altivec_vpermr_<mode>_internal):
1148         Reverse order of second and third operands in first alternative.
1149         * config/rs6000/rs6000.c (rs6000_expand_vector_set): Reverse order
1150         of first and second elements in UNSPEC_VPERMR vector.
1151         (altivec_expand_vec_perm_le): Likewise.
1153 2017-01-08  Jeff Law  <law@redhat.com>
1155         PR rtl-optimizatin/81308
1156         * tree-switch-conversion.c (cfg_altered): New file scoped static.
1157         (process_switch): If group_case_labels makes a change, then set
1158         cfg_altered.
1159         (pass_convert_switch::execute): If a switch is converted, then
1160         set cfg_altered.  Return TODO_cfg_cleanup if cfg_altered is true.
1162         PR rtl-optimization/81308
1163         * recog.c (split_all_insns): Conditionally cleanup the CFG after
1164         splitting insns.
1166 2018-01-08  Vidya Praveen  <vidyapraveen@arm.com>
1168         PR target/83663 - Revert r255946
1169         * config/aarch64/aarch64.c (aarch64_expand_vector_init): Modify code
1170         generation for cases where splatting a value is not useful.
1171         * simplify-rtx.c (simplify_ternary_operation): Simplify vec_merge
1172         across a vec_duplicate and a paradoxical subreg forming a vector
1173         mode to a vec_concat.
1175 2018-01-08  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
1177         * config/arm/t-aprofile (MULTILIB_MATCHES): Add mapping rules for
1178         -march=armv8.3-a variants.
1179         * config/arm/t-multilib: Likewise.
1180         * config/arm/t-arm-elf: Likewise.  Handle dotprod extension.
1182 2018-01-08  Aaron Sawdey  <acsawdey@linux.vnet.ibm.com>
1184         * config/rs6000/rs6000.md (cceq_ior_compare): Remove * so I can use it
1185         to generate rtl.
1186         (cceq_ior_compare_complement): Give it a name so I can use it, and
1187         change boolean_or_operator predicate to boolean_operator so it can
1188         be used to generate a crand.
1189         (eqne): New code iterator.
1190         (bd/bd_neg): New code_attrs.
1191         (<bd>_<mode>): New name for ctr<mode>_internal[12] now combined into
1192         a single define_insn.
1193         (<bd>tf_<mode>): A new insn pattern for the conditional form branch
1194         decrement (bdnzt/bdnzf/bdzt/bdzf).
1195         * config/rs6000/rs6000.c (rs6000_legitimate_combined_insn): Updated
1196         with the new names of the branch decrement patterns, and added the
1197         names of the branch decrement conditional patterns.
1199 2018-01-08  Richard Biener  <rguenther@suse.de>
1201         PR tree-optimization/83563
1202         * graphite.c (canonicalize_loop_closed_ssa_form): Reset the SCEV
1203         cache.
1205 2018-01-08  Richard Biener  <rguenther@suse.de>
1207         PR middle-end/83713
1208         * convert.c (do_narrow): Properly guard TYPE_OVERFLOW_WRAPS checks.
1210 2018-01-08  Richard Biener  <rguenther@suse.de>
1212         PR tree-optimization/83685
1213         * tree-ssa-pre.c (create_expression_by_pieces): Do not insert
1214         references to abnormals.
1216 2018-01-08  Richard Biener  <rguenther@suse.de>
1218         PR lto/83719
1219         * dwarf2out.c (output_indirect_strings): Handle empty
1220         skeleton_debug_str_hash.
1221         (dwarf2out_early_finish): Index strings for -gsplit-dwarf.
1223 2018-01-08  Claudiu Zissulescu  <claziss@synopsys.com>
1225         * config/arc/arc.c (TARGET_TRAMPOLINE_ADJUST_ADDRESS): Delete.
1226         (emit_store_direct): Likewise.
1227         (arc_trampoline_adjust_address): Likewise.
1228         (arc_asm_trampoline_template): New function.
1229         (arc_initialize_trampoline): Use asm_trampoline_template.
1230         (TARGET_ASM_TRAMPOLINE_TEMPLATE): Define.
1231         * config/arc/arc.h (TRAMPOLINE_SIZE): Adjust to 16.
1232         * config/arc/arc.md (flush_icache): Delete pattern.
1234 2018-01-08  Claudiu Zissulescu  <claziss@synopsys.com>
1236         * config/arc/arc-c.def (__ARC_UNALIGNED__): New define.
1237         * config/arc/arc.h (STRICT_ALIGNMENT): Control this macro using
1238         munaligned-access.
1240 2018-01-08  Sebastian Huber  <sebastian.huber@embedded-brains.de>
1242         PR target/83681
1243         * config/epiphany/epiphany.h (make_pass_mode_switch_use): Guard
1244         by not USED_FOR_TARGET.
1245         (make_pass_resolve_sw_modes): Likewise.
1247 2018-01-08  Sebastian Huber  <sebastian.huber@embedded-brains.de>
1249         * config/nios2/nios2.h (nios2_section_threshold): Guard by not
1250         USED_FOR_TARGET.
1252 2018-01-08  Richard Biener  <rguenther@suse.de>
1254         PR middle-end/83580
1255         * tree-data-ref.c (split_constant_offset): Remove STRIP_NOPS.
1257 2018-01-08  Richard Biener  <rguenther@suse.de>
1259         PR middle-end/83517
1260         * match.pd ((t * 2) / 2) -> t): Add missing :c.
1262 2018-01-06  Aldy Hernandez  <aldyh@redhat.com>
1264         PR middle-end/81897
1265         * tree-ssa-uninit.c (compute_control_dep_chain): Do not bail on
1266         basic blocks with a small number of successors.
1267         (convert_control_dep_chain_into_preds): Improve handling of
1268         forwarder blocks.
1269         (dump_predicates): Split apart into...
1270         (dump_pred_chain): ...here...
1271         (dump_pred_info): ...and here.
1272         (can_one_predicate_be_invalidated_p): Add debugging printfs.
1273         (can_chain_union_be_invalidated_p): Improve check for invalidation
1274         of paths.
1275         (uninit_uses_cannot_happen): Avoid unnecessary if
1276         convert_control_dep_chain_into_preds yielded nothing.
1278 2018-01-06  Martin Sebor  <msebor@redhat.com>
1280         PR tree-optimization/83640
1281         * gimple-ssa-warn-restrict.c (builtin_access::builtin_access): Avoid
1282         subtracting negative offset from size.
1283         (builtin_access::overlap): Adjust offset bounds of the access to fall
1284         within the size of the object if possible.
1286 2018-01-06  Richard Sandiford  <richard.sandiford@linaro.org>
1288         PR rtl-optimization/83699
1289         * expmed.c (extract_bit_field_1): Restrict the vector usage of
1290         extract_bit_field_as_subreg to cases in which the extracted
1291         value is also a vector.
1293         * lra-constraints.c (process_alt_operands): Test for the equivalence
1294         substitutions when detecting a possible reload cycle.
1296 2018-01-06  Jakub Jelinek  <jakub@redhat.com>
1298         PR debug/83480
1299         * toplev.c (process_options): Don't enable debug_nonbind_markers_p
1300         by default if flag_selective_schedling{,2}.  Formatting fixes.
1302         PR rtl-optimization/83682
1303         * rtl.h (const_vec_duplicate_p): Only return true for VEC_DUPLICATE
1304         if it has non-VECTOR_MODE element mode.
1305         (vec_duplicate_p): Likewise.
1307         PR middle-end/83694
1308         * cfgexpand.c (expand_debug_expr): Punt if mode1 is VOIDmode
1309         and bitsize might be greater than MAX_BITSIZE_MODE_ANY_INT.
1311 2018-01-05  Jakub Jelinek  <jakub@redhat.com>
1313         PR target/83604
1314         * config/i386/i386-builtin.def
1315         (__builtin_ia32_vgf2p8affineinvqb_v64qi,
1316         __builtin_ia32_vgf2p8affineqb_v64qi, __builtin_ia32_vgf2p8mulb_v64qi):
1317         Require also OPTION_MASK_ISA_AVX512F in addition to
1318         OPTION_MASK_ISA_GFNI.
1319         (__builtin_ia32_vgf2p8affineinvqb_v16qi_mask,
1320         __builtin_ia32_vgf2p8affineqb_v16qi_mask): Require
1321         OPTION_MASK_ISA_AVX512VL instead of OPTION_MASK_ISA_SSE in addition
1322         to OPTION_MASK_ISA_GFNI.
1323         (__builtin_ia32_vgf2p8mulb_v32qi_mask): Require
1324         OPTION_MASK_ISA_AVX512VL in addition to OPTION_MASK_ISA_GFNI and
1325         OPTION_MASK_ISA_AVX512BW.
1326         (__builtin_ia32_vgf2p8mulb_v16qi_mask): Require
1327         OPTION_MASK_ISA_AVX512VL instead of OPTION_MASK_ISA_AVX512BW in
1328         addition to OPTION_MASK_ISA_GFNI.
1329         (__builtin_ia32_vgf2p8affineinvqb_v16qi,
1330         __builtin_ia32_vgf2p8affineqb_v16qi, __builtin_ia32_vgf2p8mulb_v16qi):
1331         Require OPTION_MASK_ISA_SSE2 instead of OPTION_MASK_ISA_SSE in addition
1332         to OPTION_MASK_ISA_GFNI.
1333         * config/i386/i386.c (def_builtin): Change to builtin isa/isa2 being
1334         a requirement for all ISAs rather than any of them with a few
1335         exceptions.
1336         (ix86_add_new_builtins): Clear OPTION_MASK_ISA_64BIT from isa before
1337         processing.
1338         (ix86_expand_builtin): Require all ISAs from builtin's isa and isa2
1339         bitmasks to be enabled with 3 exceptions, instead of requiring any
1340         enabled ISA with lots of exceptions.
1341         * config/i386/sse.md (vgf2p8affineinvqb_<mode><mask_name>,
1342         vgf2p8affineqb_<mode><mask_name>, vgf2p8mulb_<mode><mask_name>):
1343         Change avx512bw in isa attribute to avx512f.
1344         * config/i386/sgxintrin.h: Add license boilerplate.
1345         * config/i386/vaesintrin.h: Likewise.  Fix macro spelling __AVX512F
1346         to __AVX512F__ and __AVX512VL to __AVX512VL__.
1347         (_mm256_aesdec_epi128, _mm256_aesdeclast_epi128, _mm256_aesenc_epi128,
1348         _mm256_aesenclast_epi128): Enable temporarily avx if __AVX__ is not
1349         defined.
1350         * config/i386/gfniintrin.h (_mm_gf2p8mul_epi8,
1351         _mm_gf2p8affineinv_epi64_epi8, _mm_gf2p8affine_epi64_epi8): Enable
1352         temporarily sse2 rather than sse if not enabled already.
1354         PR target/83604
1355         * config/i386/sse.md (VI248_VLBW): Rename to ...
1356         (VI248_AVX512VL): ... this.  Don't guard V32HI with TARGET_AVX512BW.
1357         (vpshrd_<mode><mask_name>, vpshld_<mode><mask_name>,
1358         vpshrdv_<mode>, vpshrdv_<mode>_mask, vpshrdv_<mode>_maskz,
1359         vpshrdv_<mode>_maskz_1, vpshldv_<mode>, vpshldv_<mode>_mask,
1360         vpshldv_<mode>_maskz, vpshldv_<mode>_maskz_1): Use VI248_AVX512VL
1361         mode iterator instead of VI248_VLBW.
1363 2018-01-05  Jan Hubicka  <hubicka@ucw.cz>
1365         * ipa-fnsummary.c (record_modified_bb_info): Add OP.
1366         (record_modified): Skip clobbers; add debug output.
1367         (param_change_prob): Use sreal frequencies.
1369 2018-01-05  Richard Sandiford  <richard.sandiford@linaro.org>
1371         * tree-vect-data-refs.c (vect_compute_data_ref_alignment): Don't
1372         punt for user-aligned variables.
1374 2018-01-05  Richard Sandiford  <richard.sandiford@linaro.org>
1376         * tree-chrec.c (chrec_contains_symbols): Return true for
1377         POLY_INT_CST.
1379 2018-01-05  Sudakshina Das  <sudi.das@arm.com>
1381         PR target/82439
1382         * simplify-rtx.c (simplify_relational_operation_1): Add simplifications
1383         of (x|y) == x for BICS pattern.
1385 2018-01-05  Jakub Jelinek  <jakub@redhat.com>
1387         PR tree-optimization/83605
1388         * gimple-ssa-strength-reduction.c: Include tree-eh.h.
1389         (find_candidates_dom_walker::before_dom_children): Ignore stmts that
1390         can throw.
1392 2018-01-05  Sebastian Huber  <sebastian.huber@embedded-brains.de>
1394         * config.gcc (epiphany-*-elf*): Add (epiphany-*-rtems*) configuration.
1395         * config/epiphany/rtems.h: New file.
1397 2018-01-04  Jakub Jelinek  <jakub@redhat.com>
1398             Uros Bizjak  <ubizjak@gmail.com>
1400         PR target/83554
1401         * config/i386/i386.md (*<rotate_insn>hi3_1 splitter): Use
1402         QIreg_operand instead of register_operand predicate.
1403         * config/i386/i386.c (ix86_rop_should_change_byte_p,
1404         set_rop_modrm_reg_bits, ix86_mitigate_rop): Use -mmitigate-rop in
1405         comments instead of -fmitigate[-_]rop.
1407 2018-01-04  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
1409         PR bootstrap/81926
1410         * cgraphunit.c (symbol_table::compile): Switch to text_section
1411         before calling assembly_start debug hook.
1412         * run-rtl-passes.c (run_rtl_passes): Likewise.
1413         Include output.h.
1415 2018-01-04  Richard Sandiford  <richard.sandiford@linaro.org>
1417         * tree-vrp.c (extract_range_from_binary_expr_1): Check
1418         range_int_cst_p rather than !symbolic_range_p before calling
1419         extract_range_from_multiplicative_op_1.
1421 2017-01-04  Jeff Law  <law@redhat.com>
1423         * tree-ssa-math-opts.c (execute_cse_reciprocals_1): Remove
1424         redundant test in assertion.
1426 2018-01-04  Richard Sandiford  <richard.sandiford@linaro.org>
1428         * doc/rtl.texi: Document machine_mode wrapper classes.
1430 2018-01-04  Richard Sandiford  <richard.sandiford@linaro.org>
1432         * fold-const.c (fold_ternary_loc): Check tree_fits_uhwi_p before
1433         using tree_to_uhwi.
1435 2018-01-04  Richard Sandiford  <richard.sandiford@linaro.org>
1437         * tree-ssa-forwprop.c (is_combined_permutation_identity): Allow
1438         the VEC_PERM_EXPR fold to fail.
1440 2018-01-04  Jakub Jelinek  <jakub@redhat.com>
1442         PR debug/83585
1443         * bb-reorder.c (insert_section_boundary_note): Set has_bb_partition
1444         to switched_sections.
1446 2018-01-04  Richard Sandiford  <richard.sandiford@linaro.org>
1448         PR target/83680
1449         * config/arm/arm.c (arm_vectorize_vec_perm_const): Fix inverted
1450         test for d.testing.
1452 2018-01-04  Peter Bergner  <bergner@vnet.ibm.com>
1454         PR target/83387
1455         * config/rs6000/rs6000.c (rs6000_discover_homogeneous_aggregate): Do not
1456         allow arguments in FP registers if TARGET_HARD_FLOAT is false.
1458 2018-01-04  Jakub Jelinek  <jakub@redhat.com>
1460         PR debug/83666
1461         * cfgexpand.c (expand_debug_expr) <case BIT_FIELD_REF>: Punt if mode
1462         is BLKmode and bitpos not zero or mode change is needed.
1464 2018-01-04  Richard Sandiford  <richard.sandiford@linaro.org>
1466         PR target/83675
1467         * config/sparc/sparc.c (sparc_vectorize_vec_perm_const): Require
1468         TARGET_VIS2.
1470 2018-01-04  Uros Bizjak  <ubizjak@gmail.com>
1472         PR target/83628
1473         * config/alpha/alpha.md (*sadd<modesuffix>): Use ASHIFT
1474         instead of MULT rtx.  Update all corresponding splitters.
1475         (*saddl_se): Ditto.
1476         (*ssub<modesuffix>): Ditto.
1477         (*ssubl_se): Ditto.
1478         (*cmp_sadd_di): Update split patterns.
1479         (*cmp_sadd_si): Ditto.
1480         (*cmp_sadd_sidi): Ditto.
1481         (*cmp_ssub_di): Ditto.
1482         (*cmp_ssub_si): Ditto.
1483         (*cmp_ssub_sidi): Ditto.
1484         * config/alpha/predicates.md (const23_operand): New predicate.
1485         * config/alpha/alpha.c (alpha_rtx_costs) [PLUS, MINUS]:
1486         Look for ASHIFT, not MULT inner operand.
1487         (alpha_split_conditional_move): Update for *sadd<modesuffix> change.
1489 2018-01-04  Martin Liska  <mliska@suse.cz>
1491         PR gcov-profile/83669
1492         * gcov.c (output_intermediate_file): Add version to intermediate
1493         gcov file.
1494         * doc/gcov.texi: Document new field 'version' in intermediate
1495         file format. Fix location of '-k' option of gcov command.
1497 2018-01-04  Martin Liska  <mliska@suse.cz>
1499         PR ipa/82352
1500         * ipa-icf.c (sem_function::merge): Do not cross comdat boundary.
1502 2018-01-04  Jakub Jelinek  <jakub@redhat.com>
1504         * gimple-ssa-sprintf.c (parse_directive): Cast second dir.len to uhwi.
1506 2018-01-03  Martin Sebor  <msebor@redhat.com>
1508         PR tree-optimization/83655
1509         * gimple-ssa-warn-restrict.c (wrestrict_dom_walker::check_call): Avoid
1510         checking calls with invalid arguments.
1512 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1514         * tree-vect-stmts.c (vect_get_store_rhs): New function.
1515         (vectorizable_mask_load_store): Delete.
1516         (vectorizable_call): Return false for masked loads and stores.
1517         (vectorizable_store): Handle IFN_MASK_STORE.  Use vect_get_store_rhs
1518         instead of gimple_assign_rhs1.
1519         (vectorizable_load): Handle IFN_MASK_LOAD.
1520         (vect_transform_stmt): Don't set is_store for call_vec_info_type.
1522 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1524         * tree-vect-stmts.c (vect_build_gather_load_calls): New function,
1525         split out from..,
1526         (vectorizable_mask_load_store): ...here.
1527         (vectorizable_load): ...and here.
1529 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1531         * tree-vect-stmts.c (vect_build_all_ones_mask)
1532         (vect_build_zero_merge_argument): New functions, split out from...
1533         (vectorizable_load): ...here.
1535 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1537         * tree-vect-stmts.c (vect_check_store_rhs): New function,
1538         split out from...
1539         (vectorizable_mask_load_store): ...here.
1540         (vectorizable_store): ...and here.
1542 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1544         * tree-vect-stmts.c (vect_check_load_store_mask): New function,
1545         split out from...
1546         (vectorizable_mask_load_store): ...here.
1548 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1550         * tree-vectorizer.h (vec_load_store_type): Moved from tree-vec-stmts.c
1551         (vect_model_store_cost): Take a vec_load_store_type instead of a
1552         vect_def_type.
1553         * tree-vect-stmts.c (vec_load_store_type): Move to tree-vectorizer.h.
1554         (vect_model_store_cost): Take a vec_load_store_type instead of a
1555         vect_def_type.
1556         (vectorizable_mask_load_store): Update accordingly.
1557         (vectorizable_store): Likewise.
1558         * tree-vect-slp.c (vect_analyze_slp_cost_1): Update accordingly.
1560 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1562         * tree-vect-loop.c (vect_transform_loop): Stub out scalar
1563         IFN_MASK_LOAD calls here rather than...
1564         * tree-vect-stmts.c (vectorizable_mask_load_store): ...here.
1566 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1567             Alan Hayward  <alan.hayward@arm.com>
1568             David Sherwood  <david.sherwood@arm.com>
1570         * expmed.c (extract_bit_field_1): For vector extracts,
1571         fall back to extract_bit_field_as_subreg if vec_extract
1572         isn't available.
1574 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1575             Alan Hayward  <alan.hayward@arm.com>
1576             David Sherwood  <david.sherwood@arm.com>
1578         * lra-spills.c (pseudo_reg_slot_compare): Sort slots by whether
1579         they are variable or constant sized.
1580         (assign_stack_slot_num_and_sort_pseudos): Don't reuse variable-sized
1581         slots for constant-sized data.
1583 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1584             Alan Hayward  <alan.hayward@arm.com>
1585             David Sherwood  <david.sherwood@arm.com>
1587         * tree-vect-patterns.c (vect_recog_mask_conversion_pattern): When
1588         handling COND_EXPRs with boolean comparisons, try to find a better
1589         basis for the mask type than the boolean itself.
1591 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1593         * doc/rtl.texi (MAX_BITSIZE_MODE_ANY_MODE): Describe how the default
1594         is calculated and how it can be overridden.
1595         * genmodes.c (max_bitsize_mode_any_mode): New variable.
1596         (create_modes): Initialize it from MAX_BITSIZE_MODE_ANY_MODE,
1597         if defined.
1598         (emit_max_int): Use it to set the output MAX_BITSIZE_MODE_ANY_MODE,
1599         if nonzero.
1601 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1602             Alan Hayward  <alan.hayward@arm.com>
1603             David Sherwood  <david.sherwood@arm.com>
1605         * config/aarch64/aarch64-protos.h (aarch64_output_simd_mov_immediate):
1606         Remove the mode argument.
1607         (aarch64_simd_valid_immediate): Remove the mode and inverse
1608         arguments.
1609         * config/aarch64/iterators.md (bitsize): New iterator.
1610         * config/aarch64/aarch64-simd.md (*aarch64_simd_mov<mode>, and<mode>3)
1611         (ior<mode>3): Update calls to aarch64_output_simd_mov_immediate.
1612         * config/aarch64/constraints.md (Do, Db, Dn): Update calls to
1613         aarch64_simd_valid_immediate.
1614         * config/aarch64/predicates.md (aarch64_reg_or_orr_imm): Likewise.
1615         (aarch64_reg_or_bic_imm): Likewise.
1616         * config/aarch64/aarch64.c (simd_immediate_info): Replace mvn
1617         with an insn_type enum and msl with a modifier_type enum.
1618         Replace element_width with a scalar_mode.  Change the shift
1619         to unsigned int.  Add constructors for scalar_float_mode and
1620         scalar_int_mode elements.
1621         (aarch64_vect_float_const_representable_p): Delete.
1622         (aarch64_can_const_movi_rtx_p)
1623         (aarch64_simd_scalar_immediate_valid_for_move)
1624         (aarch64_simd_make_constant): Update call to
1625         aarch64_simd_valid_immediate.
1626         (aarch64_advsimd_valid_immediate_hs): New function.
1627         (aarch64_advsimd_valid_immediate): Likewise.
1628         (aarch64_simd_valid_immediate): Remove mode and inverse
1629         arguments.  Rewrite to use the above.  Use const_vec_duplicate_p
1630         to detect duplicated constants and use aarch64_float_const_zero_rtx_p
1631         and aarch64_float_const_representable_p on the result.
1632         (aarch64_output_simd_mov_immediate): Remove mode argument.
1633         Update call to aarch64_simd_valid_immediate and use of
1634         simd_immediate_info.
1635         (aarch64_output_scalar_simd_mov_immediate): Update call
1636         accordingly.
1638 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1639             Alan Hayward  <alan.hayward@arm.com>
1640             David Sherwood  <david.sherwood@arm.com>
1642         * machmode.h (mode_precision): Prefix with CONST_MODE_PRECISION.
1643         (mode_nunits): Likewise CONST_MODE_NUNITS.
1644         * machmode.def (ADJUST_NUNITS): Document.
1645         * genmodes.c (mode_data::need_nunits_adj): New field.
1646         (blank_mode): Update accordingly.
1647         (adj_nunits): New variable.
1648         (print_maybe_const_decl): Replace CATEGORY with a NEEDS_ADJ
1649         parameter.
1650         (emit_mode_size_inline): Set need_bytesize_adj for all modes
1651         listed in adj_nunits.
1652         (emit_mode_nunits_inline): Set need_nunits_adj for all modes
1653         listed in adj_nunits.  Don't emit case statements for such modes.
1654         (emit_insn_modes_h): Emit definitions of CONST_MODE_NUNITS
1655         and CONST_MODE_PRECISION.  Make CONST_MODE_SIZE expand to
1656         nothing if adj_nunits is nonnull.
1657         (emit_mode_precision, emit_mode_nunits): Use print_maybe_const_decl.
1658         (emit_mode_unit_size, emit_mode_base_align, emit_mode_ibit)
1659         (emit_mode_fbit): Update use of print_maybe_const_decl.
1660         (emit_move_size): Likewise.  Treat the array as non-const
1661         if adj_nunits.
1662         (emit_mode_adjustments): Handle adj_nunits.
1664 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1666         * machmode.def (VECTOR_MODES_WITH_PREFIX): Document.
1667         * genmodes.c (VECTOR_MODES_WITH_PREFIX): New macro.
1668         (VECTOR_MODES): Use it.
1669         (make_vector_modes): Take the prefix as an argument.
1671 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1672             Alan Hayward  <alan.hayward@arm.com>
1673             David Sherwood  <david.sherwood@arm.com>
1675         * mode-classes.def (MODE_VECTOR_BOOL): New mode class.
1676         * machmode.h (INTEGRAL_MODE_P, VECTOR_MODE_P): Return true
1677         for MODE_VECTOR_BOOL.
1678         * machmode.def (VECTOR_BOOL_MODE): Document.
1679         * genmodes.c (VECTOR_BOOL_MODE): New macro.
1680         (make_vector_bool_mode): New function.
1681         (complete_mode, emit_mode_wider, emit_mode_adjustments): Handle
1682         MODE_VECTOR_BOOL.
1683         * lto-streamer-in.c (lto_input_mode_table): Likewise.
1684         * rtx-vector-builder.c (rtx_vector_builder::find_cached_value):
1685         Likewise.
1686         * stor-layout.c (int_mode_for_mode): Likewise.
1687         * tree.c (build_vector_type_for_mode): Likewise.
1688         * varasm.c (output_constant_pool_2): Likewise.
1689         * emit-rtl.c (init_emit_once): Make sure that CONST1_RTX (BImode) and
1690         CONSTM1_RTX (BImode) are the same thing.  Initialize const_tiny_rtx
1691         for MODE_VECTOR_BOOL.
1692         * expr.c (expand_expr_real_1): Use VECTOR_MODE_P instead of a list
1693         of mode class checks.
1694         * tree-vect-generic.c (expand_vector_operation): Use VECTOR_MODE_P
1695         instead of a list of mode class checks.
1696         (expand_vector_scalar_condition): Likewise.
1697         (type_for_widest_vector_mode): Handle BImode as an inner mode.
1699 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1700             Alan Hayward  <alan.hayward@arm.com>
1701             David Sherwood  <david.sherwood@arm.com>
1703         * machmode.h (mode_size): Change from unsigned short to
1704         poly_uint16_pod.
1705         (mode_to_bytes): Return a poly_uint16 rather than an unsigned short.
1706         (GET_MODE_SIZE): Return a constant if ONLY_FIXED_SIZE_MODES,
1707         or if measurement_type is not polynomial.
1708         (fixed_size_mode::includes_p): Check for constant-sized modes.
1709         * genmodes.c (emit_mode_size_inline): Make mode_size_inline
1710         return a poly_uint16 rather than an unsigned short.
1711         (emit_mode_size): Change the type of mode_size from unsigned short
1712         to poly_uint16_pod.  Use ZERO_COEFFS for the initializer.
1713         (emit_mode_adjustments): Cope with polynomial vector sizes.
1714         * lto-streamer-in.c (lto_input_mode_table): Use bp_unpack_poly_value
1715         for GET_MODE_SIZE.
1716         * lto-streamer-out.c (lto_write_mode_table): Use bp_pack_poly_value
1717         for GET_MODE_SIZE.
1718         * auto-inc-dec.c (try_merge): Treat GET_MODE_SIZE as polynomial.
1719         * builtins.c (expand_ifn_atomic_compare_exchange_into_call): Likewise.
1720         * caller-save.c (setup_save_areas): Likewise.
1721         (replace_reg_with_saved_mem): Likewise.
1722         * calls.c (emit_library_call_value_1): Likewise.
1723         * combine-stack-adj.c (combine_stack_adjustments_for_block): Likewise.
1724         * combine.c (simplify_set, make_extraction, simplify_shift_const_1)
1725         (gen_lowpart_for_combine): Likewise.
1726         * convert.c (convert_to_integer_1): Likewise.
1727         * cse.c (equiv_constant, cse_insn): Likewise.
1728         * cselib.c (autoinc_split, cselib_hash_rtx): Likewise.
1729         (cselib_subst_to_values): Likewise.
1730         * dce.c (word_dce_process_block): Likewise.
1731         * df-problems.c (df_word_lr_mark_ref): Likewise.
1732         * dwarf2cfi.c (init_one_dwarf_reg_size): Likewise.
1733         * dwarf2out.c (multiple_reg_loc_descriptor, mem_loc_descriptor)
1734         (concat_loc_descriptor, concatn_loc_descriptor, loc_descriptor)
1735         (rtl_for_decl_location): Likewise.
1736         * emit-rtl.c (gen_highpart, widen_memory_access): Likewise.
1737         * expmed.c (extract_bit_field_1, extract_integral_bit_field): Likewise.
1738         * expr.c (emit_group_load_1, clear_storage_hints): Likewise.
1739         (emit_move_complex, emit_move_multi_word, emit_push_insn): Likewise.
1740         (expand_expr_real_1): Likewise.
1741         * function.c (assign_parm_setup_block_p, assign_parm_setup_block)
1742         (pad_below): Likewise.
1743         * gimple-fold.c (optimize_atomic_compare_exchange_p): Likewise.
1744         * gimple-ssa-store-merging.c (rhs_valid_for_store_merging_p): Likewise.
1745         * ira.c (get_subreg_tracking_sizes): Likewise.
1746         * ira-build.c (ira_create_allocno_objects): Likewise.
1747         * ira-color.c (coalesced_pseudo_reg_slot_compare): Likewise.
1748         (ira_sort_regnos_for_alter_reg): Likewise.
1749         * ira-costs.c (record_operand_costs): Likewise.
1750         * lower-subreg.c (interesting_mode_p, simplify_gen_subreg_concatn)
1751         (resolve_simple_move): Likewise.
1752         * lra-constraints.c (get_reload_reg, operands_match_p): Likewise.
1753         (process_addr_reg, simplify_operand_subreg, curr_insn_transform)
1754         (lra_constraints): Likewise.
1755         (CONST_POOL_OK_P): Reject variable-sized modes.
1756         * lra-spills.c (slot, assign_mem_slot, pseudo_reg_slot_compare)
1757         (add_pseudo_to_slot, lra_spill): Likewise.
1758         * omp-low.c (omp_clause_aligned_alignment): Likewise.
1759         * optabs-query.c (get_best_extraction_insn): Likewise.
1760         * optabs-tree.c (expand_vec_cond_expr_p): Likewise.
1761         * optabs.c (expand_vec_perm_var, expand_vec_cond_expr): Likewise.
1762         (expand_mult_highpart, valid_multiword_target_p): Likewise.
1763         * recog.c (offsettable_address_addr_space_p): Likewise.
1764         * regcprop.c (maybe_mode_change): Likewise.
1765         * reginfo.c (choose_hard_reg_mode, record_subregs_of_mode): Likewise.
1766         * regrename.c (build_def_use): Likewise.
1767         * regstat.c (dump_reg_info): Likewise.
1768         * reload.c (complex_word_subreg_p, push_reload, find_dummy_reload)
1769         (find_reloads, find_reloads_subreg_address): Likewise.
1770         * reload1.c (eliminate_regs_1): Likewise.
1771         * rtlanal.c (for_each_inc_dec_find_inc_dec, rtx_cost): Likewise.
1772         * simplify-rtx.c (avoid_constant_pool_reference): Likewise.
1773         (simplify_binary_operation_1, simplify_subreg): Likewise.
1774         * targhooks.c (default_function_arg_padding): Likewise.
1775         (default_hard_regno_nregs, default_class_max_nregs): Likewise.
1776         * tree-cfg.c (verify_gimple_assign_binary): Likewise.
1777         (verify_gimple_assign_ternary): Likewise.
1778         * tree-inline.c (estimate_move_cost): Likewise.
1779         * tree-ssa-forwprop.c (simplify_vector_constructor): Likewise.
1780         * tree-ssa-loop-ivopts.c (add_autoinc_candidates): Likewise.
1781         (get_address_cost_ainc): Likewise.
1782         * tree-vect-data-refs.c (vect_enhance_data_refs_alignment): Likewise.
1783         (vect_supportable_dr_alignment): Likewise.
1784         * tree-vect-loop.c (vect_determine_vectorization_factor): Likewise.
1785         (vectorizable_reduction): Likewise.
1786         * tree-vect-stmts.c (vectorizable_assignment, vectorizable_shift)
1787         (vectorizable_operation, vectorizable_load): Likewise.
1788         * tree.c (build_same_sized_truth_vector_type): Likewise.
1789         * valtrack.c (cleanup_auto_inc_dec): Likewise.
1790         * var-tracking.c (emit_note_insn_var_location): Likewise.
1791         * config/arc/arc.h (ASM_OUTPUT_CASE_END): Use as_a <scalar_int_mode>.
1792         (ADDR_VEC_ALIGN): Likewise.
1794 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1795             Alan Hayward  <alan.hayward@arm.com>
1796             David Sherwood  <david.sherwood@arm.com>
1798         * machmode.h (mode_to_bits): Return a poly_uint16 rather than an
1799         unsigned short.
1800         (GET_MODE_BITSIZE): Return a constant if ONLY_FIXED_SIZE_MODES,
1801         or if measurement_type is polynomial.
1802         * calls.c (shift_return_value): Treat GET_MODE_BITSIZE as polynomial.
1803         * combine.c (make_extraction): Likewise.
1804         * dse.c (find_shift_sequence): Likewise.
1805         * dwarf2out.c (mem_loc_descriptor): Likewise.
1806         * expmed.c (store_integral_bit_field, extract_bit_field_1): Likewise.
1807         (extract_bit_field, extract_low_bits): Likewise.
1808         * expr.c (convert_move, convert_modes, emit_move_insn_1): Likewise.
1809         (optimize_bitfield_assignment_op, expand_assignment): Likewise.
1810         (store_expr_with_bounds, store_field, expand_expr_real_1): Likewise.
1811         * fold-const.c (optimize_bit_field_compare, merge_ranges): Likewise.
1812         * gimple-fold.c (optimize_atomic_compare_exchange_p): Likewise.
1813         * reload.c (find_reloads): Likewise.
1814         * reload1.c (alter_reg): Likewise.
1815         * stor-layout.c (bitwise_mode_for_mode, compute_record_mode): Likewise.
1816         * targhooks.c (default_secondary_memory_needed_mode): Likewise.
1817         * tree-if-conv.c (predicate_mem_writes): Likewise.
1818         * tree-ssa-strlen.c (handle_builtin_memcmp): Likewise.
1819         * tree-vect-patterns.c (adjust_bool_pattern): Likewise.
1820         * tree-vect-stmts.c (vectorizable_simd_clone_call): Likewise.
1821         * valtrack.c (dead_debug_insert_temp): Likewise.
1822         * varasm.c (mergeable_constant_section): Likewise.
1823         * config/sh/sh.h (LOCAL_ALIGNMENT): Use as_a <fixed_size_mode>.
1825 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1826             Alan Hayward  <alan.hayward@arm.com>
1827             David Sherwood  <david.sherwood@arm.com>
1829         * expr.c (expand_assignment): Cope with polynomial mode sizes
1830         when assigning to a CONCAT.
1832 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1833             Alan Hayward  <alan.hayward@arm.com>
1834             David Sherwood  <david.sherwood@arm.com>
1836         * machmode.h (mode_precision): Change from unsigned short to
1837         poly_uint16_pod.
1838         (mode_to_precision): Return a poly_uint16 rather than an unsigned
1839         short.
1840         (GET_MODE_PRECISION): Return a constant if ONLY_FIXED_SIZE_MODES,
1841         or if measurement_type is not polynomial.
1842         (HWI_COMPUTABLE_MODE_P): Turn into a function.  Optimize the case
1843         in which the mode is already known to be a scalar_int_mode.
1844         * genmodes.c (emit_mode_precision): Change the type of mode_precision
1845         from unsigned short to poly_uint16_pod.  Use ZERO_COEFFS for the
1846         initializer.
1847         * lto-streamer-in.c (lto_input_mode_table): Use bp_unpack_poly_value
1848         for GET_MODE_PRECISION.
1849         * lto-streamer-out.c (lto_write_mode_table): Use bp_pack_poly_value
1850         for GET_MODE_PRECISION.
1851         * combine.c (update_rsp_from_reg_equal): Treat GET_MODE_PRECISION
1852         as polynomial.
1853         (try_combine, find_split_point, combine_simplify_rtx): Likewise.
1854         (expand_field_assignment, make_extraction): Likewise.
1855         (make_compound_operation_int, record_dead_and_set_regs_1): Likewise.
1856         (get_last_value): Likewise.
1857         * convert.c (convert_to_integer_1): Likewise.
1858         * cse.c (cse_insn): Likewise.
1859         * expr.c (expand_expr_real_1): Likewise.
1860         * lra-constraints.c (simplify_operand_subreg): Likewise.
1861         * optabs-query.c (can_atomic_load_p): Likewise.
1862         * optabs.c (expand_atomic_load): Likewise.
1863         (expand_atomic_store): Likewise.
1864         * ree.c (combine_reaching_defs): Likewise.
1865         * rtl.h (partial_subreg_p, paradoxical_subreg_p): Likewise.
1866         * rtlanal.c (nonzero_bits1, lsb_bitfield_op_p): Likewise.
1867         * tree.h (type_has_mode_precision_p): Likewise.
1868         * ubsan.c (instrument_si_overflow): Likewise.
1870 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1871             Alan Hayward  <alan.hayward@arm.com>
1872             David Sherwood  <david.sherwood@arm.com>
1874         * tree.h (TYPE_VECTOR_SUBPARTS): Turn into a function and handle
1875         polynomial numbers of units.
1876         (SET_TYPE_VECTOR_SUBPARTS): Likewise.
1877         (valid_vector_subparts_p): New function.
1878         (build_vector_type): Remove temporary shim and take the number
1879         of units as a poly_uint64 rather than an int.
1880         (build_opaque_vector_type): Take the number of units as a
1881         poly_uint64 rather than an int.
1882         * tree.c (build_vector_from_ctor): Handle polynomial
1883         TYPE_VECTOR_SUBPARTS.
1884         (type_hash_canon_hash, type_cache_hasher::equal): Likewise.
1885         (uniform_vector_p, vector_type_mode, build_vector): Likewise.
1886         (build_vector_from_val): If the number of units is variable,
1887         use build_vec_duplicate_cst for constant operands and
1888         VEC_DUPLICATE_EXPR otherwise.
1889         (make_vector_type): Remove temporary is_constant ().
1890         (build_vector_type, build_opaque_vector_type): Take the number of
1891         units as a poly_uint64 rather than an int.
1892         (check_vector_cst): Handle polynomial TYPE_VECTOR_SUBPARTS and
1893         VECTOR_CST_NELTS.
1894         * cfgexpand.c (expand_debug_expr): Likewise.
1895         * expr.c (count_type_elements, categorize_ctor_elements_1): Likewise.
1896         (store_constructor, expand_expr_real_1): Likewise.
1897         (const_scalar_mask_from_tree): Likewise.
1898         * fold-const-call.c (fold_const_reduction): Likewise.
1899         * fold-const.c (const_binop, const_unop, fold_convert_const): Likewise.
1900         (operand_equal_p, fold_vec_perm, fold_ternary_loc): Likewise.
1901         (native_encode_vector, vec_cst_ctor_to_array): Likewise.
1902         (fold_relational_const): Likewise.
1903         (native_interpret_vector): Likewise.  Change the size from an
1904         int to an unsigned int.
1905         * gimple-fold.c (gimple_fold_stmt_to_constant_1): Handle polynomial
1906         TYPE_VECTOR_SUBPARTS.
1907         (gimple_fold_indirect_ref, gimple_build_vector): Likewise.
1908         (gimple_build_vector_from_val): Use VEC_DUPLICATE_EXPR when
1909         duplicating a non-constant operand into a variable-length vector.
1910         * hsa-brig.c (hsa_op_immed::emit_to_buffer): Handle polynomial
1911         TYPE_VECTOR_SUBPARTS and VECTOR_CST_NELTS.
1912         * ipa-icf.c (sem_variable::equals): Likewise.
1913         * match.pd: Likewise.
1914         * omp-simd-clone.c (simd_clone_subparts): Likewise.
1915         * print-tree.c (print_node): Likewise.
1916         * stor-layout.c (layout_type): Likewise.
1917         * targhooks.c (default_builtin_vectorization_cost): Likewise.
1918         * tree-cfg.c (verify_gimple_comparison): Likewise.
1919         (verify_gimple_assign_binary): Likewise.
1920         (verify_gimple_assign_ternary): Likewise.
1921         (verify_gimple_assign_single): Likewise.
1922         * tree-pretty-print.c (dump_generic_node): Likewise.
1923         * tree-ssa-forwprop.c (simplify_vector_constructor): Likewise.
1924         (simplify_bitfield_ref, is_combined_permutation_identity): Likewise.
1925         * tree-vect-data-refs.c (vect_permute_store_chain): Likewise.
1926         (vect_grouped_load_supported, vect_permute_load_chain): Likewise.
1927         (vect_shift_permute_load_chain): Likewise.
1928         * tree-vect-generic.c (nunits_for_known_piecewise_op): Likewise.
1929         (expand_vector_condition, optimize_vector_constructor): Likewise.
1930         (lower_vec_perm, get_compute_type): Likewise.
1931         * tree-vect-loop.c (vect_determine_vectorization_factor): Likewise.
1932         (get_initial_defs_for_reduction, vect_transform_loop): Likewise.
1933         * tree-vect-patterns.c (vect_recog_bool_pattern): Likewise.
1934         (vect_recog_mask_conversion_pattern): Likewise.
1935         * tree-vect-slp.c (vect_supported_load_permutation_p): Likewise.
1936         (vect_get_constant_vectors, vect_transform_slp_perm_load): Likewise.
1937         * tree-vect-stmts.c (perm_mask_for_reverse): Likewise.
1938         (get_group_load_store_type, vectorizable_mask_load_store): Likewise.
1939         (vectorizable_bswap, simd_clone_subparts, vectorizable_assignment)
1940         (vectorizable_shift, vectorizable_operation, vectorizable_store)
1941         (vectorizable_load, vect_is_simple_cond, vectorizable_comparison)
1942         (supportable_widening_operation): Likewise.
1943         (supportable_narrowing_operation): Likewise.
1944         * tree-vector-builder.c (tree_vector_builder::binary_encoded_nelts):
1945         Likewise.
1946         * varasm.c (output_constant): Likewise.
1948 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1949             Alan Hayward  <alan.hayward@arm.com>
1950             David Sherwood  <david.sherwood@arm.com>
1952         * tree-vect-data-refs.c (vect_permute_store_chain): Reorganize
1953         so that both the length == 3 and length != 3 cases set up their
1954         own permute vectors.  Add comments explaining why we know the
1955         number of elements is constant.
1956         (vect_permute_load_chain): Likewise.
1958 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1959             Alan Hayward  <alan.hayward@arm.com>
1960             David Sherwood  <david.sherwood@arm.com>
1962         * machmode.h (mode_nunits): Change from unsigned char to
1963         poly_uint16_pod.
1964         (ONLY_FIXED_SIZE_MODES): New macro.
1965         (pod_mode::measurement_type, scalar_int_mode::measurement_type)
1966         (scalar_float_mode::measurement_type, scalar_mode::measurement_type)
1967         (complex_mode::measurement_type, fixed_size_mode::measurement_type):
1968         New typedefs.
1969         (mode_to_nunits): Return a poly_uint16 rather than an unsigned short.
1970         (GET_MODE_NUNITS): Return a constant if ONLY_FIXED_SIZE_MODES,
1971         or if measurement_type is not polynomial.
1972         * genmodes.c (ZERO_COEFFS): New macro.
1973         (emit_mode_nunits_inline): Make mode_nunits_inline return a
1974         poly_uint16.
1975         (emit_mode_nunits): Change the type of mode_nunits to poly_uint16_pod.
1976         Use ZERO_COEFFS when emitting initializers.
1977         * data-streamer.h (bp_pack_poly_value): New function.
1978         (bp_unpack_poly_value): Likewise.
1979         * lto-streamer-in.c (lto_input_mode_table): Use bp_unpack_poly_value
1980         for GET_MODE_NUNITS.
1981         * lto-streamer-out.c (lto_write_mode_table): Use bp_pack_poly_value
1982         for GET_MODE_NUNITS.
1983         * tree.c (make_vector_type): Remove temporary shim and make
1984         the real function take the number of units as a poly_uint64
1985         rather than an int.
1986         (build_vector_type_for_mode): Handle polynomial nunits.
1987         * dwarf2out.c (loc_descriptor, add_const_value_attribute): Likewise.
1988         * emit-rtl.c (const_vec_series_p_1): Likewise.
1989         (gen_rtx_CONST_VECTOR): Likewise.
1990         * fold-const.c (test_vec_duplicate_folding): Likewise.
1991         * genrecog.c (validate_pattern): Likewise.
1992         * optabs-query.c (can_vec_perm_var_p, can_mult_highpart_p): Likewise.
1993         * optabs-tree.c (expand_vec_cond_expr_p): Likewise.
1994         * optabs.c (expand_vector_broadcast, expand_binop_directly): Likewise.
1995         (shift_amt_for_vec_perm_mask, expand_vec_perm_var): Likewise.
1996         (expand_vec_cond_expr, expand_mult_highpart): Likewise.
1997         * rtlanal.c (subreg_get_info): Likewise.
1998         * tree-vect-data-refs.c (vect_grouped_store_supported): Likewise.
1999         (vect_grouped_load_supported): Likewise.
2000         * tree-vect-generic.c (type_for_widest_vector_mode): Likewise.
2001         * tree-vect-loop.c (have_whole_vector_shift): Likewise.
2002         * simplify-rtx.c (simplify_unary_operation_1): Likewise.
2003         (simplify_const_unary_operation, simplify_binary_operation_1)
2004         (simplify_const_binary_operation, simplify_ternary_operation)
2005         (test_vector_ops_duplicate, test_vector_ops): Likewise.
2006         (simplify_immed_subreg): Use GET_MODE_NUNITS on a fixed_size_mode
2007         instead of CONST_VECTOR_NUNITS.
2008         * varasm.c (output_constant_pool_2): Likewise.
2009         * rtx-vector-builder.c (rtx_vector_builder::build): Only include the
2010         explicit-encoded elements in the XVEC for variable-length vectors.
2012 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2014         * lra-constraints.c (curr_insn_transform): Use partial_subreg_p.
2016 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2017             Alan Hayward  <alan.hayward@arm.com>
2018             David Sherwood  <david.sherwood@arm.com>
2020         * coretypes.h (fixed_size_mode): Declare.
2021         (fixed_size_mode_pod): New typedef.
2022         * builtins.h (target_builtins::x_apply_args_mode)
2023         (target_builtins::x_apply_result_mode): Change type to
2024         fixed_size_mode_pod.
2025         * builtins.c (apply_args_size, apply_result_size, result_vector)
2026         (expand_builtin_apply_args_1, expand_builtin_apply)
2027         (expand_builtin_return): Update accordingly.
2029 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2031         * cse.c (hash_rtx_cb): Hash only the encoded elements.
2032         * cselib.c (cselib_hash_rtx): Likewise.
2033         * expmed.c (make_tree): Build VECTOR_CSTs directly from the
2034         CONST_VECTOR encoding.
2036 2017-01-03  Jakub Jelinek  <jakub@redhat.com>
2037             Jeff Law  <law@redhat.com>
2039         PR target/83641
2040         * config/i386/i386.c (ix86_adjust_stack_and_probe_stack_clash): For
2041         noreturn probe, use gen_pop instead of ix86_emit_restore_reg_using_pop,
2042         only set RTX_FRAME_RELATED_P on both the push and pop if cfa_reg is sp
2043         and add REG_CFA_ADJUST_CFA notes in that case to both insns.
2045         PR target/83641
2046         * config/i386/i386.c (ix86_adjust_stack_and_probe_stack_clash): Do not
2047         explicitly probe *sp in a noreturn function if there were any callee
2048         register saves or frame pointer is needed.
2050 2018-01-03  Jakub Jelinek  <jakub@redhat.com>
2052         PR debug/83621
2053         * cfgexpand.c (expand_debug_expr): Return NULL if mode is
2054         BLKmode for ternary, binary or unary expressions.
2056         PR debug/83645
2057         * var-tracking.c (delete_vta_debug_insn): New inline function.
2058         (delete_vta_debug_insns): Add USE_CFG argument, if true, walk just
2059         insns from get_insns () to NULL instead of each bb separately.
2060         Use delete_vta_debug_insn.  No longer static.
2061         (vt_debug_insns_local, variable_tracking_main_1): Adjust
2062         delete_vta_debug_insns callers.
2063         * rtl.h (delete_vta_debug_insns): Declare.
2064         * final.c (rest_of_handle_final): Call delete_vta_debug_insns
2065         instead of variable_tracking_main.
2067 2018-01-03  Martin Sebor  <msebor@redhat.com>
2069         PR tree-optimization/83603
2070         * calls.c (maybe_warn_nonstring_arg): Avoid accessing function
2071         arguments past the endof the argument list in functions declared
2072         without a prototype.
2073         * gimple-ssa-warn-restrict.c (wrestrict_dom_walker::check_call):
2074         Avoid checking when arguments are null.
2076 2018-01-03  Martin Sebor  <msebor@redhat.com>
2078         PR c/83559
2079         * doc/extend.texi (attribute const): Fix a typo.
2080         * ipa-pure-const.c ((warn_function_const, warn_function_pure): Avoid
2081         issuing -Wsuggest-attribute for void functions.
2083 2018-01-03  Martin Sebor  <msebor@redhat.com>
2085         * gimple-ssa-warn-restrict.c (builtin_memref::builtin_memref): Use
2086         offset_int::from instead of wide_int::to_shwi.
2087         (maybe_diag_overlap): Remove assertion.
2088         Use HOST_WIDE_INT_PRINT_DEC instead of %lli.
2089         * gimple-ssa-sprintf.c (format_directive): Same.
2090         (parse_directive): Same.
2091         (sprintf_dom_walker::compute_format_length): Same.
2092         (try_substitute_return_value): Same.
2094 2017-01-03  Jeff Law  <law@redhat.com>
2096         PR middle-end/83654
2097         * explow.c (anti_adjust_stack_and_probe_stack_clash): Test a
2098         non-constant residual for zero at runtime and avoid probing in
2099         that case.  Reorganize code for trailing problem to mirror handling
2100         of the residual.
2102 2018-01-03  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>
2104         PR tree-optimization/83501
2105         * tree-ssa-strlen.c (get_string_cst): New.
2106         (handle_char_store): Call get_string_cst.
2108 2018-01-03  Martin Liska  <mliska@suse.cz>
2110         PR tree-optimization/83593
2111         * tree-ssa-strlen.c: Include tree-cfg.h.
2112         (strlen_check_and_optimize_stmt): Add new argument cleanup_eh.
2113         (strlen_dom_walker): Add new member variable m_cleanup_cfg.
2114         (strlen_dom_walker::strlen_dom_walker): Initialize m_cleanup_cfg
2115         to false.
2116         (strlen_dom_walker::before_dom_children): Call
2117         gimple_purge_dead_eh_edges. Dump tranformation with details
2118         dump flags.
2119         (strlen_dom_walker::before_dom_children): Update call by adding
2120         new argument cleanup_eh.
2121         (pass_strlen::execute): Return TODO_cleanup_cfg if needed.
2123 2018-01-03  Martin Liska  <mliska@suse.cz>
2125         PR ipa/83549
2126         * cif-code.def (VARIADIC_THUNK): New enum value.
2127         * ipa-fnsummary.c (compute_fn_summary): Do not inline variadic
2128         thunks.
2130 2018-01-03  Jan Beulich  <jbeulich@suse.com>
2132         * sse.md (mov<mode>_internal): Tighten condition for when to use
2133         vmovdqu<ssescalarsize> for TI and OI modes.
2135 2018-01-03  Jakub Jelinek  <jakub@redhat.com>
2137         Update copyright years.
2139 2018-01-03  Martin Liska  <mliska@suse.cz>
2141         PR ipa/83594
2142         * ipa-visibility.c (function_and_variable_visibility): Skip
2143         functions with noipa attribure.
2145 2018-01-03  Jakub Jelinek  <jakub@redhat.com>
2147         * gcc.c (process_command): Update copyright notice dates.
2148         * gcov-dump.c (print_version): Ditto.
2149         * gcov.c (print_version): Ditto.
2150         * gcov-tool.c (print_version): Ditto.
2151         * gengtype.c (create_file): Ditto.
2152         * doc/cpp.texi: Bump @copying's copyright year.
2153         * doc/cppinternals.texi: Ditto.
2154         * doc/gcc.texi: Ditto.
2155         * doc/gccint.texi: Ditto.
2156         * doc/gcov.texi: Ditto.
2157         * doc/install.texi: Ditto.
2158         * doc/invoke.texi: Ditto.
2160 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2162         * vector-builder.h (vector_builder::m_full_nelts): Change from
2163         unsigned int to poly_uint64.
2164         (vector_builder::full_nelts): Update prototype accordingly.
2165         (vector_builder::new_vector): Likewise.
2166         (vector_builder::encoded_full_vector_p): Handle polynomial full_nelts.
2167         (vector_builder::operator ==): Likewise.
2168         (vector_builder::finalize): Likewise.
2169         * int-vector-builder.h (int_vector_builder::int_vector_builder):
2170         Take the number of elements as a poly_uint64 rather than an
2171         unsigned int.
2172         * vec-perm-indices.h (vec_perm_indices::m_nelts_per_input): Change
2173         from unsigned int to poly_uint64.
2174         (vec_perm_indices::vec_perm_indices): Update prototype accordingly.
2175         (vec_perm_indices::new_vector): Likewise.
2176         (vec_perm_indices::length): Likewise.
2177         (vec_perm_indices::nelts_per_input): Likewise.
2178         (vec_perm_indices::input_nelts): Likewise.
2179         * vec-perm-indices.c (vec_perm_indices::new_vector): Take the
2180         number of elements per input as a poly_uint64 rather than an
2181         unsigned int.  Use the original encoding for variable-length
2182         vectors, rather than clamping each individual element.
2183         For the second and subsequent elements in each pattern,
2184         clamp the step and base before clamping their sum.
2185         (vec_perm_indices::series_p): Handle polynomial element counts.
2186         (vec_perm_indices::all_in_range_p): Likewise.
2187         (vec_perm_indices_to_tree): Likewise.
2188         (vec_perm_indices_to_rtx): Likewise.
2189         * tree-vect-stmts.c (vect_gen_perm_mask_any): Likewise.
2190         * tree-vector-builder.c (tree_vector_builder::new_unary_operation)
2191         (tree_vector_builder::new_binary_operation): Handle polynomial
2192         element counts.  Return false if we need to know the number
2193         of elements at compile time.
2194         * fold-const.c (fold_vec_perm): Punt if the number of elements
2195         isn't known at compile time.
2197 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2199         * vec-perm-indices.h (vec_perm_builder): Change element type
2200         from HOST_WIDE_INT to poly_int64.
2201         (vec_perm_indices::element_type): Update accordingly.
2202         (vec_perm_indices::clamp): Handle polynomial element_types.
2203         * vec-perm-indices.c (vec_perm_indices::series_p): Likewise.
2204         (vec_perm_indices::all_in_range_p): Likewise.
2205         (tree_to_vec_perm_builder): Check for poly_int64 trees rather
2206         than shwi trees.
2207         * vector-builder.h (vector_builder::stepped_sequence_p): Handle
2208         polynomial vec_perm_indices element types.
2209         * int-vector-builder.h (int_vector_builder::equal_p): Likewise.
2210         * fold-const.c (fold_vec_perm): Likewise.
2211         * optabs.c (shift_amt_for_vec_perm_mask): Likewise.
2212         * tree-vect-generic.c (lower_vec_perm): Likewise.
2213         * tree-vect-slp.c (vect_transform_slp_perm_load): Likewise.
2214         * config/aarch64/aarch64.c (aarch64_evpc_tbl): Cast d->perm
2215         element type to HOST_WIDE_INT.
2217 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2218             Alan Hayward  <alan.hayward@arm.com>
2219             David Sherwood  <david.sherwood@arm.com>
2221         * alias.c (addr_side_effect_eval): Take the size as a poly_int64
2222         rather than an int.  Use plus_constant.
2223         (memrefs_conflict_p): Take the sizes as poly_int64s rather than ints.
2224         Take the offset "c" as a poly_int64 rather than a HOST_WIDE_INT.
2226 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2227             Alan Hayward  <alan.hayward@arm.com>
2228             David Sherwood  <david.sherwood@arm.com>
2230         * calls.c (emit_call_1, expand_call): Change struct_value_size from
2231         a HOST_WIDE_INT to a poly_int64.
2233 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2234             Alan Hayward  <alan.hayward@arm.com>
2235             David Sherwood  <david.sherwood@arm.com>
2237         * calls.c (load_register_parameters): Cope with polynomial
2238         mode sizes.  Require a constant size for BLKmode parameters
2239         that aren't described by a PARALLEL.  If BLOCK_REG_PADDING
2240         forces a parameter to be padded at the lsb end in order to
2241         fill a complete number of words, require the parameter size
2242         to be ordered wrt UNITS_PER_WORD.
2244 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2245             Alan Hayward  <alan.hayward@arm.com>
2246             David Sherwood  <david.sherwood@arm.com>
2248         * reload1.c (spill_stack_slot_width): Change element type
2249         from unsigned int to poly_uint64_pod.
2250         (alter_reg): Treat mode sizes as polynomial.
2252 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2253             Alan Hayward  <alan.hayward@arm.com>
2254             David Sherwood  <david.sherwood@arm.com>
2256         * reload.c (complex_word_subreg_p): New function.
2257         (reload_inner_reg_of_subreg, push_reload): Use it.
2259 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2260             Alan Hayward  <alan.hayward@arm.com>
2261             David Sherwood  <david.sherwood@arm.com>
2263         * lra-constraints.c (process_alt_operands): Reject matched
2264         operands whose sizes aren't ordered.
2265         (match_reload): Refer to this check here.
2267 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2268             Alan Hayward  <alan.hayward@arm.com>
2269             David Sherwood  <david.sherwood@arm.com>
2271         * builtins.c (expand_ifn_atomic_compare_exchange_into_call): Assert
2272         that the mode size is in the set {1, 2, 4, 8, 16}.
2274 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2275             Alan Hayward  <alan.hayward@arm.com>
2276             David Sherwood  <david.sherwood@arm.com>
2278         * var-tracking.c (adjust_mems): Treat mode sizes as polynomial.
2279         Use plus_constant instead of gen_rtx_PLUS.
2281 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2282             Alan Hayward  <alan.hayward@arm.com>
2283             David Sherwood  <david.sherwood@arm.com>
2285         * config/cr16/cr16-protos.h (cr16_push_rounding): Declare.
2286         * config/cr16/cr16.h (PUSH_ROUNDING): Move implementation to...
2287         * config/cr16/cr16.c (cr16_push_rounding): ...this new function.
2288         * config/h8300/h8300-protos.h (h8300_push_rounding): Declare.
2289         * config/h8300/h8300.h (PUSH_ROUNDING): Move implementation to...
2290         * config/h8300/h8300.c (h8300_push_rounding): ...this new function.
2291         * config/i386/i386-protos.h (ix86_push_rounding): Declare.
2292         * config/i386/i386.h (PUSH_ROUNDING): Move implementation to...
2293         * config/i386/i386.c (ix86_push_rounding): ...this new function.
2294         * config/m32c/m32c-protos.h (m32c_push_rounding): Take and return
2295         a poly_int64.
2296         * config/m32c/m32c.c (m32c_push_rounding): Likewise.
2297         * config/m68k/m68k-protos.h (m68k_push_rounding): Declare.
2298         * config/m68k/m68k.h (PUSH_ROUNDING): Move implementation to...
2299         * config/m68k/m68k.c (m68k_push_rounding): ...this new function.
2300         * config/pdp11/pdp11-protos.h (pdp11_push_rounding): Declare.
2301         * config/pdp11/pdp11.h (PUSH_ROUNDING): Move implementation to...
2302         * config/pdp11/pdp11.c (pdp11_push_rounding): ...this new function.
2303         * config/stormy16/stormy16-protos.h (xstormy16_push_rounding): Declare.
2304         * config/stormy16/stormy16.h (PUSH_ROUNDING): Move implementation to...
2305         * config/stormy16/stormy16.c (xstormy16_push_rounding): ...this new
2306         function.
2307         * expr.c (emit_move_resolve_push): Treat the input and result
2308         of PUSH_ROUNDING as a poly_int64.
2309         (emit_move_complex_push, emit_single_push_insn_1): Likewise.
2310         (emit_push_insn): Likewise.
2311         * lra-eliminations.c (mark_not_eliminable): Likewise.
2312         * recog.c (push_operand): Likewise.
2313         * reload1.c (elimination_effects): Likewise.
2314         * rtlanal.c (nonzero_bits1): Likewise.
2315         * calls.c (store_one_arg): Likewise.  Require the padding to be
2316         known at compile time.
2318 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2319             Alan Hayward  <alan.hayward@arm.com>
2320             David Sherwood  <david.sherwood@arm.com>
2322         * expr.c (emit_single_push_insn_1): Treat mode sizes as polynomial.
2323         Use plus_constant instead of gen_rtx_PLUS.
2325 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2326             Alan Hayward  <alan.hayward@arm.com>
2327             David Sherwood  <david.sherwood@arm.com>
2329         * auto-inc-dec.c (set_inc_state): Take the mode size as a poly_int64
2330         rather than an int.
2332 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2333             Alan Hayward  <alan.hayward@arm.com>
2334             David Sherwood  <david.sherwood@arm.com>
2336         * expr.c (expand_expr_real_1): Use tree_to_poly_uint64
2337         instead of int_size_in_bytes when handling VIEW_CONVERT_EXPRs
2338         via stack temporaries.  Treat the mode size as polynomial too.
2340 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2341             Alan Hayward  <alan.hayward@arm.com>
2342             David Sherwood  <david.sherwood@arm.com>
2344         * expr.c (expand_expr_real_2): When handling conversions involving
2345         unions, apply tree_to_poly_uint64 to the TYPE_SIZE rather than
2346         multiplying int_size_in_bytes by BITS_PER_UNIT.  Treat GET_MODE_BISIZE
2347         as a poly_uint64 too.
2349 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2350             Alan Hayward  <alan.hayward@arm.com>
2351             David Sherwood  <david.sherwood@arm.com>
2353         * rtlanal.c (subreg_get_info): Handle polynomial mode sizes.
2355 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2356             Alan Hayward  <alan.hayward@arm.com>
2357             David Sherwood  <david.sherwood@arm.com>
2359         * combine.c (can_change_dest_mode): Handle polynomial
2360         REGMODE_NATURAL_SIZE.
2361         * expmed.c (store_bit_field_1): Likewise.
2362         * expr.c (store_constructor): Likewise.
2363         * emit-rtl.c (validate_subreg): Operate on polynomial mode sizes
2364         and polynomial REGMODE_NATURAL_SIZE.
2365         (gen_lowpart_common): Likewise.
2366         * reginfo.c (record_subregs_of_mode): Likewise.
2367         * rtlanal.c (read_modify_subreg_p): Likewise.
2369 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2370             Alan Hayward  <alan.hayward@arm.com>
2371             David Sherwood  <david.sherwood@arm.com>
2373         * internal-fn.c (expand_vector_ubsan_overflow): Handle polynomial
2374         numbers of elements.
2376 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2377             Alan Hayward  <alan.hayward@arm.com>
2378             David Sherwood  <david.sherwood@arm.com>
2380         * match.pd: Cope with polynomial numbers of vector elements.
2382 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2383             Alan Hayward  <alan.hayward@arm.com>
2384             David Sherwood  <david.sherwood@arm.com>
2386         * fold-const.c (fold_indirect_ref_1): Handle polynomial offsets
2387         in a POINTER_PLUS_EXPR.
2389 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2390             Alan Hayward  <alan.hayward@arm.com>
2391             David Sherwood  <david.sherwood@arm.com>
2393         * omp-simd-clone.c (simd_clone_subparts): New function.
2394         (simd_clone_init_simd_arrays): Use it instead of TYPE_VECTOR_SUBPARTS.
2395         (ipa_simd_modify_function_body): Likewise.
2397 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2398             Alan Hayward  <alan.hayward@arm.com>
2399             David Sherwood  <david.sherwood@arm.com>
2401         * tree-vect-generic.c (nunits_for_known_piecewise_op): New function.
2402         (expand_vector_piecewise): Use it instead of TYPE_VECTOR_SUBPARTS.
2403         (expand_vector_addition, add_rshift, expand_vector_divmod): Likewise.
2404         (expand_vector_condition, vector_element): Likewise.
2405         (subparts_gt): New function.
2406         (get_compute_type): Use subparts_gt.
2407         (count_type_subparts): Delete.
2408         (expand_vector_operations_1): Use subparts_gt instead of
2409         count_type_subparts.
2411 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2412             Alan Hayward  <alan.hayward@arm.com>
2413             David Sherwood  <david.sherwood@arm.com>
2415         * tree-vect-data-refs.c (vect_no_alias_p): Replace with...
2416         (vect_compile_time_alias): ...this new function.  Do the calculation
2417         on poly_ints rather than trees.
2418         (vect_prune_runtime_alias_test_list): Update call accordingly.
2420 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2421             Alan Hayward  <alan.hayward@arm.com>
2422             David Sherwood  <david.sherwood@arm.com>
2424         * tree-vect-slp.c (vect_build_slp_tree_1): Handle polynomial
2425         numbers of units.
2426         (vect_schedule_slp_instance): Likewise.
2428 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2429             Alan Hayward  <alan.hayward@arm.com>
2430             David Sherwood  <david.sherwood@arm.com>
2432         * tree-vect-slp.c (vect_get_and_check_slp_defs): Reject
2433         constant and extern definitions for variable-length vectors.
2434         (vect_get_constant_vectors): Note that the number of units
2435         is known to be constant.
2437 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2438             Alan Hayward  <alan.hayward@arm.com>
2439             David Sherwood  <david.sherwood@arm.com>
2441         * tree-vect-stmts.c (vectorizable_conversion): Treat the number
2442         of units as polynomial.  Choose between WIDE and NARROW based
2443         on multiple_p.
2445 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2446             Alan Hayward  <alan.hayward@arm.com>
2447             David Sherwood  <david.sherwood@arm.com>
2449         * tree-vect-stmts.c (simd_clone_subparts): New function.
2450         (vectorizable_simd_clone_call): Use it instead of TYPE_VECTOR_SUBPARTS.
2452 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2453             Alan Hayward  <alan.hayward@arm.com>
2454             David Sherwood  <david.sherwood@arm.com>
2456         * tree-vect-stmts.c (vectorizable_call): Treat the number of
2457         vectors as polynomial.  Use build_index_vector for
2458         IFN_GOMP_SIMD_LANE.
2460 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2461             Alan Hayward  <alan.hayward@arm.com>
2462             David Sherwood  <david.sherwood@arm.com>
2464         * tree-vect-stmts.c (get_load_store_type): Treat the number of
2465         units as polynomial.  Reject VMAT_ELEMENTWISE and VMAT_STRIDED_SLP
2466         for variable-length vectors.
2467         (vectorizable_mask_load_store): Treat the number of units as
2468         polynomial, asserting that it is constant if the condition has
2469         already been enforced.
2470         (vectorizable_store, vectorizable_load): Likewise.
2472 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2473             Alan Hayward  <alan.hayward@arm.com>
2474             David Sherwood  <david.sherwood@arm.com>
2476         * tree-vect-loop.c (vectorizable_live_operation): Treat the number
2477         of units as polynomial.  Punt if we can't tell at compile time
2478         which vector contains the final result.
2480 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2481             Alan Hayward  <alan.hayward@arm.com>
2482             David Sherwood  <david.sherwood@arm.com>
2484         * tree-vect-loop.c (vectorizable_induction): Treat the number
2485         of units as polynomial.  Punt on SLP inductions.  Use an integer
2486         VEC_SERIES_EXPR for variable-length integer reductions.  Use a
2487         cast of such a series for variable-length floating-point
2488         reductions.
2490 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2491             Alan Hayward  <alan.hayward@arm.com>
2492             David Sherwood  <david.sherwood@arm.com>
2494         * tree.h (build_index_vector): Declare.
2495         * tree.c (build_index_vector): New function.
2496         * tree-vect-loop.c (get_initial_defs_for_reduction): Treat the number
2497         of units as polynomial, forcibly converting it to a constant if
2498         vectorizable_reduction has already enforced the condition.
2499         (vect_create_epilog_for_reduction): Likewise.  Use build_index_vector
2500         to create a {1,2,3,...} vector.
2501         (vectorizable_reduction): Treat the number of units as polynomial.
2502         Choose vectype_in based on the largest scalar element size rather
2503         than the smallest number of units.  Enforce the restrictions
2504         relied on above.
2506 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2507             Alan Hayward  <alan.hayward@arm.com>
2508             David Sherwood  <david.sherwood@arm.com>
2510         * tree-vect-data-refs.c (vector_alignment_reachable_p): Treat the
2511         number of units as polynomial.
2513 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2514             Alan Hayward  <alan.hayward@arm.com>
2515             David Sherwood  <david.sherwood@arm.com>
2517         * target.h (vector_sizes, auto_vector_sizes): New typedefs.
2518         * target.def (autovectorize_vector_sizes): Return the vector sizes
2519         by pointer, using vector_sizes rather than a bitmask.
2520         * targhooks.h (default_autovectorize_vector_sizes): Update accordingly.
2521         * targhooks.c (default_autovectorize_vector_sizes): Likewise.
2522         * config/aarch64/aarch64.c (aarch64_autovectorize_vector_sizes):
2523         Likewise.
2524         * config/arc/arc.c (arc_autovectorize_vector_sizes): Likewise.
2525         * config/arm/arm.c (arm_autovectorize_vector_sizes): Likewise.
2526         * config/i386/i386.c (ix86_autovectorize_vector_sizes): Likewise.
2527         * config/mips/mips.c (mips_autovectorize_vector_sizes): Likewise.
2528         * omp-general.c (omp_max_vf): Likewise.
2529         * omp-low.c (omp_clause_aligned_alignment): Likewise.
2530         * optabs-query.c (can_vec_mask_load_store_p): Likewise.
2531         * tree-vect-loop.c (vect_analyze_loop): Likewise.
2532         * tree-vect-slp.c (vect_slp_bb): Likewise.
2533         * doc/tm.texi: Regenerate.
2534         * tree-vectorizer.h (current_vector_size): Change from an unsigned int
2535         to a poly_uint64.
2536         * tree-vect-stmts.c (get_vectype_for_scalar_type_and_size): Take
2537         the vector size as a poly_uint64 rather than an unsigned int.
2538         (current_vector_size): Change from an unsigned int to a poly_uint64.
2539         (get_vectype_for_scalar_type): Update accordingly.
2540         * tree.h (build_truth_vector_type): Take the size and number of
2541         units as a poly_uint64 rather than an unsigned int.
2542         (build_vector_type): Add a temporary overload that takes
2543         the number of units as a poly_uint64 rather than an unsigned int.
2544         * tree.c (make_vector_type): Likewise.
2545         (build_truth_vector_type): Take the number of units as a poly_uint64
2546         rather than an unsigned int.
2548 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2549             Alan Hayward  <alan.hayward@arm.com>
2550             David Sherwood  <david.sherwood@arm.com>
2552         * target.def (get_mask_mode): Take the number of units and length
2553         as poly_uint64s rather than unsigned ints.
2554         * targhooks.h (default_get_mask_mode): Update accordingly.
2555         * targhooks.c (default_get_mask_mode): Likewise.
2556         * config/i386/i386.c (ix86_get_mask_mode): Likewise.
2557         * doc/tm.texi: Regenerate.
2559 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2560             Alan Hayward  <alan.hayward@arm.com>
2561             David Sherwood  <david.sherwood@arm.com>
2563         * omp-general.h (omp_max_vf): Return a poly_uint64 instead of an int.
2564         * omp-general.c (omp_max_vf): Likewise.
2565         * omp-expand.c (omp_adjust_chunk_size): Update call to omp_max_vf.
2566         (expand_omp_simd): Handle polynomial safelen.
2567         * omp-low.c (omplow_simd_context): Add a default constructor.
2568         (omplow_simd_context::max_vf): Change from int to poly_uint64.
2569         (lower_rec_simd_input_clauses): Update accordingly.
2570         (lower_rec_input_clauses): Likewise.
2572 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2573             Alan Hayward  <alan.hayward@arm.com>
2574             David Sherwood  <david.sherwood@arm.com>
2576         * tree-vectorizer.h (vect_nunits_for_cost): New function.
2577         * tree-vect-loop.c (vect_model_reduction_cost): Use it.
2578         * tree-vect-slp.c (vect_analyze_slp_cost_1): Likewise.
2579         (vect_analyze_slp_cost): Likewise.
2580         * tree-vect-stmts.c (vect_model_store_cost): Likewise.
2581         (vect_model_load_cost): Likewise.
2583 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2584             Alan Hayward  <alan.hayward@arm.com>
2585             David Sherwood  <david.sherwood@arm.com>
2587         * tree-vect-slp.c (vect_record_max_nunits, vect_build_slp_tree_1)
2588         (vect_build_slp_tree_2, vect_build_slp_tree): Change max_nunits
2589         from an unsigned int * to a poly_uint64_pod *.
2590         (calculate_unrolling_factor): New function.
2591         (vect_analyze_slp_instance): Use it.  Track polynomial max_nunits.
2593 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2594             Alan Hayward  <alan.hayward@arm.com>
2595             David Sherwood  <david.sherwood@arm.com>
2597         * tree-vectorizer.h (_slp_instance::unrolling_factor): Change
2598         from an unsigned int to a poly_uint64.
2599         (_loop_vec_info::slp_unrolling_factor): Likewise.
2600         (_loop_vec_info::vectorization_factor): Change from an int
2601         to a poly_uint64.
2602         (MAX_VECTORIZATION_FACTOR): Bump from 64 to INT_MAX.
2603         (vect_get_num_vectors): New function.
2604         (vect_update_max_nunits, vect_vf_for_cost): Likewise.
2605         (vect_get_num_copies): Use vect_get_num_vectors.
2606         (vect_analyze_data_ref_dependences): Change max_vf from an int *
2607         to an unsigned int *.
2608         (vect_analyze_data_refs): Change min_vf from an int * to a
2609         poly_uint64 *.
2610         (vect_transform_slp_perm_load): Take the vf as a poly_uint64 rather
2611         than an unsigned HOST_WIDE_INT.
2612         * tree-vect-data-refs.c (vect_analyze_possibly_independent_ddr)
2613         (vect_analyze_data_ref_dependence): Change max_vf from an int *
2614         to an unsigned int *.
2615         (vect_analyze_data_ref_dependences): Likewise.
2616         (vect_compute_data_ref_alignment): Handle polynomial vf.
2617         (vect_enhance_data_refs_alignment): Likewise.
2618         (vect_prune_runtime_alias_test_list): Likewise.
2619         (vect_shift_permute_load_chain): Likewise.
2620         (vect_supportable_dr_alignment): Likewise.
2621         (dependence_distance_ge_vf): Take the vectorization factor as a
2622         poly_uint64 rather than an unsigned HOST_WIDE_INT.
2623         (vect_analyze_data_refs): Change min_vf from an int * to a
2624         poly_uint64 *.
2625         * tree-vect-loop-manip.c (vect_gen_scalar_loop_niters): Take
2626         vfm1 as a poly_uint64 rather than an int.  Make the same change
2627         for the returned bound_scalar.
2628         (vect_gen_vector_loop_niters): Handle polynomial vf.
2629         (vect_do_peeling): Likewise.  Update call to
2630         vect_gen_scalar_loop_niters and handle polynomial bound_scalars.
2631         (vect_gen_vector_loop_niters_mult_vf): Assert that the vf must
2632         be constant.
2633         * tree-vect-loop.c (vect_determine_vectorization_factor)
2634         (vect_update_vf_for_slp, vect_analyze_loop_2): Handle polynomial vf.
2635         (vect_get_known_peeling_cost): Likewise.
2636         (vect_estimate_min_profitable_iters, vectorizable_reduction): Likewise.
2637         (vect_worthwhile_without_simd_p, vectorizable_induction): Likewise.
2638         (vect_transform_loop): Likewise.  Use the lowest possible VF when
2639         updating the upper bounds of the loop.
2640         (vect_min_worthwhile_factor): Make static.  Return an unsigned int
2641         rather than an int.
2642         * tree-vect-slp.c (vect_attempt_slp_rearrange_stmts): Cope with
2643         polynomial unroll factors.
2644         (vect_analyze_slp_cost_1, vect_analyze_slp_instance): Likewise.
2645         (vect_make_slp_decision): Likewise.
2646         (vect_supported_load_permutation_p): Likewise, and polynomial
2647         vf too.
2648         (vect_analyze_slp_cost): Handle polynomial vf.
2649         (vect_slp_analyze_node_operations): Likewise.
2650         (vect_slp_analyze_bb_1): Likewise.
2651         (vect_transform_slp_perm_load): Take the vf as a poly_uint64 rather
2652         than an unsigned HOST_WIDE_INT.
2653         * tree-vect-stmts.c (vectorizable_simd_clone_call, vectorizable_store)
2654         (vectorizable_load): Handle polynomial vf.
2655         * tree-vectorizer.c (simduid_to_vf::vf): Change from an int to
2656         a poly_uint64.
2657         (adjust_simduid_builtins, shrink_simd_arrays): Update accordingly.
2659 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2660             Alan Hayward  <alan.hayward@arm.com>
2661             David Sherwood  <david.sherwood@arm.com>
2663         * match.pd: Handle bit operations involving three constants
2664         and try to fold one pair.
2666 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2668         * tree-vect-loop-manip.c: Include gimple-fold.h.
2669         (slpeel_make_loop_iterate_ntimes): Add step, final_iv and
2670         niters_maybe_zero parameters.  Handle other cases besides a step of 1.
2671         (vect_gen_vector_loop_niters): Add a step_vector_ptr parameter.
2672         Add a path that uses a step of VF instead of 1, but disable it
2673         for now.
2674         (vect_do_peeling): Add step_vector, niters_vector_mult_vf_var
2675         and niters_no_overflow parameters.  Update calls to
2676         slpeel_make_loop_iterate_ntimes and vect_gen_vector_loop_niters.
2677         Create a new SSA name if the latter choses to use a ste other
2678         than zero, and return it via niters_vector_mult_vf_var.
2679         * tree-vect-loop.c (vect_transform_loop): Update calls to
2680         vect_do_peeling, vect_gen_vector_loop_niters and
2681         slpeel_make_loop_iterate_ntimes.
2682         * tree-vectorizer.h (slpeel_make_loop_iterate_ntimes, vect_do_peeling)
2683         (vect_gen_vector_loop_niters): Update declarations after above changes.
2685 2018-01-02  Michael Meissner  <meissner@linux.vnet.ibm.com>
2687         * config/rs6000/rs6000.md (floor<mode>2): Add support for IEEE
2688         128-bit round to integer instructions.
2689         (ceil<mode>2): Likewise.
2690         (btrunc<mode>2): Likewise.
2691         (round<mode>2): Likewise.
2693 2018-01-02  Aaron Sawdey  <acsawdey@linux.vnet.ibm.com>
2695         * config/rs6000/rs6000-string.c (expand_block_move): Allow the use of
2696         unaligned VSX load/store on P8/P9.
2697         (expand_block_clear): Allow the use of unaligned VSX
2698         load/store on P8/P9.
2700 2018-01-02  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
2702         * config/rs6000/rs6000-p8swap.c (swap_feeds_both_load_and_store):
2703         New function.
2704         (rs6000_analyze_swaps): Mark a web unoptimizable if it contains a
2705         swap associated with both a load and a store.
2707 2018-01-02  Andrew Waterman  <andrew@sifive.com>
2709         * config/riscv/linux.h (ICACHE_FLUSH_FUNC): New.
2710         * config/riscv/riscv.md (clear_cache): Use it.
2712 2018-01-02  Artyom Skrobov  <tyomitch@gmail.com>
2714         * web.c: Remove out-of-date comment.
2716 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
2718         * expr.c (fixup_args_size_notes): Check that any existing
2719         REG_ARGS_SIZE notes are correct, and don't try to re-add them.
2720         (emit_single_push_insn_1): Move stack_pointer_delta adjustment to...
2721         (emit_single_push_insn): ...here.
2723 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
2725         * rtl.h (CONST_VECTOR_ELT): Redefine to const_vector_elt.
2726         (const_vector_encoded_nelts): New function.
2727         (CONST_VECTOR_NUNITS): Redefine to use GET_MODE_NUNITS.
2728         (const_vector_int_elt, const_vector_elt): Declare.
2729         * emit-rtl.c (const_vector_int_elt_1): New function.
2730         (const_vector_elt): Likewise.
2731         * simplify-rtx.c (simplify_immed_subreg): Avoid taking the address
2732         of CONST_VECTOR_ELT.
2734 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
2736         * expr.c: Include rtx-vector-builder.h.
2737         (const_vector_mask_from_tree): Use rtx_vector_builder and operate
2738         directly on the tree encoding.
2739         (const_vector_from_tree): Likewise.
2740         * optabs.c: Include rtx-vector-builder.h.
2741         (expand_vec_perm_var): Use rtx_vector_builder and create a repeating
2742         sequence of "u" values.
2743         * vec-perm-indices.c: Include rtx-vector-builder.h.
2744         (vec_perm_indices_to_rtx): Use rtx_vector_builder and operate
2745         directly on the vec_perm_indices encoding.
2747 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
2749         * doc/rtl.texi (const_vector): Describe new encoding scheme.
2750         * Makefile.in (OBJS): Add rtx-vector-builder.o.
2751         * rtx-vector-builder.h: New file.
2752         * rtx-vector-builder.c: Likewise.
2753         * rtl.h (rtx_def::u2): Add a const_vector field.
2754         (CONST_VECTOR_NPATTERNS): New macro.
2755         (CONST_VECTOR_NELTS_PER_PATTERN): Likewise.
2756         (CONST_VECTOR_DUPLICATE_P): Likewise.
2757         (CONST_VECTOR_STEPPED_P): Likewise.
2758         (CONST_VECTOR_ENCODED_ELT): Likewise.
2759         (const_vec_duplicate_p): Check for a duplicated vector encoding.
2760         (unwrap_const_vec_duplicate): Likewise.
2761         (const_vec_series_p): Check for a non-duplicated vector encoding.
2762         Say that the function only returns true for integer vectors.
2763         * emit-rtl.c: Include rtx-vector-builder.h.
2764         (gen_const_vec_duplicate_1): Delete.
2765         (gen_const_vector): Call gen_const_vec_duplicate instead of
2766         gen_const_vec_duplicate_1.
2767         (const_vec_series_p_1): Operate directly on the CONST_VECTOR encoding.
2768         (gen_const_vec_duplicate): Use rtx_vector_builder.
2769         (gen_const_vec_series): Likewise.
2770         (gen_rtx_CONST_VECTOR): Likewise.
2771         * config/powerpcspe/powerpcspe.c: Include rtx-vector-builder.h.
2772         (swap_const_vector_halves): Take an rtx pointer rather than rtx.
2773         Build a new vector rather than modifying a CONST_VECTOR in-place.
2774         (handle_special_swappables): Update call accordingly.
2775         * config/rs6000/rs6000-p8swap.c: Include rtx-vector-builder.h.
2776         (swap_const_vector_halves): Take an rtx pointer rather than rtx.
2777         Build a new vector rather than modifying a CONST_VECTOR in-place.
2778         (handle_special_swappables): Update call accordingly.
2780 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
2782         * simplify-rtx.c (simplify_const_binary_operation): Use
2783         CONST_VECTOR_ELT instead of XVECEXP.
2785 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
2787         * tree-cfg.c (verify_gimple_assign_ternary): Allow the size of
2788         the selector elements to be different from the data elements
2789         if the selector is a VECTOR_CST.
2790         * tree-vect-stmts.c (vect_gen_perm_mask_any): Use a vector of
2791         ssizetype for the selector.
2793 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
2795         * optabs.c (shift_amt_for_vec_perm_mask): Try using series_p
2796         before testing each element individually.
2797         * tree-vect-generic.c (lower_vec_perm): Likewise.
2799 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
2801         * selftest.h (selftest::vec_perm_indices_c_tests): Declare.
2802         * selftest-run-tests.c (selftest::run_tests): Call it.
2803         * vector-builder.h (vector_builder::operator ==): New function.
2804         (vector_builder::operator !=): Likewise.
2805         * vec-perm-indices.h (vec_perm_indices::series_p): Declare.
2806         (vec_perm_indices::all_from_input_p): New function.
2807         * vec-perm-indices.c (vec_perm_indices::series_p): Likewise.
2808         (test_vec_perm_12, selftest::vec_perm_indices_c_tests): Likewise.
2809         * fold-const.c (fold_ternary_loc): Use tree_to_vec_perm_builder
2810         instead of reading the VECTOR_CST directly.  Detect whether both
2811         vector inputs are the same before constructing the vec_perm_indices,
2812         and update the number of inputs argument accordingly.  Use the
2813         utility functions added above.  Only construct sel2 if we need to.
2815 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
2817         * optabs.c (expand_vec_perm_var): Use an explicit encoding for
2818         the broadcast of the low byte.
2819         (expand_mult_highpart): Use an explicit encoding for the permutes.
2820         * optabs-query.c (can_mult_highpart_p): Likewise.
2821         * tree-vect-loop.c (calc_vec_perm_mask_for_shift): Likewise.
2822         * tree-vect-stmts.c (perm_mask_for_reverse): Likewise.
2823         (vectorizable_bswap): Likewise.
2824         * tree-vect-data-refs.c (vect_grouped_store_supported): Use an
2825         explicit encoding for the power-of-2 permutes.
2826         (vect_permute_store_chain): Likewise.
2827         (vect_grouped_load_supported): Likewise.
2828         (vect_permute_load_chain): Likewise.
2830 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
2832         * vec-perm-indices.h (vec_perm_indices_to_tree): Declare.
2833         * vec-perm-indices.c (vec_perm_indices_to_tree): New function.
2834         * tree-ssa-forwprop.c (simplify_vector_constructor): Use it.
2835         * tree-vect-slp.c (vect_transform_slp_perm_load): Likewise.
2836         * tree-vect-stmts.c (vectorizable_bswap): Likewise.
2837         (vect_gen_perm_mask_any): Likewise.
2839 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
2841         * int-vector-builder.h: New file.
2842         * vec-perm-indices.h: Include int-vector-builder.h.
2843         (vec_perm_indices): Redefine as an int_vector_builder.
2844         (auto_vec_perm_indices): Delete.
2845         (vec_perm_builder): Redefine as a stand-alone class.
2846         (vec_perm_indices::vec_perm_indices): New function.
2847         (vec_perm_indices::clamp): Likewise.
2848         * vec-perm-indices.c: Include fold-const.h and tree-vector-builder.h.
2849         (vec_perm_indices::new_vector): New function.
2850         (vec_perm_indices::new_expanded_vector): Update for new
2851         vec_perm_indices class.
2852         (vec_perm_indices::rotate_inputs): New function.
2853         (vec_perm_indices::all_in_range_p): Operate directly on the
2854         encoded form, without computing elided elements.
2855         (tree_to_vec_perm_builder): Operate directly on the VECTOR_CST
2856         encoding.  Update for new vec_perm_indices class.
2857         * optabs.c (expand_vec_perm_const): Create a vec_perm_indices for
2858         the given vec_perm_builder.
2859         (expand_vec_perm_var): Update vec_perm_builder constructor.
2860         (expand_mult_highpart): Use vec_perm_builder instead of
2861         auto_vec_perm_indices.
2862         * optabs-query.c (can_mult_highpart_p): Use vec_perm_builder and
2863         vec_perm_indices instead of auto_vec_perm_indices.  Use a single
2864         or double series encoding as appropriate.
2865         * fold-const.c (fold_ternary_loc): Use vec_perm_builder and
2866         vec_perm_indices instead of auto_vec_perm_indices.
2867         * tree-ssa-forwprop.c (simplify_vector_constructor): Likewise.
2868         * tree-vect-data-refs.c (vect_grouped_store_supported): Likewise.
2869         (vect_permute_store_chain): Likewise.
2870         (vect_grouped_load_supported): Likewise.
2871         (vect_permute_load_chain): Likewise.
2872         (vect_shift_permute_load_chain): Likewise.
2873         * tree-vect-slp.c (vect_build_slp_tree_1): Likewise.
2874         (vect_transform_slp_perm_load): Likewise.
2875         (vect_schedule_slp_instance): Likewise.
2876         * tree-vect-stmts.c (perm_mask_for_reverse): Likewise.
2877         (vectorizable_mask_load_store): Likewise.
2878         (vectorizable_bswap): Likewise.
2879         (vectorizable_store): Likewise.
2880         (vectorizable_load): Likewise.
2881         * tree-vect-generic.c (lower_vec_perm): Use vec_perm_builder and
2882         vec_perm_indices instead of auto_vec_perm_indices.  Use
2883         tree_to_vec_perm_builder to read the vector from a tree.
2884         * tree-vect-loop.c (calc_vec_perm_mask_for_shift): Take a
2885         vec_perm_builder instead of a vec_perm_indices.
2886         (have_whole_vector_shift): Use vec_perm_builder and
2887         vec_perm_indices instead of auto_vec_perm_indices.  Leave the
2888         truncation to calc_vec_perm_mask_for_shift.
2889         (vect_create_epilog_for_reduction): Likewise.
2890         * config/aarch64/aarch64.c (expand_vec_perm_d::perm): Change
2891         from auto_vec_perm_indices to vec_perm_indices.
2892         (aarch64_expand_vec_perm_const_1): Use rotate_inputs on d.perm
2893         instead of changing individual elements.
2894         (aarch64_vectorize_vec_perm_const): Use new_vector to install
2895         the vector in d.perm.
2896         * config/arm/arm.c (expand_vec_perm_d::perm): Change
2897         from auto_vec_perm_indices to vec_perm_indices.
2898         (arm_expand_vec_perm_const_1): Use rotate_inputs on d.perm
2899         instead of changing individual elements.
2900         (arm_vectorize_vec_perm_const): Use new_vector to install
2901         the vector in d.perm.
2902         * config/powerpcspe/powerpcspe.c (rs6000_expand_extract_even):
2903         Update vec_perm_builder constructor.
2904         (rs6000_expand_interleave): Likewise.
2905         * config/rs6000/rs6000.c (rs6000_expand_extract_even): Likewise.
2906         (rs6000_expand_interleave): Likewise.
2908 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
2910         * optabs-query.c (can_vec_perm_var_p): Check whether lowering
2911         to qimode could truncate the indices.
2912         * optabs.c (expand_vec_perm_var): Likewise.
2914 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
2916         * Makefile.in (OBJS): Add vec-perm-indices.o.
2917         * vec-perm-indices.h: New file.
2918         * vec-perm-indices.c: Likewise.
2919         * target.h (vec_perm_indices): Replace with a forward class
2920         declaration.
2921         (auto_vec_perm_indices): Move to vec-perm-indices.h.
2922         * optabs.h: Include vec-perm-indices.h.
2923         (expand_vec_perm): Delete.
2924         (selector_fits_mode_p, expand_vec_perm_var): Declare.
2925         (expand_vec_perm_const): Declare.
2926         * target.def (vec_perm_const_ok): Replace with...
2927         (vec_perm_const): ...this new hook.
2928         * doc/tm.texi.in (TARGET_VECTORIZE_VEC_PERM_CONST_OK): Replace with...
2929         (TARGET_VECTORIZE_VEC_PERM_CONST): ...this new hook.
2930         * doc/tm.texi: Regenerate.
2931         * optabs.def (vec_perm_const): Delete.
2932         * doc/md.texi (vec_perm_const): Likewise.
2933         (vec_perm): Refer to TARGET_VECTORIZE_VEC_PERM_CONST.
2934         * expr.c (expand_expr_real_2): Use expand_vec_perm_const rather than
2935         expand_vec_perm for constant permutation vectors.  Assert that
2936         the mode of variable permutation vectors is the integer equivalent
2937         of the mode that is being permuted.
2938         * optabs-query.h (selector_fits_mode_p): Declare.
2939         * optabs-query.c: Include vec-perm-indices.h.
2940         (selector_fits_mode_p): New function.
2941         (can_vec_perm_const_p): Check whether targetm.vectorize.vec_perm_const
2942         is defined, instead of checking whether the vec_perm_const_optab
2943         exists.  Use targetm.vectorize.vec_perm_const instead of
2944         targetm.vectorize.vec_perm_const_ok.  Check whether the indices
2945         fit in the vector mode before using a variable permute.
2946         * optabs.c (shift_amt_for_vec_perm_mask): Take a mode and a
2947         vec_perm_indices instead of an rtx.
2948         (expand_vec_perm): Replace with...
2949         (expand_vec_perm_const): ...this new function.  Take the selector
2950         as a vec_perm_indices rather than an rtx.  Also take the mode of
2951         the selector.  Update call to shift_amt_for_vec_perm_mask.
2952         Use targetm.vectorize.vec_perm_const instead of vec_perm_const_optab.
2953         Use vec_perm_indices::new_expanded_vector to expand the original
2954         selector into bytes.  Check whether the indices fit in the vector
2955         mode before using a variable permute.
2956         (expand_vec_perm_var): Make global.
2957         (expand_mult_highpart): Use expand_vec_perm_const.
2958         * fold-const.c: Includes vec-perm-indices.h.
2959         * tree-ssa-forwprop.c: Likewise.
2960         * tree-vect-data-refs.c: Likewise.
2961         * tree-vect-generic.c: Likewise.
2962         * tree-vect-loop.c: Likewise.
2963         * tree-vect-slp.c: Likewise.
2964         * tree-vect-stmts.c: Likewise.
2965         * config/aarch64/aarch64-protos.h (aarch64_expand_vec_perm_const):
2966         Delete.
2967         * config/aarch64/aarch64-simd.md (vec_perm_const<mode>): Delete.
2968         * config/aarch64/aarch64.c (aarch64_expand_vec_perm_const)
2969         (aarch64_vectorize_vec_perm_const_ok): Fuse into...
2970         (aarch64_vectorize_vec_perm_const): ...this new function.
2971         (TARGET_VECTORIZE_VEC_PERM_CONST_OK): Delete.
2972         (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
2973         * config/arm/arm-protos.h (arm_expand_vec_perm_const): Delete.
2974         * config/arm/vec-common.md (vec_perm_const<mode>): Delete.
2975         * config/arm/arm.c (TARGET_VECTORIZE_VEC_PERM_CONST_OK): Delete.
2976         (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
2977         (arm_expand_vec_perm_const, arm_vectorize_vec_perm_const_ok): Merge
2978         into...
2979         (arm_vectorize_vec_perm_const): ...this new function.  Explicitly
2980         check for NEON modes.
2981         * config/i386/i386-protos.h (ix86_expand_vec_perm_const): Delete.
2982         * config/i386/sse.md (VEC_PERM_CONST, vec_perm_const<mode>): Delete.
2983         * config/i386/i386.c (ix86_expand_vec_perm_const_1): Update comment.
2984         (ix86_expand_vec_perm_const, ix86_vectorize_vec_perm_const_ok): Merge
2985         into...
2986         (ix86_vectorize_vec_perm_const): ...this new function.  Incorporate
2987         the old VEC_PERM_CONST conditions.
2988         * config/ia64/ia64-protos.h (ia64_expand_vec_perm_const): Delete.
2989         * config/ia64/vect.md (vec_perm_const<mode>): Delete.
2990         * config/ia64/ia64.c (ia64_expand_vec_perm_const)
2991         (ia64_vectorize_vec_perm_const_ok): Merge into...
2992         (ia64_vectorize_vec_perm_const): ...this new function.
2993         * config/mips/loongson.md (vec_perm_const<mode>): Delete.
2994         * config/mips/mips-msa.md (vec_perm_const<mode>): Delete.
2995         * config/mips/mips-ps-3d.md (vec_perm_constv2sf): Delete.
2996         * config/mips/mips-protos.h (mips_expand_vec_perm_const): Delete.
2997         * config/mips/mips.c (mips_expand_vec_perm_const)
2998         (mips_vectorize_vec_perm_const_ok): Merge into...
2999         (mips_vectorize_vec_perm_const): ...this new function.
3000         * config/powerpcspe/altivec.md (vec_perm_constv16qi): Delete.
3001         * config/powerpcspe/paired.md (vec_perm_constv2sf): Delete.
3002         * config/powerpcspe/spe.md (vec_perm_constv2si): Delete.
3003         * config/powerpcspe/vsx.md (vec_perm_const<mode>): Delete.
3004         * config/powerpcspe/powerpcspe-protos.h (altivec_expand_vec_perm_const)
3005         (rs6000_expand_vec_perm_const): Delete.
3006         * config/powerpcspe/powerpcspe.c (TARGET_VECTORIZE_VEC_PERM_CONST_OK):
3007         Delete.
3008         (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
3009         (altivec_expand_vec_perm_const_le): Take each operand individually.
3010         Operate on constant selectors rather than rtxes.
3011         (altivec_expand_vec_perm_const): Likewise.  Update call to
3012         altivec_expand_vec_perm_const_le.
3013         (rs6000_expand_vec_perm_const): Delete.
3014         (rs6000_vectorize_vec_perm_const_ok): Delete.
3015         (rs6000_vectorize_vec_perm_const): New function.
3016         (rs6000_do_expand_vec_perm): Take a vec_perm_builder instead of
3017         an element count and rtx array.
3018         (rs6000_expand_extract_even): Update call accordingly.
3019         (rs6000_expand_interleave): Likewise.
3020         * config/rs6000/altivec.md (vec_perm_constv16qi): Delete.
3021         * config/rs6000/paired.md (vec_perm_constv2sf): Delete.
3022         * config/rs6000/vsx.md (vec_perm_const<mode>): Delete.
3023         * config/rs6000/rs6000-protos.h (altivec_expand_vec_perm_const)
3024         (rs6000_expand_vec_perm_const): Delete.
3025         * config/rs6000/rs6000.c (TARGET_VECTORIZE_VEC_PERM_CONST_OK): Delete.
3026         (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
3027         (altivec_expand_vec_perm_const_le): Take each operand individually.
3028         Operate on constant selectors rather than rtxes.
3029         (altivec_expand_vec_perm_const): Likewise.  Update call to
3030         altivec_expand_vec_perm_const_le.
3031         (rs6000_expand_vec_perm_const): Delete.
3032         (rs6000_vectorize_vec_perm_const_ok): Delete.
3033         (rs6000_vectorize_vec_perm_const): New function.  Remove stray
3034         reference to the SPE evmerge intructions.
3035         (rs6000_do_expand_vec_perm): Take a vec_perm_builder instead of
3036         an element count and rtx array.
3037         (rs6000_expand_extract_even): Update call accordingly.
3038         (rs6000_expand_interleave): Likewise.
3039         * config/sparc/sparc.md (vec_perm_constv8qi): Delete in favor of...
3040         * config/sparc/sparc.c (sparc_vectorize_vec_perm_const): ...this
3041         new function.
3042         (TARGET_VECTORIZE_VEC_PERM_CONST): Redefine.
3044 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
3046         * optabs.c (expand_vec_perm_1): Assert that SEL has an integer
3047         vector mode and that that mode matches the mode of the data
3048         being permuted.
3049         (expand_vec_perm): Split handling of non-CONST_VECTOR selectors
3050         out into expand_vec_perm_var.  Do all CONST_VECTOR handling here,
3051         directly using expand_vec_perm_1 when forcing selectors into
3052         registers.
3053         (expand_vec_perm_var): New function, split out from expand_vec_perm.
3055 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
3057         * optabs-query.h (can_vec_perm_p): Delete.
3058         (can_vec_perm_var_p, can_vec_perm_const_p): Declare.
3059         * optabs-query.c (can_vec_perm_p): Split into...
3060         (can_vec_perm_var_p, can_vec_perm_const_p): ...these two functions.
3061         (can_mult_highpart_p): Use can_vec_perm_const_p to test whether a
3062         particular selector is valid.
3063         * tree-ssa-forwprop.c (simplify_vector_constructor): Likewise.
3064         * tree-vect-data-refs.c (vect_grouped_store_supported): Likewise.
3065         (vect_grouped_load_supported): Likewise.
3066         (vect_shift_permute_load_chain): Likewise.
3067         * tree-vect-slp.c (vect_build_slp_tree_1): Likewise.
3068         (vect_transform_slp_perm_load): Likewise.
3069         * tree-vect-stmts.c (perm_mask_for_reverse): Likewise.
3070         (vectorizable_bswap): Likewise.
3071         (vect_gen_perm_mask_checked): Likewise.
3072         * fold-const.c (fold_ternary_loc): Likewise.  Don't take
3073         implementations of variable permutation vectors into account
3074         when deciding which selector to use.
3075         * tree-vect-loop.c (have_whole_vector_shift): Don't check whether
3076         vec_perm_const_optab is supported; instead use can_vec_perm_const_p
3077         with a false third argument.
3078         * tree-vect-generic.c (lower_vec_perm): Use can_vec_perm_const_p
3079         to test whether the constant selector is valid and can_vec_perm_var_p
3080         to test whether a variable selector is valid.
3082 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
3084         * optabs-query.h (can_vec_perm_p): Take a const vec_perm_indices *.
3085         * optabs-query.c (can_vec_perm_p): Likewise.
3086         * fold-const.c (fold_vec_perm): Take a const vec_perm_indices &
3087         instead of vec_perm_indices.
3088         * tree-vectorizer.h (vect_gen_perm_mask_any): Likewise,
3089         (vect_gen_perm_mask_checked): Likewise,
3090         * tree-vect-stmts.c (vect_gen_perm_mask_any): Likewise,
3091         (vect_gen_perm_mask_checked): Likewise,
3093 2018-01-02  Richard Sandiford  <richard.sandiford@linaro.org>
3095         * optabs-query.h (qimode_for_vec_perm): Declare.
3096         * optabs-query.c (can_vec_perm_p): Split out qimode search to...
3097         (qimode_for_vec_perm): ...this new function.
3098         * optabs.c (expand_vec_perm): Use qimode_for_vec_perm.
3100 2018-01-02  Aaron Sawdey  <acsawdey@linux.vnet.ibm.com>
3102         * rtlanal.c (canonicalize_condition): Return 0 if final rtx
3103         does not have a conditional at the top.
3105 2018-01-02  Richard Biener  <rguenther@suse.de>
3107         * ipa-inline.c (big_speedup_p): Fix expression.
3109 2018-01-02  Jan Hubicka  <hubicka@ucw.cz>
3111         PR target/81616
3112         * config/i386/x86-tune-costs.h: Increase cost of integer load costs
3113         for generic 4->6.
3115 2018-01-02  Jan Hubicka  <hubicka@ucw.cz>
3117         PR target/81616
3118         Generic tuning.
3119         * x86-tune-costs.h (generic_cost): Reduce cost of FDIV 20->17,
3120         cost of sqrt 20->14, DIVSS 18->13, DIVSD 32->17, SQRtSS 30->14
3121         and SQRTsD 58->18, cond_not_taken_branch_cost. 2->1. Increase
3122         cond_taken_branch_cost 3->4.
3124 2018-01-01  Jakub Jelinek  <jakub@redhat.com>
3126         PR tree-optimization/83581
3127         * tree-loop-distribution.c (pass_loop_distribution::execute): Return
3128         TODO_cleanup_cfg if any changes have been made.
3130         PR middle-end/83608
3131         * expr.c (store_expr_with_bounds): Use simplify_gen_subreg instead of
3132         convert_modes if target mode has the right side, but different mode
3133         class.
3135         PR middle-end/83609
3136         * expr.c (expand_assignment): Fix up a typo in simplify_gen_subreg
3137         last argument when extracting from CONCAT.  If either from_real or
3138         from_imag is NULL, use expansion through memory.  If result is not
3139         a CONCAT and simplify_gen_subreg fails, try to simplify_gen_subreg
3140         the parts directly to inner mode, if even that fails, use expansion
3141         through memory.
3143         PR middle-end/83623
3144         * expmed.c (expand_shift_1): For 2-byte rotates by BITS_PER_UNIT,
3145         check for bswap in mode rather than HImode and use that in expand_unop
3146         too.
3148 Copyright (C) 2018 Free Software Foundation, Inc.
3150 Copying and distribution of this file, with or without modification,
3151 are permitted in any medium without royalty provided the copyright
3152 notice and this notice are preserved.