diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 174b392e3dd..a08053e0652 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,25 @@ +2002-05-28 Zack Weinberg + + * 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 * basic-block.h (last_basic_block): Declare. diff --git a/gcc/Makefile.in b/gcc/Makefile.in index d02567a3e12..1f71654a512 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -556,7 +556,7 @@ MACHMODE_H = machmode.h machmode.def 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 @@ -1174,7 +1174,7 @@ c-typeck.o : c-typeck.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(C_TREE_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) \ @@ -1231,7 +1231,7 @@ s-under: $(GCC_PASSES) 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. @@ -1349,7 +1349,7 @@ langhooks.o : langhooks.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) toplev.h \ 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 @@ -1358,11 +1358,11 @@ tree-inline.o : tree-inline.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_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) \ @@ -1414,11 +1414,11 @@ except.o : except.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.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) @@ -1443,7 +1443,7 @@ dwarfout.o : dwarfout.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) dwarf.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) \ diff --git a/gcc/builtins.c b/gcc/builtins.c index f7a78ca63df..a686c8dce9d 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -22,6 +22,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "config.h" #include "system.h" #include "machmode.h" +#include "real.h" #include "rtl.h" #include "tree.h" #include "obstack.h" diff --git a/gcc/c-common.c b/gcc/c-common.c index aeb6a2e45f4..b1a9205d119 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -22,6 +22,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "config.h" #include "system.h" #include "tree.h" +#include "real.h" #include "flags.h" #include "toplev.h" #include "output.h" diff --git a/gcc/c-lex.c b/gcc/c-lex.c index 292c267b312..2ecc147ce71 100644 --- a/gcc/c-lex.c +++ b/gcc/c-lex.c @@ -22,6 +22,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "config.h" #include "system.h" +#include "real.h" #include "rtl.h" #include "tree.h" #include "expr.h" diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 0d56ed8f1a9..e19c55abc78 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2002-05-28 Zack Weinberg + + * mangle.c, tree.c: Include real.h. + * Make-lang.in: Update dependency lists. + 2002-05-25 Neil Booth * lex.c: Don't include c-lex.h. diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in index 56a98ba74c6..029b6469f71 100644 --- a/gcc/cp/Make-lang.in +++ b/gcc/cp/Make-lang.in @@ -273,7 +273,7 @@ cp/method.o: cp/method.c $(CXX_TREE_H) toplev.h $(GGC_H) $(RTL_H) $(EXPR_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 \ @@ -291,7 +291,7 @@ cp/semantics.o: cp/semantics.c $(CXX_TREE_H) cp/lex.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) diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c index 322769cca6c..8365b0354fa 100644 --- a/gcc/cp/mangle.c +++ b/gcc/cp/mangle.c @@ -51,6 +51,7 @@ #include "system.h" #include "tree.h" #include "cp-tree.h" +#include "real.h" #include "obstack.h" #include "toplev.h" #include "varray.h" diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index 9a52cc0b531..a144c6d928f 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -26,6 +26,7 @@ Boston, MA 02111-1307, USA. */ #include "tree.h" #include "cp-tree.h" #include "flags.h" +#include "real.h" #include "rtl.h" #include "toplev.h" #include "ggc.h" diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index f6ef2fa3300..07295229a11 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -38,6 +38,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "system.h" #include "tree.h" #include "flags.h" +#include "real.h" #include "rtl.h" #include "hard-reg-set.h" #include "regs.h" diff --git a/gcc/expr.c b/gcc/expr.c index 1999e162ce9..f839b402676 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -22,6 +22,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "config.h" #include "system.h" #include "machmode.h" +#include "real.h" #include "rtl.h" #include "tree.h" #include "obstack.h" diff --git a/gcc/f/ChangeLog b/gcc/f/ChangeLog index fa13ad7220f..03c1b67b322 100644 --- a/gcc/f/ChangeLog +++ b/gcc/f/ChangeLog @@ -1,3 +1,8 @@ +2002-05-28 Zack Weinberg + + * bld.c, com.c, expr.c, target.c: Include real.h. + * Make-lang.in: Update dependency lists. + 2002-05-16 Rainer Orth * Make-lang.in: Allow for PWDCMD to override hardcoded pwd. diff --git a/gcc/f/Make-lang.in b/gcc/f/Make-lang.in index 6cdde9cf7fb..288ed9a156f 100644 --- a/gcc/f/Make-lang.in +++ b/gcc/f/Make-lang.in @@ -357,14 +357,14 @@ f/bld.o: f/bld.c f/proj.h $(CONFIG_H) $(SYSTEM_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/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 \ @@ -380,7 +380,7 @@ f/expr.o: f/expr.c f/proj.h $(CONFIG_H) $(SYSTEM_H) f/expr.h f/bld.h f/bld-op.de 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 \ @@ -512,7 +512,7 @@ f/symbol.o: f/symbol.c f/proj.h $(CONFIG_H) $(SYSTEM_H) f/symbol.h \ 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 \ diff --git a/gcc/f/bld.c b/gcc/f/bld.c index 9161419bdc9..3460c241b24 100644 --- a/gcc/f/bld.c +++ b/gcc/f/bld.c @@ -43,6 +43,7 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "malloc.h" #include "target.h" #include "where.h" +#include "real.h" /* Externals defined here. */ diff --git a/gcc/f/com.c b/gcc/f/com.c index c100c2a12ac..d66951542b4 100644 --- a/gcc/f/com.c +++ b/gcc/f/com.c @@ -82,6 +82,7 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "proj.h" #include "flags.h" +#include "real.h" #include "rtl.h" #include "toplev.h" #include "tree.h" diff --git a/gcc/f/expr.c b/gcc/f/expr.c index a63ae30424e..4824be7cdb3 100644 --- a/gcc/f/expr.c +++ b/gcc/f/expr.c @@ -48,6 +48,7 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "str.h" #include "target.h" #include "where.h" +#include "real.h" /* Externals defined here. */ diff --git a/gcc/f/target.c b/gcc/f/target.c index 36b61043f9b..74c9760a05c 100644 --- a/gcc/f/target.c +++ b/gcc/f/target.c @@ -76,6 +76,7 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "info.h" #include "lex.h" #include "malloc.h" +#include "real.h" /* Externals defined here. */ diff --git a/gcc/fold-const.c b/gcc/fold-const.c index e9173019fcd..400285e5fec 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -46,6 +46,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "system.h" #include "flags.h" #include "tree.h" +#include "real.h" #include "rtl.h" #include "expr.h" #include "tm_p.h" diff --git a/gcc/ggc-common.c b/gcc/ggc-common.c index 57c193d5036..f818fa1c808 100644 --- a/gcc/ggc-common.c +++ b/gcc/ggc-common.c @@ -457,6 +457,10 @@ ggc_mark_trees () 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; diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 5d838f794ff..3b630d324c3 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,8 @@ +2002-05-28 Zack Weinberg + + * decl.c, jcf-parse.c, parse.y, typeck.c: Include real.h. + * Make-lang.in: Update dependency lists. + 2002-05-18 Mark Mitchell * gjavah.c (throwable_p): Do not free the name of the class after diff --git a/gcc/java/Make-lang.in b/gcc/java/Make-lang.in index 798e656bd2e..c8bce83cd67 100644 --- a/gcc/java/Make-lang.in +++ b/gcc/java/Make-lang.in @@ -273,7 +273,7 @@ java/constants.o: java/constants.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h \ 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 @@ -284,7 +284,7 @@ java/expr.o: java/expr.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h real.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) @@ -300,7 +300,7 @@ java/mangle_name.o: java/mangle_name.c $(CONFIG_H) java/jcf.h $(JAVA_TREE_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 \ diff --git a/gcc/java/decl.c b/gcc/java/decl.c index c3dd5ae67d4..7026dead71c 100644 --- a/gcc/java/decl.c +++ b/gcc/java/decl.c @@ -30,6 +30,7 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */ #include "system.h" #include "tree.h" #include "rtl.h" +#include "real.h" #include "toplev.h" #include "flags.h" #include "java-tree.h" diff --git a/gcc/java/jcf-parse.c b/gcc/java/jcf-parse.c index 7faa74cedf8..b88270df923 100644 --- a/gcc/java/jcf-parse.c +++ b/gcc/java/jcf-parse.c @@ -28,6 +28,7 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */ #include "config.h" #include "system.h" #include "tree.h" +#include "real.h" #include "obstack.h" #include "flags.h" #include "java-except.h" diff --git a/gcc/java/parse.y b/gcc/java/parse.y index 9baa6eccbef..cccb8d7e6ac 100644 --- a/gcc/java/parse.y +++ b/gcc/java/parse.y @@ -51,6 +51,7 @@ definitions and other extensions. */ #include #include "tree.h" #include "rtl.h" +#include "real.h" #include "obstack.h" #include "toplev.h" #include "flags.h" diff --git a/gcc/java/typeck.c b/gcc/java/typeck.c index f4525436b82..d32bc055df6 100644 --- a/gcc/java/typeck.c +++ b/gcc/java/typeck.c @@ -28,6 +28,7 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */ #include "config.h" #include "system.h" #include "tree.h" +#include "real.h" #include "obstack.h" #include "flags.h" #include "java-tree.h" diff --git a/gcc/print-tree.c b/gcc/print-tree.c index d9a5e41963a..fb285d6fbc6 100644 --- a/gcc/print-tree.c +++ b/gcc/print-tree.c @@ -23,6 +23,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "config.h" #include "system.h" #include "tree.h" +#include "real.h" #include "ggc.h" #include "langhooks.h" diff --git a/gcc/real.c b/gcc/real.c index a4196981a1b..456108eb742 100644 --- a/gcc/real.c +++ b/gcc/real.c @@ -23,6 +23,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "config.h" #include "system.h" +#include "real.h" #include "tree.h" #include "toplev.h" #include "tm_p.h" diff --git a/gcc/real.h b/gcc/real.h index 4b59378808f..143261eff81 100644 --- a/gcc/real.h +++ b/gcc/real.h @@ -22,6 +22,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #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 @@ -87,12 +89,13 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #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 @@ -290,4 +293,8 @@ extern int target_negative PARAMS ((REAL_VALUE_TYPE)); 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 */ diff --git a/gcc/tree.c b/gcc/tree.c index 58ec6f8e5ed..d4c6e4f5760 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -37,6 +37,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "system.h" #include "flags.h" #include "tree.h" +#include "real.h" #include "tm_p.h" #include "function.h" #include "obstack.h" @@ -509,6 +510,7 @@ build_real (type, d) 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; @@ -518,8 +520,11 @@ build_real (type, d) #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; } @@ -556,20 +561,11 @@ build_real_from_int_cst (type, i) { 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; } diff --git a/gcc/tree.h b/gcc/tree.h index e7163ea7e97..9b8325a2a34 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -722,20 +722,19 @@ struct tree_int_cst #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 */ @@ -2123,7 +2122,6 @@ extern tree build_nt PARAMS ((enum tree_code, ...)); 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 *));