From: Jeff Law Date: Wed, 28 Jan 1998 23:25:15 +0000 (-0700) Subject: rtl.c (read_rtx): Use atol/atoq based upon disposition of HOST_WIDE_INT. X-Git-Tag: releases/libf2c-0.5.21~26 X-Git-Url: https://gcc.gnu.org/git/?a=commitdiff_plain;h=76d31c63736a0a5a0560fccf5d400c5a5b8a20b9;p=gcc.git rtl.c (read_rtx): Use atol/atoq based upon disposition of HOST_WIDE_INT. * rtl.c (read_rtx): Use atol/atoq based upon disposition of HOST_WIDE_INT. * genattrtab.c (write_test_expr): Use HOST_WIDE_INT_PRINT_DEC as needed. * genemit.c (gen_exp): Likewise. * genpeep.c (match_rtx): Likewise. * genrecog.c (write_tree_1): Likewise. * c-lex.c (yyprint): Use proper format string based upon disposition of HOST_BITS_PER_WIDE_INT. (yylex): Put casts in right place for args to build_int_2. * combine.c: Fix typos in Jan27 changes. From-SVN: r17544 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6f16703a2f47..a315c9a67c74 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,23 @@ +Thu Jan 29 00:25:35 1998 David S. Miller + Jeffrey A Law (law@cygnus.com) + + * rtl.c (read_rtx): Use atol/atoq based upon disposition of + HOST_WIDE_INT. + + * genattrtab.c (write_test_expr): Use HOST_WIDE_INT_PRINT_DEC + as needed. + * genemit.c (gen_exp): Likewise. + * genpeep.c (match_rtx): Likewise. + * genrecog.c (write_tree_1): Likewise. + + * c-lex.c (yyprint): Use proper format string based upon + disposition of HOST_BITS_PER_WIDE_INT. + (yylex): Put casts in right place for args to build_int_2. + +Thu Jan 29 00:24:29 1998 Jeffrey A Law (law@cygnus.com) + + * combine.c: Fix typos in Jan27 changes. + Thu Jan 29 00:07:49 1998 Ollivier Robert * i386/freebsd.h (LIB_SPEC): Correctly handle -shared, -p and friends. diff --git a/gcc/c-lex.c b/gcc/c-lex.c index dc56b8626606..22e7e5f5c5c6 100644 --- a/gcc/c-lex.c +++ b/gcc/c-lex.c @@ -330,10 +330,14 @@ yyprint (file, yychar, yylval) if (TREE_CODE (t) == INTEGER_CST) fprintf (file, #if HOST_BITS_PER_WIDE_INT == 64 -#if HOST_BITS_PER_WIDE_INT != HOST_BITS_PER_INT +#if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT + " 0x%x%016x", +#else +#if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG " 0x%lx%016lx", #else - " 0x%x%016x", + " 0x%llx%016llx", +#endif #endif #else #if HOST_BITS_PER_WIDE_INT != HOST_BITS_PER_INT @@ -1965,12 +1969,12 @@ yylex () else if (TREE_UNSIGNED (char_type_node) || ((result >> (num_bits - 1)) & 1) == 0) yylval.ttype - = build_int_2 (result & ((unsigned HOST_WIDE_INT) ~0 + = build_int_2 (result & (~(unsigned HOST_WIDE_INT) 0 >> (HOST_BITS_PER_WIDE_INT - num_bits)), 0); else yylval.ttype - = build_int_2 (result | ~((unsigned HOST_WIDE_INT) ~0 + = build_int_2 (result | ~(~(unsigned HOST_WIDE_INT) 0 >> (HOST_BITS_PER_WIDE_INT - num_bits)), -1); TREE_TYPE (yylval.ttype) = integer_type_node; diff --git a/gcc/combine.c b/gcc/combine.c index 926d38f8c272..3bcea7deb3cc 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -828,7 +828,7 @@ can_combine_p (insn, i3, pred, succ, pdest, psrc) rtx set = 0, src, dest; rtx p; #ifdef AUTO_INC_DEC - rtx, link; + rtx link; #endif int all_adjacent = (succ ? (next_active_insn (insn) == succ && next_active_insn (succ) == i3) @@ -10166,7 +10166,7 @@ simplify_comparison (code, pop0, pop1) } /* Now make any compound operations involved in this comparison. Then, - check for an outmost SUBREG on OP0 that isn't doing anything or is + check for an outmost SUBREG on OP0 that is not doing anything or is paradoxical. The latter case can only occur when it is known that the "extra" bits will be zero. Therefore, it is safe to remove the SUBREG. We can never remove a SUBREG for a non-equality comparison because the diff --git a/gcc/genattrtab.c b/gcc/genattrtab.c index f71cd4d8447a..3354aa7ad3f1 100644 --- a/gcc/genattrtab.c +++ b/gcc/genattrtab.c @@ -4617,11 +4617,7 @@ write_test_expr (exp, flags) /* Constant integer. */ case CONST_INT: -#if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT - printf ("%d", XWINT (exp, 0)); -#else - printf ("%ld", XWINT (exp, 0)); -#endif + printf (HOST_WIDE_INT_PRINT_DEC, XWINT (exp, 0)); break; /* A random C expression. */ diff --git a/gcc/genemit.c b/gcc/genemit.c index 9dacd528e469..96bc532a25b8 100644 --- a/gcc/genemit.c +++ b/gcc/genemit.c @@ -212,13 +212,11 @@ gen_exp (x) else if (INTVAL (x) == STORE_FLAG_VALUE) printf ("const_true_rtx"); else - printf ( -#if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT - "GEN_INT (%d)", -#else - "GEN_INT (%ld)", -#endif - INTVAL (x)); + { + printf ("GEN_INT ("); + printf (HOST_WIDE_INT_PRINT_DEC, INTVAL (x)); + printf (")"); + } return; case CONST_DOUBLE: diff --git a/gcc/genpeep.c b/gcc/genpeep.c index c82c32a1d1b6..f8159c82cfe8 100644 --- a/gcc/genpeep.c +++ b/gcc/genpeep.c @@ -325,13 +325,9 @@ match_rtx (x, path, fail_label) printf (";\n"); } -#if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT - printf (" if (XWINT (x, %d) != %d) goto L%d;\n", - i, XWINT (x, i), fail_label); -#else - printf (" if (XWINT (x, %d) != %ld) goto L%d;\n", - i, XWINT (x, i), fail_label); -#endif + printf (" if (XWINT (x, %d) != ", i); + printf (HOST_WIDE_INT_PRINT_DEC, XWINT (x, i)); + printf (") goto L%d;\n", fail_label); } else if (fmt[i] == 's') { diff --git a/gcc/genrecog.c b/gcc/genrecog.c index b07c70fc46f1..c61ae097389e 100644 --- a/gcc/genrecog.c +++ b/gcc/genrecog.c @@ -1,5 +1,5 @@ /* Generate code from machine description to recognize rtl as insns. - Copyright (C) 1987, 88, 92, 93, 94, 1995 Free Software Foundation, Inc. + Copyright (C) 1987, 88, 92, 93, 94, 95, 1997 Free Software Foundation, Inc. This file is part of GNU CC. @@ -508,6 +508,9 @@ add_to_sequence (pattern, last, position) newpos[depth] = '1'; new = add_to_sequence (XEXP (pattern, 1), &new->success, newpos); return new; + + default: + break; } fmt = GET_RTX_FORMAT (code); @@ -1286,6 +1289,8 @@ write_tree_1 (tree, prevpos, afterward, type) printf ("%sswitch (GET_MODE (x%d))\n", indents[indent], depth); printf ("%s{\n", indents[indent + 2]); indent += 4; + printf ("%sdefault:\n%sbreak;\n", indents[indent - 2], + indents[indent]); printf ("%scase %smode:\n", indents[indent - 2], GET_MODE_NAME (mode)); modemap[(int) mode] = 1; @@ -1301,6 +1306,8 @@ write_tree_1 (tree, prevpos, afterward, type) printf ("%sswitch (GET_CODE (x%d))\n", indents[indent], depth); printf ("%s{\n", indents[indent + 2]); indent += 4; + printf ("%sdefault:\n%sbreak;\n", indents[indent - 2], + indents[indent]); printf ("%scase ", indents[indent - 2]); print_code (p->code); printf (":\n"); @@ -1351,13 +1358,9 @@ write_tree_1 (tree, prevpos, afterward, type) must fit in 32 bit, thus it suffices to check only for 1 << 31 . */ HOST_WIDE_INT offset = p->elt_zero_wide == -2147483647 - 1; - printf ( -#if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT - "XWINT (x%d, 0) == %d%s && ", -#else - "XWINT (x%d, 0) == %ld%s && ", -#endif - depth, p->elt_zero_wide + offset, offset ? "-1" : ""); + printf ("XWINT (x%d, 0) == ", depth); + printf (HOST_WIDE_INT_PRINT_DEC, p->elt_zero_wide + offset); + printf ("%s && ", offset ? "-1" : ""); } if (p->veclen) printf ("XVECLEN (x%d, 0) == %d && ", depth, p->veclen); @@ -1736,6 +1739,7 @@ main (argc, argv) from the machine description file `md'. */\n\n"); printf ("#include \"config.h\"\n"); + printf ("#include \n"); printf ("#include \"rtl.h\"\n"); printf ("#include \"insn-config.h\"\n"); printf ("#include \"recog.h\"\n"); diff --git a/gcc/rtl.c b/gcc/rtl.c index 113687453ac9..a6f53d4b719e 100644 --- a/gcc/rtl.c +++ b/gcc/rtl.c @@ -765,7 +765,11 @@ read_rtx (infile) #if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT tmp_wide = atoi (tmp_char); #else +#if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG tmp_wide = atol (tmp_char); +#else + tmp_wide = atoq (tmp_char); +#endif #endif XWINT (return_rtx, i) = tmp_wide; break;