This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Question about fold_convert()
- From: Tom Tromey <tromey at redhat dot com>
- To: GCC Hackers <gcc at gcc dot gnu dot org>
- Date: 11 May 2002 19:02:03 -0600
- Subject: Question about fold_convert()
- Reply-to: tromey at redhat dot com
Today I looked at PR 6391. Basically it turns out to be a mismatch
between fold_convert() and Java. fold_convert handles real constants
one way, while Java specifies a different way.
This sort of thing shows up occasionally; for another example see PR
6005. I'm sure there are more examples, but I don't have a list.
Anyway, I'd like to know what can be done. I think we'd prefer to
keep using the generic fold(), especially when compiling to native.
(Though this is certainly up for reconsideration -- you tell me.)
However, we'd like to be able to tweak it in some cases.
For 6391 I think we'd like a way to get fold_convert() to use Java
semantics for real->int conversion. How would I go about implementing
this? Would adding a new langhook be an acceptable approach?
For 6005 we'd like to just disable certain transformations when we're
generating bytecode. Again, is a langhook the best way?
If not a langhook, then what?
Tom