On 16 September 2004 03:53, Donald Bruce Stewart wrote:

> simonmar:
>>> simonmar:
>>>> Regardless of the gcc bug, that sequence of ifs looks really dumb.
>>>> Can we see the STG fragment that gives rise to this code?
>> 
>> Ok, update and try now.  I've cleaned up that code a bit, so
>> hopefully gcc won't gag on it.
...
> which gcc2 deals with nicely. However, MachOp.hs still falls over:
...

At this point, I suggest you just use a local patch to workaround the
problem: change the definition of 'dense' in CgUtils:mk_switch so that
it will generate much less dense jump tables, hence avoiding the
complicated if-trees that cause problems for gcc 2.95.

I suppose in one sense a reasonable thing to do would be to *always*
generate switches when compiling via-C, because the C compiler has its
own machinery to decide when to use a jump table or not.  But
unfortunately the code generator doesn't know whether it's compiling
via-C or not, and we'd have to add that information to the monad.

Perhaps another way would be to set the dense value high if gcc 2.95 is
detected (i.e. pass the gcc version in via CPP or something).  By all
means do this if you like.

Cheers,
        Simon
_______________________________________________
Cvs-ghc mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to