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: fold() and target-specific macros


Jakub Jelinek writes:
 > On Sat, Aug 14, 2004 at 11:18:02AM +0100, Andrew Haley wrote:
 > > We've been running into a problem where the Java bytecode we generate
 > > from Java source is different on different targets.  Given that
 > > there's only one Java virtual machine, this is odd.  :-)
 > > 
 > > It's stuff like the code I've attached, which does folding based on
 > > the characteristics of the back end, in particular BITS_PER_WORD.
 > > 
 > > I'm not sure what to do with this.  Perhaps we should really not be
 > > trying to do this for the Java VM, or maybe we could do something
 > > really simple like disabling target-specific folders when not actually
 > > generating target-specific code.
 > 
 > I fear there are many target macros which get used with -femit-class-files,
 > e.g. all the floating point stuff etc.
 > Say the 0x7ff8000000000000 vs. 0x7fffffffffffffff NaN you worked on
 > yesterday.

I suggest simply conditionalizing the target-dependent folds.  At the
moment, flag_syntax_only is set when emitting bytecode (sic) and we
could simply not do these folds if flag_syntax_only is set.

 > One drastic solution could be to use separate backends for
 > gcj and for gcj -C, where jc1 would be as it is now and jcb1 or whatever
 > would use a config/bytecode/ target files rather than the selected target.
 > The drawbacks would be big (e.g. libbackend.a would need to be built twice,
 > increased Makefile complexity, etc.), the advantage would be that it would
 > certainly be completely target independent.

I don't like that idea much.  :-)

Andrew.


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