Commit 2fde567e by Kaveh R. Ghazi Committed by Jeff Law

fold-const.c: Include "system.h" to get stdlib.h and stdio.h.

        * fold-const.c: Include "system.h" to get stdlib.h and stdio.h.
        (lshift_double): Add parentheses around + or - inside shift.
        (rshift_double): Likewise.
        (size_int_wide): Explicitly set type of `bit_p' to `int'.
        * Makefile.in (fold-const.o): Depend on system.h.

From-SVN: r18057
parent 0a7ed33c
...@@ -19,6 +19,13 @@ Tue Feb 17 22:56:14 1998 Richard Henderson <rth@cygnus.com> ...@@ -19,6 +19,13 @@ Tue Feb 17 22:56:14 1998 Richard Henderson <rth@cygnus.com>
Tue Feb 17 22:37:22 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> Tue Feb 17 22:37:22 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* fold-const.c: Include "system.h" to get stdlib.h and stdio.h.
(lshift_double): Add parentheses around + or - inside shift.
(rshift_double): Likewise.
(size_int_wide): Explicitly set type of `bit_p' to `int'.
* Makefile.in (fold-const.o): Depend on system.h.
* Makefile.in (gcc.o): Depend on system.h, in accordance with last * Makefile.in (gcc.o): Depend on system.h, in accordance with last
change to gcc.c. change to gcc.c.
......
...@@ -1319,7 +1319,7 @@ convert.o: convert.c $(CONFIG_H) $(TREE_H) flags.h convert.h ...@@ -1319,7 +1319,7 @@ convert.o: convert.c $(CONFIG_H) $(TREE_H) flags.h convert.h
tree.o : tree.c $(CONFIG_H) $(TREE_H) flags.h function.h tree.o : tree.c $(CONFIG_H) $(TREE_H) flags.h function.h
print-tree.o : print-tree.c $(CONFIG_H) $(TREE_H) print-tree.o : print-tree.c $(CONFIG_H) $(TREE_H)
stor-layout.o : stor-layout.c $(CONFIG_H) $(TREE_H) flags.h function.h stor-layout.o : stor-layout.c $(CONFIG_H) $(TREE_H) flags.h function.h
fold-const.o : fold-const.c $(CONFIG_H) $(TREE_H) flags.h fold-const.o : fold-const.c $(CONFIG_H) $(TREE_H) flags.h system.h
toplev.o : toplev.c $(CONFIG_H) $(TREE_H) $(RTL_H) \ toplev.o : toplev.c $(CONFIG_H) $(TREE_H) $(RTL_H) \
flags.h input.h insn-attr.h xcoffout.h defaults.h output.h \ flags.h input.h insn-attr.h xcoffout.h defaults.h output.h \
$(lang_options_files) $(lang_options_files)
......
...@@ -43,7 +43,7 @@ Boston, MA 02111-1307, USA. */ ...@@ -43,7 +43,7 @@ Boston, MA 02111-1307, USA. */
forces the value to fit the type. It returns an overflow indicator. */ forces the value to fit the type. It returns an overflow indicator. */
#include "config.h" #include "config.h"
#include <stdio.h> #include "system.h"
#include <setjmp.h> #include <setjmp.h>
#include "flags.h" #include "flags.h"
#include "tree.h" #include "tree.h"
...@@ -356,13 +356,13 @@ lshift_double (l1, h1, count, prec, lv, hv, arith) ...@@ -356,13 +356,13 @@ lshift_double (l1, h1, count, prec, lv, hv, arith)
if (count >= HOST_BITS_PER_WIDE_INT) if (count >= HOST_BITS_PER_WIDE_INT)
{ {
*hv = (unsigned HOST_WIDE_INT) l1 << count - HOST_BITS_PER_WIDE_INT; *hv = (unsigned HOST_WIDE_INT) l1 << (count - HOST_BITS_PER_WIDE_INT);
*lv = 0; *lv = 0;
} }
else else
{ {
*hv = (((unsigned HOST_WIDE_INT) h1 << count) *hv = (((unsigned HOST_WIDE_INT) h1 << count)
| ((unsigned HOST_WIDE_INT) l1 >> HOST_BITS_PER_WIDE_INT - count - 1 >> 1)); | ((unsigned HOST_WIDE_INT) l1 >> (HOST_BITS_PER_WIDE_INT - count - 1) >> 1));
*lv = (unsigned HOST_WIDE_INT) l1 << count; *lv = (unsigned HOST_WIDE_INT) l1 << count;
} }
} }
...@@ -392,14 +392,14 @@ rshift_double (l1, h1, count, prec, lv, hv, arith) ...@@ -392,14 +392,14 @@ rshift_double (l1, h1, count, prec, lv, hv, arith)
if (count >= HOST_BITS_PER_WIDE_INT) if (count >= HOST_BITS_PER_WIDE_INT)
{ {
*hv = signmask; *hv = signmask;
*lv = ((signmask << 2 * HOST_BITS_PER_WIDE_INT - count - 1 << 1) *lv = ((signmask << (2 * HOST_BITS_PER_WIDE_INT - count - 1) << 1)
| ((unsigned HOST_WIDE_INT) h1 >> count - HOST_BITS_PER_WIDE_INT)); | ((unsigned HOST_WIDE_INT) h1 >> (count - HOST_BITS_PER_WIDE_INT)));
} }
else else
{ {
*lv = (((unsigned HOST_WIDE_INT) l1 >> count) *lv = (((unsigned HOST_WIDE_INT) l1 >> count)
| ((unsigned HOST_WIDE_INT) h1 << HOST_BITS_PER_WIDE_INT - count - 1 << 1)); | ((unsigned HOST_WIDE_INT) h1 << (HOST_BITS_PER_WIDE_INT - count - 1) << 1));
*hv = ((signmask << HOST_BITS_PER_WIDE_INT - count) *hv = ((signmask << (HOST_BITS_PER_WIDE_INT - count))
| ((unsigned HOST_WIDE_INT) h1 >> count)); | ((unsigned HOST_WIDE_INT) h1 >> count));
} }
} }
...@@ -1429,6 +1429,7 @@ const_binop (code, arg1, arg2, notrunc) ...@@ -1429,6 +1429,7 @@ const_binop (code, arg1, arg2, notrunc)
tree tree
size_int_wide (number, high, bit_p) size_int_wide (number, high, bit_p)
unsigned HOST_WIDE_INT number, high; unsigned HOST_WIDE_INT number, high;
int bit_p;
{ {
register tree t; register tree t;
/* Type-size nodes already made for small sizes. */ /* Type-size nodes already made for small sizes. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment