diff options
author | Richard Biener <rguenther@suse.de> | 2014-05-26 10:42:43 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2014-05-26 10:42:43 +0000 |
commit | a9243bfced3137c8fc9830b7c43c4cdabc313cc6 (patch) | |
tree | fde582b2dcf87e56b9531e02e1574d3f2588c798 /gcc/config | |
parent | 97563bc895f753bab46f97c1843167faae1a6c06 (diff) | |
download | gcc-a9243bfced3137c8fc9830b7c43c4cdabc313cc6.zip gcc-a9243bfced3137c8fc9830b7c43c4cdabc313cc6.tar.gz gcc-a9243bfced3137c8fc9830b7c43c4cdabc313cc6.tar.bz2 |
system.h: Define __STDC_FORMAT_MACROS before including inttypes.h.
2014-05-23 Richard Biener <rguenther@suse.de>
* system.h: Define __STDC_FORMAT_MACROS before
including inttypes.h.
* hwint.h (HOST_WIDEST_INT, HOST_BITS_PER_WIDEST_INT,
HOST_WIDEST_INT_PRINT, HOST_WIDEST_INT_PRINT_DEC,
HOST_WIDEST_INT_PRINT_DEC_C, HOST_WIDEST_INT_PRINT_UNSIGNED,
HOST_WIDEST_INT_PRINT_HEX, HOST_WIDEST_INT_PRINT_DOUBLE_HEX,
HOST_WIDEST_INT_C): Remove.
(PRId64, PRIi64, PRIo64, PRIu64, PRIx64, PRIX64): Define
if C99 inttypes.h is not available.
* coretypes.h (gcov_type, gcov_type_unsigned): Use [u]int64_t.
* gcov-io.h (gcov_type, gcov_type_unsigned): Likewise.
* gcov-io.c (gcov_histo_index): Drop non-64bit hwi case.
* cfgloop.h (struct niter_desc): Use uint64_t for niter field.
* bitmap.c (struct bitmap_descriptor_d): Use uint64_t for counters.
(struct output_info): Likewise.
(print_statistics): Adjust.
(dump_bitmap_statistics): Likewise.
* bt-load.c (migrate_btr_defs): Print with PRId64.
* cfg.c (dump_edge_info, dump_bb_info): Likewise.
(MAX_SAFE_MULTIPLIER): Adjust.
* cfghooks.c (dump_bb_for_graph): Print with PRId64.
* cgraph.c (cgraph_redirect_edge_call_stmt_to_callee,
dump_cgraph_node): Likewise.
* final.c (dump_basic_block_info): Likewise.
* gcov-dump.c (tag_counters, tag_summary, dump_working_sets): Likewise.
* gcov.c (format_gcov): Likewise.
* ipa-cp.c (good_cloning_opportunity_p): Likewise. Use int64_t
for calculation.
(get_clone_agg_value): Use HOST_WIDE_INT for offset.
* ipa-inline.c (compute_max_insns): Use int64_t for calcuation.
(inline_small_functions, dump_overall_stats, dump_inline_stats):
Use PRId64 for dumping.
* ipa-profile.c (dump_histogram, ipa_profile): Likewise.
* ira-color.c (struct allocno_hard_regs): Use int64_t for cost.
(add_allocno_hard_regs): Adjust.
* loop-doloop.c (doloop_modify): Print using PRId64.
* loop-iv.c (inverse): Compute in uint64_t.
(determine_max_iter, iv_number_of_iterations): Likewise.
* loop-unroll.c (decide_peel_completely, decide_peel_simple):
Print using PRId64.
* lto-streamer-out.c (write_symbol): Use uint64_t.
* mcf.c (CAP_INFINITY): Use int64_t maximum.
(dump_fixup_edge, create_fixup_graph, cancel_negative_cycle,
find_max_flow, adjust_cfg_counts): Use int64_t and dump with PRId64.
* modulo-sched.c (const_iteration_count): Use int64_t.
(sms_schedule): Dump using PRId64.
* predict.c (dump_prediction): Likewise.
* pretty-print.h (pp_widest_integer): Remove.
* profile.c (get_working_sets, is_edge_inconsistent,
is_inconsistent, read_profile_edge_counts): Dump using PRId64.
* tree-pretty-print.c (pp_double_int): Remove case handling
HOST_BITS_PER_DOUBLE_INT == HOST_BITS_PER_WIDEST_INT.
* tree-ssa-math-opts.c (struct symbolic_number): Use uint64_t
and adjust users.
(pass_optimize_bswap::execute): Remove restriction on hosts.
* tree-streamer-in.c (streamer_alloc_tree): Use HOST_WIDE_INT.
* tree-streamer-out.c (streamer_write_tree_header): Likewise.
* tree.c (widest_int_cst_value): Remove.
* tree.h (widest_int_cst_value): Likewise.
* value-prof.c (dump_histogram_value): Print using PRId64.
* gengtype.c (main): Also inject int64_t.
* ggc-page.c (struct max_alignment): Use int64_t.
* alloc-pool.c (struct allocation_object_def): Likewise.
* ira-conflicts.c (build_conflict_bit_table): Use uint64_t
for computation.
* doc/tm.texi.in: Remove reference to HOST_WIDEST_INT.
* doc/tm.texi: Regenerated.
* gengtype-lex.l (IWORD): Handle [u]int64_t.
* config/sh/sh.c (expand_cbranchdi4): Use gcov_type.
* config/mmix/mmix-protos.h (mmix_intval, mmix_shiftable_wyde_value,
mmix_output_register_setting): Use [u]int64_t in prototypes.
* config/mmix/mmix.c (mmix_print_operand, mmix_output_register_setting,
mmix_shiftable_wyde_value, mmix_output_shiftvalue_op_from_str,
mmix_output_octa, mmix_output_shifted_value): Adjust.
(mmix_intval): Adjust. Remove unreachable case.
* config/mmix/mmix.md (*nonlocal_goto_receiver_expanded): Use
int64_t.
lto/
* lto.c (lto_parse_hex): Use int64_t.
(lto_resolution_read): Likewise.
From-SVN: r210931
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/mmix/mmix-protos.h | 6 | ||||
-rw-r--r-- | gcc/config/mmix/mmix.c | 97 | ||||
-rw-r--r-- | gcc/config/mmix/mmix.md | 2 | ||||
-rw-r--r-- | gcc/config/sh/sh.c | 5 |
4 files changed, 47 insertions, 63 deletions
diff --git a/gcc/config/mmix/mmix-protos.h b/gcc/config/mmix/mmix-protos.h index d738a1a..32d53f5 100644 --- a/gcc/config/mmix/mmix-protos.h +++ b/gcc/config/mmix/mmix-protos.h @@ -39,9 +39,9 @@ extern void mmix_asm_output_reg_push (FILE *, int); extern void mmix_asm_output_reg_pop (FILE *, int); extern void mmix_asm_output_skip (FILE *, int); extern void mmix_asm_output_align (FILE *, int); -extern HOST_WIDEST_INT mmix_intval (const_rtx); -extern int mmix_shiftable_wyde_value (unsigned HOST_WIDEST_INT); -extern void mmix_output_register_setting (FILE *, int, HOST_WIDEST_INT, int); +extern int64_t mmix_intval (const_rtx); +extern int mmix_shiftable_wyde_value (uint64_t); +extern void mmix_output_register_setting (FILE *, int, int64_t, int); extern int mmix_opposite_regno (int, int); extern int mmix_local_regno (int); extern unsigned mmix_dbx_register_number (unsigned); diff --git a/gcc/config/mmix/mmix.c b/gcc/config/mmix/mmix.c index d40b67c..9b616eb 100644 --- a/gcc/config/mmix/mmix.c +++ b/gcc/config/mmix/mmix.c @@ -117,10 +117,10 @@ static int mmix_output_destination_register; static void mmix_option_override (void); static void mmix_asm_output_source_filename (FILE *, const char *); static void mmix_output_shiftvalue_op_from_str - (FILE *, const char *, HOST_WIDEST_INT); -static void mmix_output_shifted_value (FILE *, HOST_WIDEST_INT); + (FILE *, const char *, int64_t); +static void mmix_output_shifted_value (FILE *, int64_t); static void mmix_output_condition (FILE *, const_rtx, int); -static void mmix_output_octa (FILE *, HOST_WIDEST_INT, int); +static void mmix_output_octa (FILE *, int64_t, int); static bool mmix_assemble_integer (rtx, unsigned int, int); static struct machine_function *mmix_init_machine_status (void); static void mmix_encode_section_info (tree, rtx, int); @@ -1588,25 +1588,25 @@ mmix_print_operand (FILE *stream, rtx x, int code) output. */ case 'A': mmix_output_shiftvalue_op_from_str (stream, "ANDN", - ~(unsigned HOST_WIDEST_INT) + ~(uint64_t) mmix_intval (x)); return; case 'i': mmix_output_shiftvalue_op_from_str (stream, "INC", - (unsigned HOST_WIDEST_INT) + (uint64_t) mmix_intval (x)); return; case 'o': mmix_output_shiftvalue_op_from_str (stream, "OR", - (unsigned HOST_WIDEST_INT) + (uint64_t) mmix_intval (x)); return; case 's': mmix_output_shiftvalue_op_from_str (stream, "SET", - (unsigned HOST_WIDEST_INT) + (uint64_t) mmix_intval (x)); return; @@ -1628,8 +1628,8 @@ mmix_print_operand (FILE *stream, rtx x, int code) fatal_insn ("MMIX Internal: Bad value for 'm', not a CONST_INT", x); } - fprintf (stream, HOST_WIDEST_INT_PRINT_DEC, - (HOST_WIDEST_INT) (mmix_intval (x) - 1)); + fprintf (stream, "%"PRId64, + (int64_t) (mmix_intval (x) - 1)); return; case 'p': @@ -1667,11 +1667,11 @@ mmix_print_operand (FILE *stream, rtx x, int code) return; case 'v': - mmix_output_shifted_value (stream, (HOST_WIDEST_INT) mmix_intval (x)); + mmix_output_shifted_value (stream, (int64_t) mmix_intval (x)); return; case 'V': - mmix_output_shifted_value (stream, (HOST_WIDEST_INT) ~mmix_intval (x)); + mmix_output_shifted_value (stream, (int64_t) ~mmix_intval (x)); return; case 'W': @@ -2294,37 +2294,37 @@ mmix_expand_epilogue (void) void mmix_output_register_setting (FILE *stream, int regno, - HOST_WIDEST_INT value, + int64_t value, int do_begin_end) { if (do_begin_end) fprintf (stream, "\t"); if (insn_const_int_ok_for_constraint (value, CONSTRAINT_K)) - fprintf (stream, "NEGU %s,0," HOST_WIDEST_INT_PRINT_DEC, reg_names[regno], -value); - else if (mmix_shiftable_wyde_value ((unsigned HOST_WIDEST_INT) value)) + fprintf (stream, "NEGU %s,0,%"PRId64, reg_names[regno], -value); + else if (mmix_shiftable_wyde_value ((uint64_t) value)) { /* First, the one-insn cases. */ mmix_output_shiftvalue_op_from_str (stream, "SET", - (unsigned HOST_WIDEST_INT) + (uint64_t) value); fprintf (stream, " %s,", reg_names[regno]); - mmix_output_shifted_value (stream, (unsigned HOST_WIDEST_INT) value); + mmix_output_shifted_value (stream, (uint64_t) value); } - else if (mmix_shiftable_wyde_value (-(unsigned HOST_WIDEST_INT) value)) + else if (mmix_shiftable_wyde_value (-(uint64_t) value)) { /* We do this to get a bit more legible assembly code. The next alternative is mostly redundant with this. */ mmix_output_shiftvalue_op_from_str (stream, "SET", - -(unsigned HOST_WIDEST_INT) + -(uint64_t) value); fprintf (stream, " %s,", reg_names[regno]); - mmix_output_shifted_value (stream, -(unsigned HOST_WIDEST_INT) value); + mmix_output_shifted_value (stream, -(uint64_t) value); fprintf (stream, "\n\tNEGU %s,0,%s", reg_names[regno], reg_names[regno]); } - else if (mmix_shiftable_wyde_value (~(unsigned HOST_WIDEST_INT) value)) + else if (mmix_shiftable_wyde_value (~(uint64_t) value)) { /* Slightly more expensive, the two-insn cases. */ @@ -2335,10 +2335,10 @@ mmix_output_register_setting (FILE *stream, anyone else cares). */ mmix_output_shiftvalue_op_from_str (stream, "SET", - ~(unsigned HOST_WIDEST_INT) + ~(uint64_t) value); fprintf (stream, " %s,", reg_names[regno]); - mmix_output_shifted_value (stream, ~(unsigned HOST_WIDEST_INT) value); + mmix_output_shifted_value (stream, ~(uint64_t) value); fprintf (stream, "\n\tNOR %s,%s,0", reg_names[regno], reg_names[regno]); } @@ -2350,7 +2350,7 @@ mmix_output_register_setting (FILE *stream, const char *line_begin = ""; int insns = 0; int i; - HOST_WIDEST_INT tmpvalue = value; + int64_t tmpvalue = value; /* Compute the number of insns needed to output this constant. */ for (i = 0; i < 4 && tmpvalue != 0; i++) @@ -2405,7 +2405,7 @@ mmix_output_register_setting (FILE *stream, else return 0. */ int -mmix_shiftable_wyde_value (unsigned HOST_WIDEST_INT value) +mmix_shiftable_wyde_value (uint64_t value) { /* Shift by 16 bits per group, stop when we've found two groups with nonzero bits. */ @@ -2487,7 +2487,7 @@ mmix_emit_sp_add (HOST_WIDE_INT offset) static void mmix_output_shiftvalue_op_from_str (FILE *stream, const char *mainop, - HOST_WIDEST_INT value) + int64_t value) { static const char *const op_part[] = {"L", "ML", "MH", "H"}; int i; @@ -2495,7 +2495,7 @@ mmix_output_shiftvalue_op_from_str (FILE *stream, if (! mmix_shiftable_wyde_value (value)) { char s[sizeof ("0xffffffffffffffff")]; - sprintf (s, HOST_WIDEST_INT_PRINT_HEX, value); + sprintf (s, "%#"PRIx64, value); internal_error ("MMIX Internal: %s is not a shiftable int", s); } @@ -2518,26 +2518,26 @@ mmix_output_shiftvalue_op_from_str (FILE *stream, /* Print a 64-bit value, optionally prefixed by assembly pseudo. */ static void -mmix_output_octa (FILE *stream, HOST_WIDEST_INT value, int do_begin_end) +mmix_output_octa (FILE *stream, int64_t value, int do_begin_end) { if (do_begin_end) fprintf (stream, "\tOCTA "); /* Provide a few alternative output formats depending on the number, to improve legibility of assembler output. */ - if ((value < (HOST_WIDEST_INT) 0 && value > (HOST_WIDEST_INT) -10000) - || (value >= (HOST_WIDEST_INT) 0 && value <= (HOST_WIDEST_INT) 16384)) + if ((value < (int64_t) 0 && value > (int64_t) -10000) + || (value >= (int64_t) 0 && value <= (int64_t) 16384)) fprintf (stream, "%d", (int) value); - else if (value > (HOST_WIDEST_INT) 0 - && value < ((HOST_WIDEST_INT) 1 << 31) * 2) + else if (value > (int64_t) 0 + && value < ((int64_t) 1 << 31) * 2) fprintf (stream, "#%x", (unsigned int) value); - else if (sizeof (HOST_WIDE_INT) == sizeof (HOST_WIDEST_INT)) + else if (sizeof (HOST_WIDE_INT) == sizeof (int64_t)) /* We need to avoid the not-so-universal "0x" prefix; we need the pure hex-digits together with the mmixal "#" hex prefix. */ fprintf (stream, "#" HOST_WIDE_INT_PRINT_HEX_PURE, (HOST_WIDE_INT) value); else /* Need to avoid the hex output; there's no ...WIDEST...HEX_PURE. */ - fprintf (stream, HOST_WIDEST_INT_PRINT_UNSIGNED, value); + fprintf (stream, "%"PRIu64, value); if (do_begin_end) fprintf (stream, "\n"); @@ -2547,14 +2547,14 @@ mmix_output_octa (FILE *stream, HOST_WIDEST_INT value, int do_begin_end) be output with an operand). */ static void -mmix_output_shifted_value (FILE *stream, HOST_WIDEST_INT value) +mmix_output_shifted_value (FILE *stream, int64_t value) { int i; if (! mmix_shiftable_wyde_value (value)) { char s[16+2+1]; - sprintf (s, HOST_WIDEST_INT_PRINT_HEX, value); + sprintf (s, "%#"PRIx64, value); internal_error ("MMIX Internal: %s is not a shiftable int", s); } @@ -2687,10 +2687,10 @@ mmix_output_condition (FILE *stream, const_rtx x, int reversed) /* Return the bit-value for a const_int or const_double. */ -HOST_WIDEST_INT +int64_t mmix_intval (const_rtx x) { - unsigned HOST_WIDEST_INT retval; + uint64_t retval; if (GET_CODE (x) == CONST_INT) return INTVAL (x); @@ -2699,22 +2699,7 @@ mmix_intval (const_rtx x) gcc-2.7.2 is broken. I still want people to be able to use it for cross-compilation to MMIX. */ if (GET_CODE (x) == CONST_DOUBLE && GET_MODE (x) == VOIDmode) - { - if (sizeof (HOST_WIDE_INT) < sizeof (HOST_WIDEST_INT)) - { - retval = (unsigned) CONST_DOUBLE_LOW (x) / 2; - retval *= 2; - retval |= CONST_DOUBLE_LOW (x) & 1; - - retval |= - (unsigned HOST_WIDEST_INT) CONST_DOUBLE_HIGH (x) - << (HOST_BITS_PER_LONG)/2 << (HOST_BITS_PER_LONG)/2; - } - else - retval = CONST_DOUBLE_HIGH (x); - - return retval; - } + return CONST_DOUBLE_HIGH (x); if (GET_CODE (x) == CONST_DOUBLE) { @@ -2733,9 +2718,9 @@ mmix_intval (const_rtx x) sign-extended to unsigned long long(!) when they're of different size (usually 32-bit hosts). */ return - ((unsigned HOST_WIDEST_INT) (unsigned long) bits[0] - << (unsigned HOST_WIDEST_INT) 32U) - | (unsigned HOST_WIDEST_INT) (unsigned long) bits[1]; + ((uint64_t) (unsigned long) bits[0] + << (uint64_t) 32U) + | (uint64_t) (unsigned long) bits[1]; } else if (GET_MODE (x) == SFmode) { diff --git a/gcc/config/mmix/mmix.md b/gcc/config/mmix/mmix.md index 3c74b66..306d632 100644 --- a/gcc/config/mmix/mmix.md +++ b/gcc/config/mmix/mmix.md @@ -1168,7 +1168,7 @@ DIVU %1,%1,%2\;GET %0,:rR\;NEGU %2,0,%0\;CSNN %0,$255,%2") } else { - HOST_WIDEST_INT offs = INTVAL (XEXP (operands[1], 1)); + int64_t offs = INTVAL (XEXP (operands[1], 1)); offs += MMIX_fp_rO_OFFSET; if (insn_const_int_ok_for_constraint (offs, CONSTRAINT_I)) diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c index a0c4628..a5118c6 100644 --- a/gcc/config/sh/sh.c +++ b/gcc/config/sh/sh.c @@ -2088,12 +2088,11 @@ expand_cbranchdi4 (rtx *operands, enum rtx_code comparison) lsw_taken_prob = prob ? REG_BR_PROB_BASE : 0; else { - gcc_assert (HOST_BITS_PER_WIDEST_INT >= 64); lsw_taken_prob = (prob ? (REG_BR_PROB_BASE - - ((HOST_WIDEST_INT) REG_BR_PROB_BASE * rev_prob - / ((HOST_WIDEST_INT) prob << 32))) + - ((gcov_type) REG_BR_PROB_BASE * rev_prob + / ((gcov_type) prob << 32))) : 0); } } |