rtl.c (read_rtx): Use atol/atoq based upon disposition of HOST_WIDE_INT.
authorJeff Law <law@gcc.gnu.org>
Wed, 28 Jan 1998 23:25:15 +0000 (16:25 -0700)
committerJeff Law <law@gcc.gnu.org>
Wed, 28 Jan 1998 23:25:15 +0000 (16:25 -0700)
        * 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

gcc/ChangeLog
gcc/c-lex.c
gcc/combine.c
gcc/genattrtab.c
gcc/genemit.c
gcc/genpeep.c
gcc/genrecog.c
gcc/rtl.c

index 6f16703a2f47b2ed9a3280b956004c201f4b1bb5..a315c9a67c741cbf0edaf7fd18ae1765c0344ce6 100644 (file)
@@ -1,3 +1,23 @@
+Thu Jan 29 00:25:35 1998  David S. Miller  <davem@tanya.rutgers.edu>
+                         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 <roberto@keltia.freenix.fr>
 
        * i386/freebsd.h (LIB_SPEC): Correctly handle -shared, -p and friends.
index dc56b86266068d78efe9123a0d9847bb41ccb932..22e7e5f5c5c678be6f95817c10954ded55ae5d47 100644 (file)
@@ -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;
index 926d38f8c2724b12e4c5d2d9e49c9f165bca6cee..3bcea7deb3ccc432797325520e6f5966b1cfc500 100644 (file)
@@ -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
index f71cd4d8447aa1b345a5fa066543ff4ca5735769..3354aa7ad3f16bb9d4a324c93071d0e0a66918e1 100644 (file)
@@ -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.  */
index 9dacd528e46954354754011b512bbd15b167f93c..96bc532a25b8bde5daf0121d8a146c6e13b0d3fc 100644 (file)
@@ -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:
index c82c32a1d1b664f40211f7c72830abc0d2d53961..f8159c82cfe801b4bb40fa07fd4272895575bcf4 100644 (file)
@@ -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')
        {
index b07c70fc46f1cec875f7b8c3fb40adb634549c38..c61ae097389e71de7ff1cfaef6e4817942576c5e 100644 (file)
@@ -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 <stdio.h>\n");
   printf ("#include \"rtl.h\"\n");
   printf ("#include \"insn-config.h\"\n");
   printf ("#include \"recog.h\"\n");
index 113687453ac9d58049ffa7aa4bba6f2855e9107b..a6f53d4b719e3da7d37482c082c79d1ee1d209ba 100644 (file)
--- 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;