diff options
author | sayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-03-16 19:47:19 +0000 |
---|---|---|
committer | sayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-03-16 19:47:19 +0000 |
commit | 905582c177eef4117367b027050986526c80b5f0 (patch) | |
tree | 7bacb634926cbe58204a557842acbd600d319a13 /gcc/tree-dump.c | |
parent | 1697718f420e770b5f890f2e2008b487780fbef8 (diff) | |
download | gcc-905582c177eef4117367b027050986526c80b5f0.tar.gz |
2006-03-16 Roger Sayle <roger@eyesopen.com>
Daniel Speyer <dspeyer@wam.umd.edu>
PR middle-end/18259
* tree-dump.c (dump_real): New function.
(dequeue_and_dump) <REAL_CST>: Use it to dump FP constants.
* Makefile.in (REAL_H): New macro for dependencies on real.h.
(tree-dump.o): Add $(REAL_H) to the dependencies.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@112147 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-dump.c')
-rw-r--r-- | gcc/tree-dump.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/gcc/tree-dump.c b/gcc/tree-dump.c index 42c019f4062..d97dc83af13 100644 --- a/gcc/tree-dump.c +++ b/gcc/tree-dump.c @@ -1,5 +1,5 @@ /* Tree-dumping functionality for intermediate representation. - Copyright (C) 1999, 2000, 2002, 2003, 2004, 2005 + Copyright (C) 1999, 2000, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. Written by Mark Mitchell <mark@codesourcery.com> @@ -32,6 +32,7 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA #include "tree-pass.h" #include "langhooks.h" #include "tree-iterator.h" +#include "real.h" static unsigned int queue (dump_info_p, tree, int); static void dump_index (dump_info_p, unsigned int); @@ -179,6 +180,19 @@ dump_int (dump_info_p di, const char *field, int i) di->column += 14; } +/* Dump the floating point value R, using FIELD to identify it. */ + +static void +dump_real (dump_info_p di, const char *field, const REAL_VALUE_TYPE *r) +{ + char buf[32]; + real_to_decimal (buf, r, sizeof (buf), 0, true); + dump_maybe_newline (di); + fprintf (di->stream, "%-4s: %s ", field, buf); + di->column += strlen (buf) + 7; +} + + /* Dump the string S. */ void @@ -531,6 +545,10 @@ dequeue_and_dump (dump_info_p di) dump_int (di, "lngt", TREE_STRING_LENGTH (t)); break; + case REAL_CST: + dump_real (di, "valu", TREE_REAL_CST_PTR (t)); + break; + case TRUTH_NOT_EXPR: case ADDR_EXPR: case INDIRECT_REF: |