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: 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


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