This is the mail archive of the
java-prs@gcc.gnu.org
mailing list for the Java project.
[Bug java/27025] ICE on simple initializer
- From: "aph at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: java-prs at gcc dot gnu dot org
- Date: 5 Apr 2006 14:12:03 -0000
- Subject: [Bug java/27025] ICE on simple initializer
- References: <bug-27025-12475@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #6 from aph at gcc dot gnu dot org 2006-04-05 14:12 -------
As far as I can see this bug is in every version of gcj that has ever existed.
There is special code (in merge_string_cste()) to convert an integer constant
to a constant string for concatenation. However, there isn't any code to
convert a floating-point constant to a constant string.
It would be fairly simple to call real_to_decimal() on the floating-point
number, but that function doesn't do Java-style floating-point formatting. We
could add full Java-style floating-point output conversion to gcj, but I don't
think it would be worth the effort.
My proposed fix, although technically imperfect, cures 99% of the cases we are
ever likely to encounter. It fails to fix weird cases like:
switch(x) { case 0: break;
case ("foo" + 2) == "foo2": break;
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27025