Commit 6f7e9e94 by Nathan Sidwell Committed by Nathan Sidwell

jcf-dump.c (print_constant, [...]): Don't fall foul of type-based aliasing.

	* jcf-dump.c (print_constant, case CONSTANT_float): Don't fall
	foul of type-based aliasing.

From-SVN: r57699
parent 73a73768
2002-10-01 Nathan Sidwell <nathan@codesourcery.com>
* jcf-dump.c (print_constant, case CONSTANT_float): Don't fall
foul of type-based aliasing.
2002-09-30 Anthony Green <green@redhat.com> 2002-09-30 Anthony Green <green@redhat.com>
* gcj.texi (Invoking jv-scan): Fix texinfo. * gcj.texi (Invoking jv-scan): Fix texinfo.
......
...@@ -504,10 +504,18 @@ DEFUN(print_constant, (out, jcf, index, verbosity), ...@@ -504,10 +504,18 @@ DEFUN(print_constant, (out, jcf, index, verbosity),
break; break;
case CONSTANT_Float: case CONSTANT_Float:
{ {
jfloat fnum = JPOOL_FLOAT (jcf, index); union
fprintf (out, "%s%.10g", verbosity > 0 ? "Float " : "", (double) fnum); {
jfloat f;
int32 i;
} pun;
pun.f = JPOOL_FLOAT (jcf, index);
fprintf (out, "%s%.10g",
verbosity > 0 ? "Float " : "", (double) pun.f);
if (verbosity > 1) if (verbosity > 1)
fprintf (out, ", bits = 0x%08lx", (long) (* (int32 *) &fnum)); fprintf (out, ", bits = 0x%08lx", (long) pun.i);
break; break;
} }
case CONSTANT_Double: case CONSTANT_Double:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment