This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Question about fold_convert()
- From: Mark Mitchell <mark at codesourcery dot com>
- To: "tromey at redhat dot com" <tromey at redhat dot com>, GCC Hackers <gcc at gcc dot gnu dot org>
- Date: Sun, 12 May 2002 11:22:50 -0700
- Subject: Re: Question about fold_convert()
--On Saturday, May 11, 2002 07:02:03 PM -0600 Tom Tromey
<tromey@redhat.com> wrote:
> 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.
I think that the right solution is to break up fold into a number of
subroutines. Maybe things like:
fold_arithmetic_op_of_constant_integers
fold_short_circuiting_logical_op
...
Then, have the generic fold do whatever smart things we can do. Have
the Java fold use these same routines, for code sharing, but in exactly
the ways that are allowed by the language.
As an added bonus, we'd get fold substantially tidier.
The basic point is that we need to be able to change the generic "fold"
without worrying about breaking Java; if we think of a new smart thing
to do we want to be able to do it. On the other hand, we don't want
Java to have to duplicate all the bits that make sense there too.
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com