public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Bootstrap on MSVC broken (real.c ICEs compiling floatdidf()) .. was RE: Bootstrap still broken on ia64
@ 2002-10-02 10:27 Donn Terry
  2002-10-03 18:21 ` Richard Henderson
  0 siblings, 1 reply; 2+ messages in thread
From: Donn Terry @ 2002-10-02 10:27 UTC (permalink / raw)
  To: Richard Henderson; +Cc: gcc

To (Finally!) followup on this.

MSVC treats enum bitfields as signed.  The switches real_hash() and
decode_rtx_constant()
(in varasm.c) don't work:  struct real_value.class is a 2 bit bitfield,
and represents
the numbers from 0-3 (or -2..1 if signed).  The switch statements in
those two functions
build the switch value in a way that sign extension occurs, so it's
getting -1
when presented with rvc_nan (which is 3 to save a look at the source).

I see two ways to fix this: make class one bit wider (so it won't
extend) (and
consequently reduce EXP_BITS by one), or explicitly mask in the switch
statements.
There may be some other convention to deal with this sort of problem as
well, but
I haven't found any reference so far.  (Masking seems simpler, but it's
the sort of
thing that can break easily if someone forgets why it's needed, and I'm
not sure
that all the places where it's needed are known.)

Donn

-----Original Message-----
From: Donn Terry [mailto:donnte@microsoft.com] 
Sent: Tuesday, September 24, 2002 12:26 PM
To: Richard Henderson; Andreas Schwab
Cc: gcc@gcc.gnu.org
Subject: RE: Bootstrap still broken on ia64


I'm seeing the following (which I will look into, so this is just FYI at
this point) that appears to be related:

/dev/fs/C/home/donn.intel/gnu2.intel/egcs.source/gcc/libgcc2.c: In
function `__floatdidf':
/dev/fs/C/home/donn.intel/gnu2.intel/egcs.source/gcc/libgcc2.c:1060:
internal compiler error: in real_hash, at
C:\home\donn.intel\gnu2.intel\egcs.source\gcc\real.c:2337

This occurs when building on Interix with MSVC as the first stage
bootstrap. (Don't know if it repeats when building real.c with gcc.)
(Resync to CVS as of ~11A PDT).

Donn


-----Original Message-----
From: Richard Henderson [mailto:rth@redhat.com] 
Sent: Tuesday, September 24, 2002 9:54 AM
To: Andreas Schwab
Cc: gcc@gcc.gnu.org
Subject: Re: Bootstrap still broken on ia64


On Tue, Sep 24, 2002 at 01:31:38PM +0200, Andreas Schwab wrote:
> I'm still getting comparison failures during bootstrap on ia64.  Is
> someone working on this, or should I make a GNATS entry?

I was hoping it was the same problem as the other platforms were seeing.
I'll try to look at it today.


r~

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Bootstrap on MSVC broken (real.c ICEs compiling floatdidf()) .. was RE: Bootstrap still broken on ia64
  2002-10-02 10:27 Bootstrap on MSVC broken (real.c ICEs compiling floatdidf()) .. was RE: Bootstrap still broken on ia64 Donn Terry
@ 2002-10-03 18:21 ` Richard Henderson
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Henderson @ 2002-10-03 18:21 UTC (permalink / raw)
  To: Donn Terry; +Cc: gcc

On Wed, Oct 02, 2002 at 09:59:28AM -0700, Donn Terry wrote:
> MSVC treats enum bitfields as signed.  [...] struct real_value.class
> is a 2 bit bitfield

I should have remembered this.  We even have a mechanism in
place for dealing with it.  Fixed thus.


r~


	* real.h (struct real_value): Use ENUM_BITFIELD.

Index: real.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/real.h,v
retrieving revision 1.54
diff -u -p -r1.54 real.h
--- real.h	29 Sep 2002 21:23:45 -0000	1.54
+++ real.h	4 Oct 2002 00:41:54 -0000
@@ -42,7 +42,7 @@ enum real_value_class {
 
 struct real_value GTY(())
 {
-  enum real_value_class class : 2;
+  ENUM_BITFIELD (real_value_class) class : 2;
   unsigned int sign : 1;
   signed int exp : EXP_BITS;
   unsigned long sig[SIGSZ];

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-10-04  0:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-02 10:27 Bootstrap on MSVC broken (real.c ICEs compiling floatdidf()) .. was RE: Bootstrap still broken on ia64 Donn Terry
2002-10-03 18:21 ` Richard Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).