aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-dump.c
diff options
context:
space:
mode:
authorRoger Sayle <roger@eyesopen.com>2006-03-16 19:47:19 +0000
committerRoger Sayle <sayle@gcc.gnu.org>2006-03-16 19:47:19 +0000
commitda54e73b88b0684570cd900234ceee8b8aa31cd7 (patch)
tree7bacb634926cbe58204a557842acbd600d319a13 /gcc/tree-dump.c
parent3406876bb2f42963bedaaedd2ae2afe5eed6eeff (diff)
downloadgcc-da54e73b88b0684570cd900234ceee8b8aa31cd7.zip
gcc-da54e73b88b0684570cd900234ceee8b8aa31cd7.tar.gz
gcc-da54e73b88b0684570cd900234ceee8b8aa31cd7.tar.bz2
re PR middle-end/18259 (-fdump-tree-tu omits real constant values)
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. Co-Authored-By: Daniel Speyer <dspeyer@wam.umd.edu> From-SVN: r112147
Diffstat (limited to 'gcc/tree-dump.c')
-rw-r--r--gcc/tree-dump.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/gcc/tree-dump.c b/gcc/tree-dump.c
index 42c019f..d97dc83 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: