This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: how to get value of real constant in .tu file


Sushil,

The TU files are the same as used by me in the introspector patch,
Except that I output them into XML.

I will attempt at answering this request.

(Note, I am looking at the ast-optimizer-branch here )

The code in tree-dump.c that produces integers is here :
------------------------------------------------------------
case INTEGER_CST:
      if (TREE_INT_CST_HIGH (t))
	dump_int (di, "high", TREE_INT_CST_HIGH (t));
        dump_int (di, "low", TREE_INT_CST_LOW (t));
      break;
------------------------------------------------------------

Now, examining this code shows that there is not any handlers for
real_cst, but in the modules print-tree.c (for debugging output)
------------------------------------------------------------
	case REAL_CST:
	  {
	    REAL_VALUE_TYPE d;

	    if (TREE_OVERFLOW (node))
	      fprintf (file, " overflow");

	    d = TREE_REAL_CST (node);
	    if (REAL_VALUE_ISINF (d))
	      fprintf (file, " Inf");
	    else if (REAL_VALUE_ISNAN (d))
	      fprintf (file, " Nan");
	    else
	      {
		char string[100];

		REAL_VALUE_TO_DECIMAL (d, "%e", string);
		fprintf (file, " %s", string);
	      }
	  }
	  break;
------------------------------------------------------------

I can imagine that it would be pretty simple to include this
code back into the tree dumper.

Hope that helps,

Mike


=====
James Michael DuPont
http://introspector.sourceforge.net/

__________________________________________________
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos & More
http://faith.yahoo.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]