Merge in wide-int.
[gcc.git] / gcc / ChangeLog.wide-int
1 2013-11-21 Kenneth Zadeck <zadeck@naturalbridge.com>
2 Mike Stump <mikestump@comcast.net>
3 Richard Sandiford <rdsandiford@googlemail.com>
4 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
5
6 * alias.c (ao_ref_from_mem): Use wide-int interfaces.
7 (rtx_equal_for_memref_p): Update comment.
8 (adjust_offset_for_component_ref): Use wide-int interfaces.
9 * builtins.c (get_object_alignment_2): Likewise.
10 (c_readstr): Likewise.
11 (target_char_cast): Add comment.
12 (determine_block_size): Use wide-int interfaces.
13 (expand_builtin_signbit): Likewise.
14 (fold_builtin_int_roundingfn): Likewise.
15 (fold_builtin_bitop): Likewise.
16 (fold_builtin_bswap): Likewise.
17 (fold_builtin_logarithm): Use signop.
18 (fold_builtin_pow): Likewise.
19 (fold_builtin_memory_op): Use wide-int interfaces.
20 (fold_builtin_object_size): Likewise.
21 * cfgloop.c (alloc_loop): Initialize nb_iterations_upper_bound and
22 nb_iterations_estimate.
23 (record_niter_bound): Use wide-int interfaces.
24 (get_estimated_loop_iterations_int): Likewise.
25 (get_estimated_loop_iterations): Likewise.
26 (get_max_loop_iterations): Likewise.
27 * cfgloop.h: Include wide-int.h.
28 (struct nb_iter_bound): Change bound to widest_int.
29 (struct loop): Change nb_iterations_upper_bound and
30 nb_iterations_estimate to widest_int.
31 (record_niter_bound): Switch to use widest_int.
32 (get_estimated_loop_iterations): Likewise.
33 (get_max_loop_iterations): Likewise.
34 (gcov_type_to_double_int): Rename to gcov_type_to_wide_int and
35 update for wide-int.
36 * cgraph.c (cgraph_add_thunk): Use wide-int interfaces.
37 * combine.c (try_combine): Likewise.
38 (subst): Use CONST_SCALAR_INT_P rather than CONST_INT_P.
39 * config/aarch64/aarch64.c (aapcs_vfp_sub_candidate): Use wide-int
40 interfaces.
41 (aarch64_float_const_representable_p): Likewise.
42 * config/arc/arc.c: Include wide-int.h.
43 (arc_can_use_doloop_p): Use wide-int interfaces.
44 * config/arm/arm.c (aapcs_vfp_sub_candidate): Likewise.
45 (vfp3_const_double_index): Likewise.
46 * config/avr/avr.c (avr_out_round): Likewise.
47 (avr_fold_builtin): Likewise.
48 * config/bfin/bfin.c (bfin_local_alignment): Likewise.
49 (bfin_can_use_doloop_p): Likewise.
50 * config/darwin.c (darwin_mergeable_constant_section): Likewise.
51 (machopic_select_rtx_section): Update to handle CONST_WIDE_INT.
52 * config/i386/i386.c: Include wide-int.h.
53 (ix86_data_alignment): Use wide-int interfaces.
54 (ix86_local_alignment): Likewise.
55 (ix86_emit_swsqrtsf): Update real_from_integer.
56 * config/msp430/msp430.c (msp430_attr): Use wide-int interfaces.
57 * config/nds32/nds32.c (nds32_insert_attributes): Likewise.
58 * config/rs6000/predicates.md (any_operand): Add const_wide_int.
59 (zero_constant): Likewise.
60 (input_operand): Likewise.
61 (splat_input_operand): Likewise.
62 (non_logical_cint_operand): Change const_double to const_wide_int.
63 * config/rs6000/rs6000.c (num_insns_constant): Handle CONST_WIDE_INT.
64 (easy_altivec_constant): Remove comment.
65 (paired_expand_vector_init): Use CONSTANT_P.
66 (rs6000_legitimize_address): Handle CONST_WIDE_INT.
67 (rs6000_emit_move): Update checks.
68 (rs6000_aggregate_candidate): Use wide-int interfaces.
69 (rs6000_expand_ternop_builtin): Likewise.
70 (rs6000_output_move_128bit): Handle CONST_WIDE_INT.
71 (rs6000_assemble_integer): Likewise.
72 (rs6000_hash_constant): Likewise.
73 (output_toc): Likewise.
74 (rs6000_rtx_costs): Likewise.
75 (rs6000_emit_swrsqrt); Update call to real_from_integer.
76 * config/rs6000/rs6000-c.c: Include wide-int.h.
77 (altivec_resolve_overloaded_builtin): Use wide-int interfaces.
78 * config/rs6000/rs6000.h (TARGET_SUPPORTS_WIDE_INT): New.
79 * config/rs6000/rs6000.md: Use const_scalar_int_operand.
80 Handle CONST_WIDE_INT.
81 * config/sol2-c.c (solaris_pragma_align): Change low to unsigned HWI.
82 Use tree_fits_uhwi_p.
83 * config/sparc/sparc.c: Include wide-int.h.
84 (sparc_fold_builtin): Use wide-int interfaces.
85 * config/vax/vax.c: Include wide-int.h.
86 (vax_float_literal): Use real_from_integer.
87 * coretypes.h (struct hwivec_def): New.
88 (hwivec): New.
89 (const_hwivec): New.
90 * cse.c (hash_rtx_cb): Handle CONST_WIDE_INT.
91 (equiv_constant): Handle CONST_WIDE_INT.
92 * cselib.c (rtx_equal_for_cselib_1): Use CASE_CONST_UNIQUE.
93 (cselib_hash_rtx): Handle CONST_WIDE_INT.
94 * dbxout.c (stabstr_U): Use wide-int interfaces.
95 (dbxout_type): Update to use cst_fits_shwi_p.
96 * defaults.h (LOG2_BITS_PER_UNIT): Define.
97 (TARGET_SUPPORTS_WIDE_INT): Add default.
98 * dfp.c: Include wide-int.h.
99 (decimal_real_to_integer2): Use wide-int interfaces and rename to
100 decimal_real_to_integer.
101 * dfp.h (decimal_real_to_integer2): Return a wide_int and rename to
102 decimal_real_to_integer.
103 * doc/generic.texi (Constant expressions): Update for wide_int.
104 * doc/rtl.texi (const_double): Likewise.
105 (const_wide_int, CONST_WIDE_INT, CONST_WIDE_INT_VEC): New.
106 (CONST_WIDE_INT_NUNITS, CONST_WIDE_INT_ELT): New.
107 * doc/tm.texi.in (REAL_VALUE_TO_INT): Remove.
108 (REAL_VALUE_FROM_INT): Remove.
109 (TARGET_SUPPORTS_WIDE_INT): New.
110 * doc/tm.texi: Regenerate.
111 * dojump.c (prefer_and_bit_test): Use wide-int interfaces.
112 * double-int.h: Include wide-int.h.
113 (struct wi::int_traits): New.
114 * dwarf2out.c (get_full_len): New.
115 (dw_val_equal_p): Add case dw_val_class_wide_int.
116 (size_of_loc_descr): Likewise.
117 (output_loc_operands): Likewise.
118 (insert_double): Remove.
119 (insert_wide_int): New.
120 (add_AT_wide): New.
121 (print_die): Add case dw_val_class_wide_int.
122 (attr_checksum): Likewise.
123 (attr_checksum_ordered): Likewise.
124 (same_dw_val_p): Likewise.
125 (size_of_die): Likewise.
126 (value_format): Likewise.
127 (output_die): Likewise.
128 (double_int_type_size_in_bits): Rename to offset_int_type_size_in_bits.
129 Use wide-int.
130 (clz_loc_descriptor): Use wide-int interfaces.
131 (mem_loc_descriptor): Likewise. Handle CONST_WIDE_INT.
132 (loc_descriptor): Use wide-int interfaces. Handle CONST_WIDE_INT.
133 (round_up_to_align): Use wide-int interfaces.
134 (field_byte_offset): Likewise.
135 (insert_double): Rename to insert_wide_int. Use wide-int interfaces.
136 (add_const_value_attribute): Handle CONST_WIDE_INT. Update
137 CONST_DOUBLE handling. Use wide-int interfaces.
138 (add_bound_info): Use tree_fits_uhwi_p. Use wide-int interfaces.
139 (gen_enumeration_type_die): Use add_AT_wide.
140 (hash_loc_operands): Add case dw_val_class_wide_int.
141 (compare_loc_operands): Likewise.
142 * dwarf2out.h: Include wide-int.h.
143 (wide_int_ptr): New.
144 (enum dw_val_class): Add dw_val_class_wide_int.
145 (struct dw_val_struct): Add val_wide.
146 * emit-rtl.c (const_wide_int_htab): New.
147 (const_wide_int_htab_hash): New.
148 (const_wide_int_htab_eq): New.
149 (lookup_const_wide_int): New.
150 (const_double_htab_hash): Use wide-int interfaces.
151 (const_double_htab_eq): Likewise.
152 (rtx_to_double_int): Conditionally compile for wide-int.
153 (immed_double_int_const): Rename to immed_wide_int_const and
154 update for wide-int.
155 (immed_double_const): Conditionally compile for wide-int.
156 (init_emit_once): Use wide-int interfaces.
157 * explow.c (plus_constant): Likewise.
158 * expmed.c (mask_rtx): Move further up file. Use wide-int interfaces.
159 (lshift_value): Use wide-int interfaces.
160 (expand_mult): Likewise.
161 (choose_multiplier): Likewise.
162 (expand_smod_pow2): Likewise.
163 (make_tree): Likewise.
164 * expr.c (convert_modes): Consolidate handling of constants.
165 Use wide-int interfaces.
166 (emit_group_load_1): Add note.
167 (store_expr): Update comment.
168 (get_inner_reference): Use wide-int interfaces.
169 (expand_constructor): Update comment.
170 (expand_expr_real_2): Use wide-int interfaces.
171 (expand_expr_real_1): Likewise.
172 (reduce_to_bit_field_precision): Likewise.
173 (const_vector_from_tree): Likewise.
174 * final.c: Include wide-int-print.h.
175 (output_addr_const): Handle CONST_WIDE_INT. Use CONST_DOUBLE_AS_INT_P.
176 * fixed-value.c: Include wide-int.h.
177 (fixed_from_string): Use wide-int interfaces.
178 (fixed_to_decimal): Likewise.
179 (fixed_convert_from_real): Likewise.
180 (real_convert_from_fixed): Likewise.
181 * fold-const.h (mem_ref_offset): Return an offset_int.
182 (div_if_zero_remainder): Remove code parameter.
183 * fold-const.c (div_if_zero_remainder): Remove code parameter.
184 Use wide-int interfaces.
185 (may_negate_without_overflow_p): Use wide-int interfaces.
186 (negate_expr_p): Likewise.
187 (fold_negate_expr): Likewise.
188 (int_const_binop_1): Likewise.
189 (const_binop): Likewise.
190 (fold_convert_const_int_from_int): Likewise.
191 (fold_convert_const_int_from_real): Likewise.
192 (fold_convert_const_int_from_fixed): Likewise.
193 (fold_convert_const_fixed_from_int): Likewise.
194 (all_ones_mask_p): Take an unsigned size. Use wide-int interfaces.
195 (sign_bit_p): Use wide-int interfaces.
196 (make_range_step): Likewise.
197 (build_range_check): Likewise. Pass an integer of the correct type
198 instead of using integer_one_node.
199 (range_predecessor): Pass an integer of the correct type instead
200 of using integer_one_node.
201 (range_successor): Likewise.
202 (merge_ranges): Likewise.
203 (unextend): Use wide-int interfaces.
204 (extract_muldiv_1): Likewise.
205 (fold_div_compare): Likewise.
206 (fold_single_bit_test): Likewise.
207 (fold_sign_changed_comparison): Likewise.
208 (try_move_mult_to_index): Update calls to div_if_zero_remainder.
209 (fold_plusminus_mult_expr): Use wide-int interfaces.
210 (native_encode_int): Likewise.
211 (native_interpret_int): Likewise.
212 (fold_unary_loc): Likewise.
213 (pointer_may_wrap_p): Likewise.
214 (size_low_cst): Likewise.
215 (mask_with_tz): Likewise.
216 (fold_binary_loc): Likewise.
217 (fold_ternary_loc): Likewise.
218 (multiple_of_p): Likewise.
219 (tree_call_nonnegative_warnv_p): Update calls to
220 tree_int_cst_min_precision and real_from_integer.
221 (fold_negate_const): Use wide-int interfaces.
222 (fold_abs_const): Likewise.
223 (fold_relational_const): Use tree_int_cst_lt.
224 (round_up_loc): Use wide-int interfaces.
225 * genemit.c (gen_exp): Add CONST_WIDE_INT case.
226 * gengenrtl.c (excluded_rtx): Add CONST_WIDE_INT case.
227 * gengtype.c: Remove include of double-int.h.
228 (do_typedef): Use wide-int interfaces.
229 (open_base_files): Add wide-int.h.
230 (main): Add offset_int and widest_int typedefs.
231 * gengtype-lex.l: Handle "^".
232 (CXX_KEYWORD): Add "static".
233 * gengtype-parse.c (require3): New.
234 (require_template_declaration): Handle constant template arguments
235 and nested templates.
236 * gengtype-state.c: Don't include "double-int.h".
237 * genpreds.c (write_one_predicate_function): Update comment.
238 (write_tm_constrs_h): Add check for hval and lval use in
239 CONST_WIDE_INT.
240 * genrecog.c (validate_pattern): Add CONST_WIDE_INT case.
241 (add_to_sequence): Likewise.
242 * gensupport.c (struct std_pred_table): Add const_scalar_int_operand
243 and const_double_operand.
244 * gimple.c (preprocess_case_label_vec_for_gimple): Use wide-int
245 interfaces.
246 * gimple-fold.c (get_base_constructor): Likewise.
247 (fold_array_ctor_reference): Likewise.
248 (fold_nonarray_ctor_reference): Likewise.
249 (fold_const_aggregate_ref_1): Likewise.
250 (gimple_val_nonnegative_real_p): Likewise.
251 (gimple_fold_indirect_ref): Likewise.
252 * gimple-pretty-print.c (dump_ssaname_info): Likewise.
253 * gimple-ssa-strength-reduction.c: Include wide-int-print.h.
254 (struct slsr_cand_d): Change index to be widest_int.
255 (struct incr_info_d): Change incr to be widest_int.
256 (alloc_cand_and_find_basis): Use wide-int interfaces.
257 (slsr_process_phi): Likewise.
258 (backtrace_base_for_ref): Likewise. Return a widest_int.
259 (restructure_reference): Take a widest_int instead of a double_int.
260 (slsr_process_ref): Use wide-int interfaces.
261 (create_mul_ssa_cand): Likewise.
262 (create_mul_imm_cand): Likewise.
263 (create_add_ssa_cand): Likewise.
264 (create_add_imm_cand): Take a widest_int instead of a double_int.
265 (slsr_process_add): Use wide-int interfaces.
266 (slsr_process_cast): Likewise.
267 (slsr_process_copy): Likewise.
268 (dump_candidate): Likewise.
269 (dump_incr_vec): Likewise.
270 (replace_ref): Likewise.
271 (cand_increment): Likewise. Return a widest_int.
272 (cand_abs_increment): Likewise.
273 (replace_mult_candidate): Take a widest_int instead of a double_int.
274 (replace_unconditional_candidate): Use wide-int interfaces.
275 (incr_vec_index): Take a widest_int instead of a double_int.
276 (create_add_on_incoming_edge): Likewise.
277 (create_phi_basis): Use wide-int interfaces.
278 (replace_conditional_candidate): Likewise.
279 (record_increment): Take a widest_int instead of a double_int.
280 (record_phi_increments): Use wide-int interfaces.
281 (phi_incr_cost): Take a widest_int instead of a double_int.
282 (lowest_cost_path): Likewise.
283 (total_savings): Likewise.
284 (analyze_increments): Use wide-int interfaces.
285 (ncd_with_phi): Take a widest_int instead of a double_int.
286 (ncd_of_cand_and_phis): Likewise.
287 (nearest_common_dominator_for_cands): Likewise.
288 (insert_initializers): Use wide-int interfaces.
289 (all_phi_incrs_profitable): Likewise.
290 (replace_one_candidate): Likewise.
291 (replace_profitable_candidates): Likewise.
292 * godump.c: Include wide-int-print.h.
293 (go_output_typedef): Use wide-int interfaces.
294 * graphite-clast-to-gimple.c (gmp_cst_to_tree): Likewise.
295 * graphite-sese-to-poly.c (tree_int_to_gmp): Likewise.
296 (build_loop_iteration_domains): Likewise.
297 * hooks.h: Include wide-int.h rather than double-int.h.
298 (hook_bool_dint_dint_uint_bool_true): Delete.
299 (hook_bool_wint_wint_uint_bool_true): Declare.
300 * hooks.c (hook_bool_dint_dint_uint_bool_true): Removed.
301 (hook_bool_wint_wint_uint_bool_true): New.
302 * internal-fn.c (ubsan_expand_si_overflow_addsub_check): Use wide-int
303 interfaces.
304 (ubsan_expand_si_overflow_mul_check): Likewise.
305 * ipa-devirt.c (get_polymorphic_call_info): Likewise.
306 * ipa-prop.c (compute_complex_assign_jump_func): Likewise.
307 (get_ancestor_addr_info): Likewise.
308 (ipa_modify_call_arguments): Likewise.
309 * loop-doloop.c (doloop_modify): Likewise.
310 (doloop_optimize): Likewise.
311 * loop-iv.c (iv_number_of_iterations): Likewise.
312 * loop-unroll.c (decide_unroll_constant_iterations): Likewise.
313 (unroll_loop_constant_iterations): Likewise.
314 (decide_unroll_runtime_iterations): Likewise.
315 (unroll_loop_runtime_iterations): Likewise.
316 (decide_peel_simple): Likewise.
317 (decide_unroll_stupid): Likewise.
318 * lto-streamer-in.c (streamer_read_wi): Add.
319 (input_cfg): Use wide-int interfaces.
320 (lto_input_tree_1): Likewise.
321 * lto-streamer-out.c (streamer_write_wi): Add.
322 (hash_tree): Use wide-int interfaces.
323 (output_cfg): Likewise.
324 * Makefile.in (OBJS): Add wide-int.o and wide-int-print.o.
325 (GTFILES): Add wide-int.h and signop.h.
326 (TAGS): Look for .cc files too.
327 * omp-low.c (scan_omp_1_op): Use wide-int interfaces.
328 * optabs.c (expand_subword_shift): Likewise.
329 (expand_doubleword_shift): Likewise.
330 (expand_absneg_bit): Likewise.
331 (expand_copysign_absneg): Likewise.
332 (expand_copysign_bit): Likewise.
333 * postreload.c (reload_cse_simplify_set): Likewise.
334 * predict.c (predict_iv_comparison): Likewise.
335 * pretty-print.h: Include wide-int-print.h.
336 (pp_wide_int) New.
337 * print-rtl.c (print_rtx): Add CONST_WIDE_INT case.
338 * print-tree.c: Include wide-int-print.h.
339 (print_node_brief): Use wide-int interfaces.
340 (print_node): Likewise.
341 * read-rtl.c (validate_const_wide_int): New.
342 (read_rtx_code): Add CONST_WIDE_INT case.
343 * real.c: Include wide-int.h.
344 (real_to_integer2): Delete.
345 (real_to_integer): New function, returning a wide_int.
346 (real_from_integer): Take a wide_int rather than two HOST_WIDE_INTs.
347 (ten_to_ptwo): Update call to real_from_integer.
348 (real_digit): Likewise.
349 * real.h: Include signop.h, wide-int.h and insn-modes.h.
350 (real_to_integer2, REAL_VALUE_FROM_INT, REAL_VALUE_FROM_UNSIGNED_INT)
351 (REAL_VALUE_TO_INT): Delete.
352 (real_to_integer): Declare a wide-int form.
353 (real_from_integer): Take a wide_int rather than two HOST_WIDE_INTs.
354 * recog.c (const_int_operand): Improve comment.
355 (const_scalar_int_operand): New.
356 (const_double_operand): Add a separate definition for CONST_WIDE_INT.
357 * rtlanal.c (commutative_operand_precedence): Handle CONST_WIDE_INT.
358 (split_double): Likewise.
359 * rtl.c (DEF_RTL_EXPR): Handle CONST_WIDE_INT.
360 (rtx_size): Likewise.
361 (rtx_alloc_stat_v): New.
362 (rtx_alloc_stat): Now calls rtx_alloc_stat_v.
363 (cwi_output_hex): New.
364 (iterative_hash_rtx): Handle CONST_WIDE_INT.
365 (cwi_check_failed_bounds): New.
366 * rtl.def (CONST_WIDE_INT): New.
367 * rtl.h: Include <utility> and wide-int.h.
368 (struct hwivec_def): New.
369 (CWI_GET_NUM_ELEM): New.
370 (CWI_PUT_NUM_ELEM): New.
371 (struct rtx_def): Add num_elem and hwiv.
372 (CASE_CONST_SCALAR_INT): Modify for TARGET_SUPPORTS_WIDE_INT.
373 (CASE_CONST_UNIQUE): Likewise.
374 (CASE_CONST_ANY): Likewise.
375 (CONST_SCALAR_INT_P): Likewise.
376 (CONST_WIDE_INT_P): New.
377 (CWI_ELT): New.
378 (HWIVEC_CHECK): New.
379 (cwi_check_failed_bounds): New.
380 (CWI_ELT): New.
381 (HWIVEC_CHECK): New.
382 (CONST_WIDE_INT_VEC) New.
383 (CONST_WIDE_INT_NUNITS) New.
384 (CONST_WIDE_INT_ELT) New.
385 (rtx_mode_t): New type.
386 (wi::int_traits <rtx_mode_t>): New.
387 (wi::shwi): New.
388 (wi::min_value): New.
389 (wi::max_value): New.
390 (rtx_alloc_v) New.
391 (const_wide_int_alloc): New.
392 (immed_wide_int_const): New.
393 * sched-vis.c (print_value): Handle CONST_WIDE_INT.
394 * sel-sched-ir.c (lhs_and_rhs_separable_p): Update comment.
395 * signop.h: New file.
396 * simplify-rtx.c (mode_signbit_p): Handle CONST_WIDE_INT.
397 (simplify_const_unary_operation): Use wide-int interfaces.
398 (simplify_binary_operation_1): Likewise.
399 (simplify_const_binary_operation): Likewise.
400 (simplify_const_relational_operation): Likewise.
401 (simplify_immed_subreg): Likewise.
402 * stmt.c (expand_case): Likewise.
403 * stor-layout.h (set_min_and_max_values_for_integral_type): Take a
404 signop rather than a bool.
405 * stor-layout.c (layout_type): Use wide-int interfaces.
406 (initialize_sizetypes): Update calls to
407 set_min_and_max_values_for_integral_type.
408 (set_min_and_max_values_for_integral_type): Take a signop rather
409 than a bool. Use wide-int interfaces.
410 (fixup_signed_type): Update accordingly. Remove
411 HOST_BITS_PER_DOUBLE_INT limit.
412 (fixup_unsigned_type): Likewise.
413 * system.h (STATIC_CONSTANT_P): New.
414 (STATIC_ASSERT): New.
415 * target.def (can_use_doloop_p): Take widest_ints rather than
416 double_ints.
417 * target.h: Include wide-int.h rather than double-int.h.
418 * targhooks.h (can_use_doloop_if_innermost): Take widest_ints rather
419 than double_ints.
420 * targhooks.c (default_cxx_get_cookie_size): Use tree_int_cst_lt
421 rather than INT_CST_LT_UNSIGNED.
422 (can_use_doloop_if_innermost): Take widest_ints rather than
423 double_ints.
424 * tree-affine.c: Include wide-int-print.h.
425 (double_int_ext_for_comb): Delete.
426 (wide_int_ext_for_comb): New.
427 (aff_combination_zero): Use wide-int interfaces.
428 (aff_combination_const): Take a widest_int instead of a double_int.
429 (aff_combination_elt): Use wide-int interfaces.
430 (aff_combination_scale): Take a widest_int instead of a double_int.
431 (aff_combination_add_elt): Likewise.
432 (aff_combination_add_cst): Likewise.
433 (aff_combination_add): Use wide-int interfaces.
434 (aff_combination_convert): Likewise.
435 (tree_to_aff_combination): Likewise.
436 (add_elt_to_tree): Take a widest_int instead of a double_int.
437 (aff_combination_to_tree): Use wide-int interfaces.
438 (aff_combination_remove_elt): Likewise.
439 (aff_combination_add_product): Take a widest_int instead of
440 a double_int.
441 (aff_combination_mult): Use wide-int interfaces.
442 (aff_combination_expand): Likewise.
443 (double_int_constant_multiple_p): Delete.
444 (wide_int_constant_multiple_p): New.
445 (aff_combination_constant_multiple_p): Take a widest_int pointer
446 instead of a double_int pointer.
447 (print_aff): Use wide-int interfaces.
448 (get_inner_reference_aff): Take a widest_int pointer
449 instead of a double_int pointer.
450 (aff_comb_cannot_overlap_p): Take widest_ints instead of double_ints.
451 * tree-affine.h: Include wide-int.h.
452 (struct aff_comb_elt): Change type of coef to widest_int.
453 (struct affine_tree_combination): Change type of offset to widest_int.
454 (double_int_ext_for_comb): Delete.
455 (wide_int_ext_for_comb): New.
456 (aff_combination_const): Use widest_int instead of double_int.
457 (aff_combination_scale): Likewise.
458 (aff_combination_add_elt): Likewise.
459 (aff_combination_constant_multiple_p): Likewise.
460 (get_inner_reference_aff): Likewise.
461 (aff_comb_cannot_overlap_p): Likewise.
462 (aff_combination_zero_p): Use wide-int interfaces.
463 * tree.c: Include tree.h.
464 (init_ttree): Use make_int_cst.
465 (tree_code_size): Removed code for INTEGER_CST case.
466 (tree_size): Add INTEGER_CST case.
467 (make_node_stat): Update comment.
468 (get_int_cst_ext_nunits, build_new_int_cst, build_int_cstu): New.
469 (build_int_cst_type): Use wide-int interfaces.
470 (double_int_to_tree): Likewise.
471 (double_int_fits_to_tree_p): Delete.
472 (force_fit_type_double): Delete.
473 (force_fit_type): New.
474 (int_cst_hash_hash): Use wide-int interfaces.
475 (int_cst_hash_eq): Likewise.
476 (build_int_cst_wide): Delete.
477 (wide_int_to_tree): New.
478 (cache_integer_cst): Use wide-int interfaces.
479 (build_low_bits_mask): Likewise.
480 (cst_and_fits_in_hwi): Likewise.
481 (real_value_from_int_cst): Likewise.
482 (make_int_cst_stat): New.
483 (integer_zerop): Use wide_int interfaces.
484 (integer_onep): Likewise.
485 (integer_all_onesp): Likewise.
486 (integer_pow2p): Likewise.
487 (integer_nonzerop): Likewise.
488 (tree_log2): Likewise.
489 (tree_floor_log2): Likewise.
490 (tree_ctz): Likewise.
491 (int_size_in_bytes): Likewise.
492 (mem_ref_offset): Return an offset_int rather than a double_int.
493 (build_type_attribute_qual_variant): Use wide_int interfaces.
494 (type_hash_eq): Likewise
495 (tree_int_cst_equal): Likewise.
496 (tree_int_cst_lt): Delete.
497 (tree_int_cst_compare): Likewise.
498 (tree_fits_shwi_p): Use wide_int interfaces.
499 (tree_fits_uhwi_p): Likewise.
500 (tree_int_cst_sign_bit): Likewise.
501 (tree_int_cst_sgn): Likewise.
502 (tree_int_cst_min_precision): Take a signop rather than a bool.
503 (simple_cst_equal): Use wide_int interfaces.
504 (compare_tree_int): Likewise.
505 (iterative_hash_expr): Likewise.
506 (int_fits_type_p): Likewise. Use tree_int_cst_lt rather than
507 INT_CST_LT.
508 (get_type_static_bounds): Use wide_int interfaces.
509 (tree_int_cst_elt_check_failed): New.
510 (build_common_tree_nodes): Reordered to set prec before filling in
511 value.
512 (int_cst_value): Check cst_and_fits_in_hwi.
513 (widest_int_cst_value): Use wide_int interfaces.
514 (upper_bound_in_type): Likewise.
515 (lower_bound_in_type): Likewise.
516 (num_ending_zeros): Likewise.
517 (drop_tree_overflow): Likewise.
518 * tree-call-cdce.c (check_pow): Update call to real_from_integer.
519 (gen_conditions_for_pow_cst_base): Likewise.
520 * tree-cfg.c: Include wide-int.h and wide-int-print.h.
521 (group_case_labels_stmt): Use wide-int interfaces.
522 (verify_gimple_assign_binary): Likewise.
523 (print_loop): Likewise.
524 * tree-chrec.c (tree_fold_binomial): Likewise.
525 * tree-core.h (struct tree_base): Add int_length.
526 (struct tree_int_cst): Change rep of value.
527 * tree-data-ref.c (dr_analyze_innermost): Use wide-int interfaces.
528 (dr_may_alias_p): Likewise.
529 (max_stmt_executions_tree): Likewise.
530 * tree.def (INTEGER_CST): Update comment.
531 * tree-dfa.c (get_ref_base_and_extent): Use wide-int interfaces.
532 * tree-dfa.h (get_addr_base_and_unit_offset_1): Likewise.
533 * tree-dump.c: Include wide-int.h and wide-int-print.h.
534 (dequeue_and_dump): Use wide-int interfaces.
535 * tree.h: Include wide-int.h.
536 (NULL_TREE): Moved to earlier loc in file.
537 (TREE_INT_CST_ELT_CHECK): New.
538 (tree_int_cst_elt_check_failed): New.
539 (TYPE_SIGN): New.
540 (TREE_INT_CST): Delete.
541 (TREE_INT_CST_LOW): Use wide-int interfaces.
542 (TREE_INT_CST_HIGH): Delete.
543 (TREE_INT_CST_NUNITS): New.
544 (TREE_INT_CST_EXT_NUNITS): Likewise.
545 (TREE_INT_CST_OFFSET_NUNITS): Likewise.
546 (TREE_INT_CST_ELT): Likewise.
547 (INT_CST_LT): Delete.
548 (tree_int_cst_elt_check): New (two forms).
549 (type_code_size): Update comment.
550 (make_int_cst_stat, make_int_cst): New.
551 (tree_to_double_int): Delete.
552 (double_int_fits_to_tree_p): Delete.
553 (force_fit_type_double): Delete.
554 (build_int_cstu): Replace with out-of-line function.
555 (build_int_cst_wide): Delete.
556 (tree_int_cst_lt): Define inline.
557 (tree_int_cst_le): New.
558 (tree_int_cst_compare): Define inline.
559 (tree_int_cst_min_precision): Take a signop rather than a bool.
560 (wi::int_traits <const_tree>): New.
561 (wi::int_traits <tree>): New.
562 (wi::extended_tree): New.
563 (wi::int_traits <wi::extended_tree>): New.
564 (wi::to_widest): New.
565 (wi::to_offset): New.
566 (wi::fits_to_tree_p): New.
567 (wi::min_value): New.
568 (wi::max_value): New.
569 * tree-inline.c (remap_gimple_op_r): Use wide-int interfaces.
570 (copy_tree_body_r): Likewise.
571 * tree-object-size.c (compute_object_offset): Likewise.
572 (addr_object_size): Likewise.
573 * tree-predcom.c: Include wide-int-print.h.
574 (struct dref_d): Change type of offset to widest_int.
575 (dump_dref): Call wide-int printer.
576 (aff_combination_dr_offset): Use wide-int interfaces.
577 (determine_offset): Take a widest_int pointer rather than a
578 double_int pointer.
579 (split_data_refs_to_components): Use wide-int interfaces.
580 (suitable_component_p): Likewise.
581 (order_drefs): Likewise.
582 (add_ref_to_chain): Likewise.
583 (valid_initializer_p): Likewise.
584 (determine_roots_comp): Likewise.
585 * tree-pretty-print.c: Include wide-int-print.h.
586 (dump_generic_node): Use wide-int interfaces.
587 * tree-sra.c (sra_ipa_modify_expr): Likewise.
588 * tree-ssa-address.c (addr_for_mem_ref): Likewise.
589 (move_fixed_address_to_symbol): Likewise.
590 (move_hint_to_base): Likewise.
591 (move_pointer_to_base): Likewise.
592 (move_variant_to_index): Likewise.
593 (most_expensive_mult_to_index): Likewise.
594 (addr_to_parts): Likewise.
595 (copy_ref_info): Likewise.
596 * tree-ssa-alias.c (indirect_ref_may_alias_decl_p): Likewise.
597 (indirect_refs_may_alias_p): Likewise.
598 (stmt_kills_ref_p_1): Likewise.
599 * tree-ssa.c (non_rewritable_mem_ref_base): Likewise.
600 * tree-ssa-ccp.c: Update comment at top of file. Include
601 wide-int-print.h.
602 (struct prop_value_d): Change type of mask to widest_int.
603 (extend_mask): New function.
604 (dump_lattice_value): Use wide-int interfaces.
605 (get_default_value): Likewise.
606 (set_constant_value): Likewise.
607 (set_value_varying): Likewise.
608 (valid_lattice_transition): Likewise.
609 (set_lattice_value): Likewise.
610 (value_to_double_int): Delete.
611 (value_to_wide_int): New.
612 (get_value_from_alignment): Use wide-int interfaces.
613 (get_value_for_expr): Likewise.
614 (do_dbg_cnt): Likewise.
615 (ccp_finalize): Likewise.
616 (ccp_lattice_meet): Likewise.
617 (bit_value_unop_1): Use widest_ints rather than double_ints.
618 (bit_value_binop_1): Likewise.
619 (bit_value_unop): Use wide-int interfaces.
620 (bit_value_binop): Likewise.
621 (bit_value_assume_aligned): Likewise.
622 (evaluate_stmt): Likewise.
623 (ccp_fold_stmt): Likewise.
624 (visit_cond_stmt): Likewise.
625 (ccp_visit_stmt): Likewise.
626 * tree-ssa-forwprop.c (forward_propagate_addr_expr_1): Likewise.
627 (constant_pointer_difference): Likewise.
628 (associate_pointerplus): Likewise.
629 (combine_conversions): Likewise.
630 * tree-ssa-loop.h: Include wide-int.h.
631 (struct tree_niter_desc): Change type of max to widest_int.
632 * tree-ssa-loop-im.c (mem_refs_may_alias_p): Use wide-int interfaces.
633 * tree-ssa-loop-ivcanon.c (remove_exits_and_undefined_stmts): Likewise.
634 (remove_redundant_iv_tests): Likewise.
635 (canonicalize_loop_induction_variables): Likewise.
636 * tree-ssa-loop-ivopts.c (alloc_iv): Likewise.
637 (constant_multiple_of): Take a widest_int pointer instead of
638 a double_int pointer.
639 (get_computation_aff): Use wide-int interfaces.
640 (ptr_difference_cost): Likewise.
641 (difference_cost): Likewise.
642 (get_loop_invariant_expr_id): Likewise.
643 (get_computation_cost_at): Likewise.
644 (iv_elimination_compare_lt): Likewise.
645 (may_eliminate_iv): Likewise.
646 * tree-ssa-loop-niter.h (estimated_loop_iterations): Use widest_int
647 instead of double_int.
648 (max_loop_iterations): Likewise.
649 (max_stmt_executions): Likewise.
650 (estimated_stmt_executions): Likewise.
651 * tree-ssa-loop-niter.c: Include wide-int-print.h.
652 (split_to_var_and_offset): Use wide-int interfaces.
653 (determine_value_range): Likewise.
654 (bound_difference_of_offsetted_base): Likewise.
655 (bounds_add): Take a widest_int instead of a double_int.
656 (number_of_iterations_ne_max): Use wide-int interfaces.
657 (number_of_iterations_ne): Likewise.
658 (number_of_iterations_lt_to_ne): Likewise.
659 (assert_loop_rolls_lt): Likewise.
660 (number_of_iterations_lt): Likewise.
661 (number_of_iterations_le): Likewise.
662 (number_of_iterations_cond): Likewise.
663 (number_of_iterations_exit): Likewise.
664 (finite_loop_p): Likewise.
665 (derive_constant_upper_bound_assign): Likewise.
666 (derive_constant_upper_bound): Return a widest_int.
667 (derive_constant_upper_bound_ops): Likewise.
668 (do_warn_aggressive_loop_optimizations): Use wide-int interfaces.
669 (record_estimate): Take a widest_int rather than a double_int.
670 (record_nonwrapping_iv): Use wide-int interfaces.
671 (double_int_cmp): Delete.
672 (wide_int_cmp): New.
673 (bound_index): Take a widest_int rather than a double_int.
674 (discover_iteration_bound_by_body_walk): Use wide-int interfaces.
675 (maybe_lower_iteration_bound): Likewise.
676 (estimate_numbers_of_iterations_loop): Likewise.
677 (estimated_loop_iterations): Take a widest_int pointer than than
678 a double_int pointer.
679 (estimated_loop_iterations_int): Use wide-int interfaces.
680 (max_loop_iterations): Take a widest_int pointer than than
681 a double_int pointer.
682 (max_loop_iterations_int): Use wide-int interfaces.
683 (max_stmt_executions): Take a widest_int pointer than than
684 a double_int pointer.
685 (estimated_stmt_executions): Likewise.
686 (n_of_executions_at_most): Use wide-int interfaces.
687 (scev_probably_wraps_p): Likewise.
688 * tree-ssa-math-opts.c (gimple_expand_builtin_pow): Update calls
689 to real_to_integer.
690 * tree-scalar-evolution.c (simplify_peeled_chrec): Use wide-int
691 interfaces.
692 * tree-ssanames.c (set_range_info): Use wide_int_refs rather than
693 double_ints. Adjust for trailing_wide_ints <3> representation.
694 (set_nonzero_bits): Likewise.
695 (get_range_info): Return wide_ints rather than double_ints.
696 Adjust for trailing_wide_ints <3> representation.
697 (get_nonzero_bits): Likewise.
698 (duplicate_ssa_name_range_info): Adjust for trailing_wide_ints <3>
699 representation.
700 * tree-ssanames.h (struct range_info_def): Replace min, max and
701 nonzero_bits with a trailing_wide_ints <3>.
702 (set_range_info): Use wide_int_refs rather than double_ints.
703 (set_nonzero_bits): Likewise.
704 (get_range_info): Return wide_ints rather than double_ints.
705 (get_nonzero_bits): Likewise.
706 * tree-ssa-phiopt.c (jump_function_from_stmt): Use wide-int interfaces.
707 * tree-ssa-pre.c (phi_translate_1): Likewise.
708 * tree-ssa-reassoc.c (decrement_power): Use calls to real_from_integer.
709 (acceptable_pow_call): Likewise.
710 * tree-ssa-sccvn.c (copy_reference_ops_from_ref): Use wide-int
711 interfaces.
712 (vn_reference_fold_indirect): Likewise.
713 (vn_reference_maybe_forwprop_address): Likewise.
714 (valueize_refs_1): Likewise.
715 * tree-ssa-structalias.c (get_constraint_for_ptr_offset): Likewise.
716 * tree-ssa-uninit.c (is_value_included_in): Use wide-int interfaces,
717 tree_int_cst_lt and tree_int_cst_le.
718 * tree-streamer-in.c (unpack_ts_base_value_fields): Use wide-int
719 interfaces.
720 (streamer_alloc_tree): Likewise.
721 * tree-streamer-out.c (pack_ts_int_cst_value_fields): Likewise.
722 (streamer_write_tree_header): Likewise.
723 (streamer_write_integer_cst): Likewise.
724 * tree-switch-conversion.c (emit_case_bit_tests): Likewise.
725 (build_constructors): Likewise.
726 (array_value_type): Likewise.
727 * tree-vect-data-refs.c (vect_prune_runtime_alias_test_list): Likewise.
728 (vect_check_gather): Likewise.
729 * tree-vect-generic.c (build_replicated_const): Likewise.
730 (expand_vector_divmod): Likewise.
731 * tree-vect-loop.c (vect_transform_loop): Likewise.
732 * tree-vect-loop-manip.c (vect_do_peeling_for_loop_bound): Likewise.
733 (vect_do_peeling_for_alignment): Likewise.
734 * tree-vect-patterns.c (vect_recog_divmod_pattern): Likewise.
735 * tree-vrp.c: Include wide-int.h.
736 (operand_less_p): Use wide-int interfaces and tree_int_cst_lt.
737 (extract_range_from_assert): Use wide-int interfaces.
738 (vrp_int_const_binop): Likewise.
739 (zero_nonzero_bits_from_vr): Take wide_int pointers rather than
740 double_int pointers.
741 (ranges_from_anti_range): Use wide-int interfaces.
742 (quad_int_cmp): Delete.
743 (quad_int_pair_sort): Likewise.
744 (extract_range_from_binary_expr_1): Use wide-int interfaces.
745 (extract_range_from_unary_expr_1): Likewise.
746 (adjust_range_with_scev): Likewise.
747 (masked_increment): Take and return wide_ints rather than double_ints.
748 (register_edge_assert_for_2): Use wide-int interfaces.
749 (check_array_ref): Likewise.
750 (search_for_addr_array): Likewise.
751 (maybe_set_nonzero_bits): Likewise.
752 (union_ranges): Pass an integer of the correct type instead of
753 using integer_one_node.
754 (intersect_ranges): Likewise.
755 (simplify_truth_ops_using_ranges): Likewise.
756 (simplify_bit_ops_using_ranges): Use wide-int interfaces.
757 (range_fits_type_p): Likewise.
758 (simplify_cond_using_ranges): Likewise. Take a signop rather than
759 a bool.
760 (simplify_conversion_using_ranges): Use wide-int interfaces.
761 (simplify_float_conversion_using_ranges): Likewise.
762 (vrp_finalize): Likewise.
763 * value-prof.c (gimple_divmod_fixed_value_transform): Likewise.
764 (gimple_stringops_transform): Likewise.
765 * varasm.c (decode_addr_const): Likewise.
766 (const_hash_1): Likewise.
767 (const_rtx_hash_1): Likewise
768 (output_constant): Likewise.
769 (array_size_for_constructor): Likewise.
770 (output_constructor_regular_field): Likewise.
771 (output_constructor_bitfield): Likewise.
772 * var-tracking.c (loc_cmp): Handle CONST_WIDE_INT.
773 * mkconfig.sh: Include machmode.h to pick up BITS_PER_UNIT for
774 GENERATOR_FILEs.
775 * gencheck.c: Define BITS_PER_UNIT.
776 * wide-int.cc: New.
777 * wide-int.h: New.
778 * wide-int-print.cc: New.
779 * wide-int-print.h: New.
780
781
782 ada:
783 * gcc-interface/cuintp.c (UI_From_gnu): Use wide-int interfaces.
784 * gcc-interface/decl.c (gnat_to_gnu_entity): Use TYPE_SIGN.
785 (annotate_value): Use wide-int interfaces.
786 * gcc-interface/utils.c (get_nonnull_operand): Use tree_fits_uhwi_p.
787
788
789 c:
790 * c-decl.c (check_bitfield_type_and_width): Use TYPE_SIGN.
791 (finish_enum): Use wide-int interfaces.
792 * c-parser.c (c_parser_cilk_clause_vectorlength): Likewise.
793 * c-typeck.c (build_c_cast): Likewise.
794 (set_nonincremental_init_from_string): Likewise.
795 (c_tree_equal): Likewise.
796
797
798 c-family:
799 * c-ada-spec.c: Include wide-int.h.
800 (ADA_HOST_WIDE_INT_PRINT_DOUBLE_HEX): Remove.
801 (dump_generic_ada_node): Use wide-int interfaces.
802 * c-common.c: Include wide-int-print.h.
803 (shorten_compare): Use wide-int interfaces and tree_int_cst_lt.
804 (pointer_int_sum): Use wide-int interfaces.
805 (c_common_nodes_and_builtins): Use make_int_cst.
806 (match_case_to_enum_1): Use tree_fits_uhwi_p and tree_fits_shwi_p.
807 (handle_alloc_size_attribute): Use wide-int interfaces.
808 (get_nonnull_operand): Likewise.
809 * c-format.c (get_constant): Use tree_fits_uhwi_p.
810 * c-lex.c: Include wide-int.h.
811 (narrowest_unsigned_type): Take a widest_int rather than two
812 HOST_WIDE_INTs.
813 (narrowest_signed_type): Likewise.
814 (interpret_integer): Update accordingly. Use wide-int interfaces.
815 (lex_charconst): Use wide-int interfaces.
816 * c-pretty-print.c: Include wide-int.h.
817 (pp_c_integer_constant): Use wide-int interfaces.
818 * cilk.c (declare_one_free_variable): Use tree_int_cst_lt instead of
819 INT_CST_LT_UNSIGNED.
820
821
822 cp:
823 * call.c: Include wide-int.h.
824 (type_passed_as): Use tree_int_cst_lt instead of INT_CST_LT_UNSIGNED.
825 (convert_for_arg_passing): Likewise.
826 * class.c: Include wide-int.h.
827 (walk_subobject_offsets): Use tree_int_cst_lt instead of INT_CST_LT.
828 (end_of_class): Use tree_int_cst_lt instead of INT_CST_LT_UNSIGNED.
829 (include_empty_classes): Likewise
830 (layout_class_type): Use tree_int_cst_lt instead of INT_CST_LT.
831 * cvt.c: Include wide-int.h.
832 (ignore_overflows): Use wide_int_to_tree.
833 * decl.c: Include wide-int.h.
834 (check_array_designated_initializer): Use wide-int interfaces.
835 (compute_array_index_type): Use tree_int_cst_lt instead of INT_CST_LT.
836 (finish_enum_value_list): Use signop.
837 (build_enumerator): Use wide-int interfaces.
838 * init.c: Include wide-int.h.
839 (build_new_1): Use wide-int interfaces.
840 * mangle.c: Include wide-int.h.
841 (write_integer_cst): Use wide-int interfaces.
842 (write_array_type): Likewise.
843 * tree.c: Include wide-int.h.
844 (cp_tree_equal): Use tree_int_cst_equal.
845 * typeck2.c: Include wide-int.h.
846 (process_init_constructor_array): Use wide-int interfaces.
847
848
849 fortran:
850 * target-memory.c: Include wide-int.h.
851 (gfc_interpret_logical): Use wide-int interfaces.
852 * trans-array.c: Include wide-int.h.
853 (gfc_conv_array_initializer): Use wide-int interfaces.
854 * trans-const.c: Include wide-int.h.
855 (gfc_conv_string_init): Use wide-int interfaces.
856 (gfc_conv_mpz_to_tree): Likewise.
857 (gfc_conv_tree_to_mpz): Likewise.
858 * trans-decl.c (gfc_can_put_var_on_stack): Use tree_fits_uhwi_p.
859 * trans-expr.c: Include wide-int.h.
860 (gfc_conv_cst_int_power): Use wide-int interfaces.
861 (gfc_string_to_single_character): Likewise.
862 (gfc_optimize_len_trim): Likewise.
863 * trans-intrinsic.c: Include wide-int.h.
864 (trans_this_image): Use wide-int interfaces.
865 (gfc_conv_intrinsic_bound): Likewise.
866 (conv_intrinsic_cobound): Likewise.
867 * trans-types.c (gfc_init_types): Likewise.
868 (gfc_get_array_type_bounds): Pass an integer of the correct type
869 instead of using integer_one_node.
870
871
872 go:
873 * go-gcc.cc (Gcc_backend::type_size): Use tree_fits_uhwi_p.
874
875
876 java:
877 * boehm.c: Include wide-int.h.
878 (mark_reference_fields): Use a wide_int mask.
879 (get_boehm_type_descriptor): Use wide-int interfaces.
880 * expr.c: Include wide-int.h.
881 (build_newarray): Remove bogus "== INTEGER_CST".
882 (expand_java_pushc): Use real_from_integer.
883 (build_field_ref): Use tree_int_cst_lt instead of INT_CST_LT_UNSIGNED.
884 * jcf-parse.c: Include wide-int.h.
885 (get_constant): Use wide-int interfaces.
886
887
888 lto:
889 * lto.c (compare_tree_sccs_1): Use wide-int interfaces.
890 * lto-lang.c (get_nonnull_operand): Likewise.
891
892
893 objc:
894 * objc-act.c: Include wide-int.h.
895 (objc_decl_method_attributes): Use wide-int interfaces.
896
897
898 testsuite:
899 * gcc.dg/tree-ssa/pr45427.c: Update to look for 0x0 instead of 0.