* tree.h: Forward-declare struct realvaluetype.
(struct tree_real_cst): Point to the REAL_VALUE_TYPE, do not
contain it.
(TREE_REAL_CST_PTR): New accessor.
(TREE_REAL_CST): Update.
* real.h: Include machmode.h.
(realvaluetype): Make it struct realvaluetype, not a typedef.
(build_real): Prototype here.
* tree.c: Include real.h.
(build_real): Allocate the REAL_VALUE_TYPE as a separate
object in GC memory, set TREE_REAL_CST_PTR to point to it.
(build_real_from_int_cst): Use build_real.
* ggc-common.c (ggc_mark_trees): Mark TREE_REAL_CST_PTR of a
REAL_CST.
* builtins.c, c-common.c, c-lex.c, dwarf2out.c, expr.c,
fold-const.c, print-tree.c, real.c, cp/mangle.c, cp/tree.c,
f/bld.c, f/com.c, f/expr.c, f/target.c, java/decl.c,
java/jcf-parse.c, java/parse.y, java/typeck.c: Include real.h.
* Makefile.in, cp/Make-lang.in, f/Make-lang.in,
java/Make-lang.in: Update dependency lists.
From-SVN: r53959
+2002-05-28 Zack Weinberg <zack@codesourcery.com>
+
+ * tree.h: Forward-declare struct realvaluetype.
+ (struct tree_real_cst): Point to the REAL_VALUE_TYPE, do not
+ contain it.
+ (TREE_REAL_CST_PTR): New accessor.
+ (TREE_REAL_CST): Update.
+ * real.h: Include machmode.h.
+ (realvaluetype): Make it struct realvaluetype, not a typedef.
+ (build_real): Prototype here.
+
+ * tree.c: Include real.h.
+ (build_real): Allocate the REAL_VALUE_TYPE as a separate
+ object in GC memory, set TREE_REAL_CST_PTR to point to it.
+ (build_real_from_int_cst): Use build_real.
+ * ggc-common.c (ggc_mark_trees): Mark TREE_REAL_CST_PTR of a
+ REAL_CST.
+
+ * builtins.c, c-common.c, c-lex.c, dwarf2out.c, expr.c,
+ fold-const.c, print-tree.c, real.c: Include real.h.
+ * Makefile.in: Update dependency lists.
+
2002-05-28 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
* basic-block.h (last_basic_block): Declare.
RTL_BASE_H = rtl.h rtl.def $(MACHMODE_H)
RTL_H = $(RTL_BASE_H) genrtl.h
PARAMS_H = params.h params.def
-TREE_H = tree.h real.h tree.def $(MACHMODE_H) tree-check.h version.h builtins.def
+TREE_H = tree.h tree.def $(MACHMODE_H) tree-check.h version.h builtins.def
BASIC_BLOCK_H = basic-block.h bitmap.h sbitmap.h varray.h
DEMANGLE_H = $(srcdir)/../include/demangle.h
RECOG_H = recog.h
c-lang.o : c-lang.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(C_TREE_H) \
langhooks.h $(LANGHOOKS_DEF_H) c-common.h
c-lex.o : c-lex.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) \
- debug.h $(C_TREE_H) c-common.h \
+ debug.h $(C_TREE_H) c-common.h real.h \
c-pragma.h input.h intl.h flags.h toplev.h output.h \
mbchar.h $(CPPLIB_H) $(EXPR_H) $(TM_P_H)
c-objc-common.o : c-objc-common.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) \
c-common.o : c-common.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(OBSTACK_H) \
$(C_COMMON_H) flags.h toplev.h output.h c-pragma.h $(RTL_H) $(GGC_H) \
$(EXPR_H) $(TM_P_H) builtin-types.def builtin-attrs.def $(TARGET_H) \
- diagnostic.h tree-inline.h except.h
+ diagnostic.h tree-inline.h except.h real.h
# A file used by all variants of C and some other languages.
tree-inline.h $(RTL_H) insn-config.h integrate.h langhooks.h \
$(LANGHOOKS_DEF_H) flags.h
tree.o : tree.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) flags.h function.h toplev.h \
- $(GGC_H) $(HASHTAB_H) $(TARGET_H) output.h $(TM_P_H) langhooks.h
+ $(GGC_H) $(HASHTAB_H) $(TARGET_H) output.h $(TM_P_H) langhooks.h real.h
tree-dump.o: tree-dump.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(C_TREE_H) \
flags.h langhooks.h toplev.h output.h c-pragma.h $(RTL_H) $(GGC_H) \
$(EXPR_H) $(SPLAY_TREE_H) tree-dump.h
$(VARRAY_H) $(HASHTAB_H) $(SPLAY_TREE_H) toplev.h langhooks.h \
$(C_COMMON_H) tree-inline.h
print-tree.o : print-tree.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(GGC_H) \
- langhooks.h
+ langhooks.h real.h
stor-layout.o : stor-layout.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) flags.h \
function.h $(EXPR_H) $(RTL_H) toplev.h $(GGC_H) $(TM_P_H) $(TARGET_H) \
langhooks.h
-fold-const.o : fold-const.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) flags.h \
+fold-const.o : fold-const.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) flags.h real.h \
toplev.h $(HASHTAB_H) $(EXPR_H) $(RTL_H) $(GGC_H) $(TM_P_H) langhooks.h
diagnostic.o : diagnostic.c diagnostic.h real.h diagnostic.def \
$(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(TM_P_H) flags.h $(GGC_H) \
expr.o : expr.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h function.h \
$(REGS_H) $(EXPR_H) $(OPTABS_H) libfuncs.h insn-attr.h insn-config.h \
$(RECOG_H) output.h typeclass.h hard-reg-set.h toplev.h hard-reg-set.h \
- except.h reload.h $(GGC_H) langhooks.h intl.h $(TM_P_H)
+ except.h reload.h $(GGC_H) langhooks.h intl.h $(TM_P_H) real.h
builtins.o : builtins.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h \
$(TARGET_H) function.h $(REGS_H) $(EXPR_H) $(OPTABS_H) insn-config.h \
$(RECOG_H) output.h typeclass.h hard-reg-set.h toplev.h hard-reg-set.h \
- except.h $(TM_P_H) $(PREDICT_H) libfuncs.h
+ except.h $(TM_P_H) $(PREDICT_H) libfuncs.h real.h
calls.o : calls.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h \
$(EXPR_H) langhooks.h \
libfuncs.h $(REGS_H) toplev.h output.h function.h $(TIMEVAR_H) $(TM_P_H)
flags.h insn-config.h reload.h output.h toplev.h $(TM_P_H) \
debug.h langhooks.h
dwarf2out.o : dwarf2out.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) dwarf2.h \
- debug.h flags.h insn-config.h reload.h output.h diagnostic.h \
+ debug.h flags.h insn-config.h reload.h output.h diagnostic.h real.h \
hard-reg-set.h $(REGS_H) $(EXPR_H) libfuncs.h toplev.h dwarf2out.h varray.h \
$(GGC_H) except.h dwarf2asm.h $(TM_P_H) langhooks.h
dwarf2asm.o : dwarf2asm.c $(CONFIG_H) $(SYSTEM_H) flags.h $(RTL_H) $(TREE_H) \
#include "config.h"
#include "system.h"
#include "machmode.h"
+#include "real.h"
#include "rtl.h"
#include "tree.h"
#include "obstack.h"
#include "config.h"
#include "system.h"
#include "tree.h"
+#include "real.h"
#include "flags.h"
#include "toplev.h"
#include "output.h"
#include "config.h"
#include "system.h"
+#include "real.h"
#include "rtl.h"
#include "tree.h"
#include "expr.h"
+2002-05-28 Zack Weinberg <zack@codesourcery.com>
+
+ * mangle.c, tree.c: Include real.h.
+ * Make-lang.in: Update dependency lists.
+
2002-05-25 Neil Booth <neil@daikokuya.demon.co.uk>
* lex.c: Don't include c-lex.h.
cp/cvt.o: cp/cvt.c $(CXX_TREE_H) cp/decl.h flags.h toplev.h convert.h
cp/search.o: cp/search.c $(CXX_TREE_H) stack.h flags.h toplev.h $(RTL_H)
cp/tree.o: cp/tree.c $(CXX_TREE_H) flags.h toplev.h $(GGC_H) $(RTL_H) \
- insn-config.h integrate.h tree-inline.h
+ insn-config.h integrate.h tree-inline.h real.h
cp/ptree.o: cp/ptree.c $(CXX_TREE_H) $(SYSTEM_H)
cp/rtti.o: cp/rtti.c $(CXX_TREE_H) flags.h toplev.h
cp/except.o: cp/except.c $(CXX_TREE_H) flags.h $(RTL_H) except.h toplev.h \
cp/dump.o: cp/dump.c $(CXX_TREE_H) tree-dump.h
cp/optimize.o: cp/optimize.c $(CXX_TREE_H) rtl.h integrate.h insn-config.h \
input.h $(PARAMS_H) debug.h tree-inline.h
-cp/mangle.o: cp/mangle.c $(CXX_TREE_H) toplev.h
+cp/mangle.o: cp/mangle.c $(CXX_TREE_H) toplev.h real.h
cp/parse.o: cp/parse.c $(CXX_TREE_H) flags.h cp/lex.h except.h output.h \
$(SYSTEM_H) toplev.h $(GGC_H)
#include "system.h"
#include "tree.h"
#include "cp-tree.h"
+#include "real.h"
#include "obstack.h"
#include "toplev.h"
#include "varray.h"
#include "tree.h"
#include "cp-tree.h"
#include "flags.h"
+#include "real.h"
#include "rtl.h"
#include "toplev.h"
#include "ggc.h"
#include "system.h"
#include "tree.h"
#include "flags.h"
+#include "real.h"
#include "rtl.h"
#include "hard-reg-set.h"
#include "regs.h"
#include "config.h"
#include "system.h"
#include "machmode.h"
+#include "real.h"
#include "rtl.h"
#include "tree.h"
#include "obstack.h"
+2002-05-28 Zack Weinberg <zack@codesourcery.com>
+
+ * bld.c, com.c, expr.c, target.c: Include real.h.
+ * Make-lang.in: Update dependency lists.
+
2002-05-16 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
* Make-lang.in: Allow for PWDCMD to override hardcoded pwd.
f/malloc.h f/com.h f/com-rt.def $(TREE_H) f/info.h f/info-b.def f/info-k.def \
f/info-w.def f/target.h f/bad.h f/bad.def f/where.h glimits.h f/top.h f/lex.h \
f/type.h f/lab.h f/storag.h f/symbol.h f/symbol.def f/equiv.h f/global.h \
- f/name.h f/intrin.h f/intrin.def
+ f/name.h f/intrin.h f/intrin.def real.h
f/com.o: f/com.c f/proj.h $(CONFIG_H) $(SYSTEM_H) flags.h $(RTL_H) $(TREE_H) \
output.h convert.h f/com.h f/com-rt.def f/bld.h f/bld-op.def f/bit.h \
f/malloc.h f/info.h f/info-b.def f/info-k.def f/info-w.def f/target.h f/bad.h \
f/bad.def f/where.h glimits.h f/top.h f/lex.h f/type.h f/intrin.h \
f/intrin.def f/lab.h f/symbol.h f/symbol.def f/equiv.h f/storag.h f/global.h \
f/name.h f/expr.h f/implic.h f/src.h f/st.h $(GGC_H) toplev.h diagnostic.h \
- langhooks.h langhooks-def.h intl.h
+ langhooks.h langhooks-def.h intl.h real.h
f/data.o: f/data.c f/proj.h $(CONFIG_H) $(SYSTEM_H) f/data.h f/bld.h f/bld-op.def \
f/bit.h f/malloc.h f/com.h f/com-rt.def $(TREE_H) f/info.h f/info-b.def \
f/info-k.def f/info-w.def f/target.h f/bad.h f/bad.def f/where.h glimits.h \
f/info-k.def f/info-w.def f/target.h f/bad.h f/bad.def f/where.h glimits.h \
f/top.h f/lex.h f/type.h f/lab.h f/storag.h f/symbol.h f/symbol.def f/equiv.h \
f/global.h f/name.h f/intrin.h f/intrin.def f/implic.h f/src.h f/st.h \
- f/stamp-str
+ f/stamp-str real.h
f/fini.o: f/fini.c f/proj.h hconfig.h $(SYSTEM_H) f/malloc.h
f/global.o: f/global.c f/proj.h $(CONFIG_H) $(SYSTEM_H) f/global.h f/info.h \
f/info-b.def f/info-k.def f/info-w.def f/target.h $(TREE_H) f/bad.h f/bad.def \
f/lex.h f/type.h f/lab.h f/storag.h f/intrin.h f/intrin.def f/equiv.h \
f/global.h f/name.h f/src.h f/st.h
f/target.o: f/target.c f/proj.h $(CONFIG_H) $(SYSTEM_H) glimits.h f/target.h \
- $(TREE_H) f/bad.h f/bad.def f/where.h f/top.h f/malloc.h f/info.h \
+ $(TREE_H) f/bad.h f/bad.def f/where.h f/top.h f/malloc.h f/info.h real.h \
f/info-b.def f/info-k.def f/info-w.def f/type.h f/lex.h diagnostic.h
f/top.o: f/top.c f/proj.h $(CONFIG_H) $(SYSTEM_H) f/top.h f/malloc.h f/where.h \
glimits.h f/bad.h f/bad.def f/bit.h f/bld.h f/bld-op.def f/com.h \
#include "malloc.h"
#include "target.h"
#include "where.h"
+#include "real.h"
/* Externals defined here. */
#include "proj.h"
#include "flags.h"
+#include "real.h"
#include "rtl.h"
#include "toplev.h"
#include "tree.h"
#include "str.h"
#include "target.h"
#include "where.h"
+#include "real.h"
/* Externals defined here. */
#include "info.h"
#include "lex.h"
#include "malloc.h"
+#include "real.h"
/* Externals defined here. */
#include "system.h"
#include "flags.h"
#include "tree.h"
+#include "real.h"
#include "rtl.h"
#include "expr.h"
#include "tm_p.h"
ggc_mark_tree (TREE_IMAGPART (t));
break;
+ case REAL_CST:
+ ggc_mark (TREE_REAL_CST_PTR (t));
+ break;
+
case PARM_DECL:
ggc_mark_rtx (DECL_INCOMING_RTL (t));
break;
+2002-05-28 Zack Weinberg <zack@codesourcery.com>
+
+ * decl.c, jcf-parse.c, parse.y, typeck.c: Include real.h.
+ * Make-lang.in: Update dependency lists.
+
2002-05-18 Mark Mitchell <mark@codesourcery.com>
* gjavah.c (throwable_p): Do not free the name of the class after
toplev.h $(SYSTEM_H) $(GGC_H)
java/decl.o: java/decl.c $(CONFIG_H) $(JAVA_TREE_H) $(RTL_H) java/jcf.h \
toplev.h flags.h $(SYSTEM_H) function.h expr.h libfuncs.h except.h \
- java/java-except.h $(GGC_H)
+ java/java-except.h $(GGC_H) real.h
java/except.o: java/except.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h real.h \
$(RTL_H) java/javaop.h java/java-opcodes.h except.h java/java-except.h \
toplev.h $(SYSTEM_H) function.h
java/jcf-depend.o: java/jcf-depend.c $(CONFIG_H) $(SYSTEM_H) java/jcf.h
java/jcf-parse.o: java/jcf-parse.c $(CONFIG_H) $(JAVA_TREE_H) flags.h \
input.h java/java-except.h $(SYSTEM_H) toplev.h java/parse.h $(GGC_H) \
- debug.h
+ debug.h real.h
java/jcf-write.o: java/jcf-write.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h \
$(RTL_H) java/java-opcodes.h java/parse.h java/buffer.h $(SYSTEM_H) \
toplev.h $(GGC_H)
java/parse-scan.o: $(CONFIG_H) $(SYSTEM_H) toplev.h $(JAVA_LEX_C) java/parse.h \
java/lex.h
java/typeck.o: java/typeck.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h \
- java/convert.h toplev.h $(SYSTEM_H) $(GGC_H)
+ java/convert.h toplev.h $(SYSTEM_H) $(GGC_H) real.h
java/verify.o: java/verify.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h \
java/javaop.h java/java-opcodes.h java/java-except.h toplev.h $(SYSTEM_H)
java/xref.o: java/xref.c java/xref.h $(CONFIG_H) $(JAVA_TREE_H) toplev.h \
#include "system.h"
#include "tree.h"
#include "rtl.h"
+#include "real.h"
#include "toplev.h"
#include "flags.h"
#include "java-tree.h"
#include "config.h"
#include "system.h"
#include "tree.h"
+#include "real.h"
#include "obstack.h"
#include "flags.h"
#include "java-except.h"
#include <dirent.h>
#include "tree.h"
#include "rtl.h"
+#include "real.h"
#include "obstack.h"
#include "toplev.h"
#include "flags.h"
#include "config.h"
#include "system.h"
#include "tree.h"
+#include "real.h"
#include "obstack.h"
#include "flags.h"
#include "java-tree.h"
#include "config.h"
#include "system.h"
#include "tree.h"
+#include "real.h"
#include "ggc.h"
#include "langhooks.h"
#include "config.h"
#include "system.h"
+#include "real.h"
#include "tree.h"
#include "toplev.h"
#include "tm_p.h"
#ifndef GCC_REAL_H
#define GCC_REAL_H
+#include "machmode.h"
+
/* Define codes for all the float formats that we know of. */
#define UNKNOWN_FLOAT_FORMAT 0
#define IEEE_FLOAT_FORMAT 1
#define REAL_WIDTH \
(REAL_VALUE_TYPE_SIZE/HOST_BITS_PER_WIDE_INT \
+ (REAL_VALUE_TYPE_SIZE%HOST_BITS_PER_WIDE_INT ? 1 : 0)) /* round up */
-typedef struct {
+struct realvaluetype {
HOST_WIDE_INT r[REAL_WIDTH];
-} realvaluetype;
+};
/* Various headers condition prototypes on #ifdef REAL_VALUE_TYPE, so it needs
- to be a macro. */
-#define REAL_VALUE_TYPE realvaluetype
+ to be a macro. realvaluetype cannot be a typedef as this interferes with
+ other headers declaring opaque pointers to it. */
+#define REAL_VALUE_TYPE struct realvaluetype
/* Calculate the format for CONST_DOUBLE. We need as many slots as
are necessary to overlay a REAL_VALUE_TYPE on them. This could be
extern void debug_real PARAMS ((REAL_VALUE_TYPE));
extern REAL_VALUE_TYPE ereal_atof PARAMS ((const char *, enum machine_mode));
+/* In tree.c: wrap up a REAL_VALUE_TYPE in a tree node. */
+extern tree build_real PARAMS ((tree, REAL_VALUE_TYPE));
+
+
#endif /* ! GCC_REAL_H */
#include "system.h"
#include "flags.h"
#include "tree.h"
+#include "real.h"
#include "tm_p.h"
#include "function.h"
#include "obstack.h"
REAL_VALUE_TYPE d;
{
tree v;
+ REAL_VALUE_TYPE *dp;
int overflow = 0;
/* Check for valid float value for this type on this target machine;
#endif
v = make_node (REAL_CST);
+ dp = ggc_alloc (sizeof (REAL_VALUE_TYPE));
+ memcpy (dp, &d, sizeof (REAL_VALUE_TYPE));
+
TREE_TYPE (v) = type;
- TREE_REAL_CST (v) = d;
+ TREE_REAL_CST_PTR (v) = dp;
TREE_OVERFLOW (v) = TREE_CONSTANT_OVERFLOW (v) = overflow;
return v;
}
{
tree v;
int overflow = TREE_OVERFLOW (i);
- REAL_VALUE_TYPE d;
- v = make_node (REAL_CST);
- TREE_TYPE (v) = type;
+ v = build_real (type, real_value_from_int_cst (type, i));
- d = real_value_from_int_cst (type, i);
-
- /* Check for valid float value for this type on this target machine. */
-#ifdef CHECK_FLOAT_VALUE
- CHECK_FLOAT_VALUE (TYPE_MODE (type), d, overflow);
-#endif
-
- TREE_REAL_CST (v) = d;
- TREE_OVERFLOW (v) = TREE_CONSTANT_OVERFLOW (v) = overflow;
+ TREE_OVERFLOW (v) |= overflow;
+ TREE_CONSTANT_OVERFLOW (v) |= overflow;
return v;
}
#define TREE_CST_RTL(NODE) (CST_OR_CONSTRUCTOR_CHECK (NODE)->real_cst.rtl)
-/* In a REAL_CST node.
+/* In a REAL_CST node. struct realvaluetype is an opaque entity, with
+ manipulators defined in real.h. We don't want tree.h depending on
+ real.h and transitively on tm.h. */
+struct realvaluetype;
- We can represent a real value as either a `double' or an array of
- longs. */
-
-#define TREE_REAL_CST(NODE) (REAL_CST_CHECK (NODE)->real_cst.real_cst)
-
-#include "real.h"
+#define TREE_REAL_CST_PTR(NODE) (REAL_CST_CHECK (NODE)->real_cst.real_cst_ptr)
+#define TREE_REAL_CST(NODE) (*TREE_REAL_CST_PTR (NODE))
struct tree_real_cst
{
struct tree_common common;
rtx rtl; /* acts as link to register transfer language (rtl) info */
- REAL_VALUE_TYPE real_cst;
+ struct realvaluetype *real_cst_ptr;
};
/* In a STRING_CST */
extern tree build_int_2_wide PARAMS ((unsigned HOST_WIDE_INT, HOST_WIDE_INT));
extern tree build_vector PARAMS ((tree, tree));
-extern tree build_real PARAMS ((tree, REAL_VALUE_TYPE));
extern tree build_real_from_int_cst PARAMS ((tree, tree));
extern tree build_complex PARAMS ((tree, tree, tree));
extern tree build_string PARAMS ((int, const char *));