gcc-2.95.3 internal error on head/MachOp.hs

Simon Marlow simonmar at microsoft.com
Wed Sep 15 04:16:19 EDT 2004


On 15 September 2004 08:45, Donald Bruce Stewart wrote:

> The problem seems to be in the if-goto code sequence marked below. In
> the old code generator we had a giant switch, but now we have an
> if-goto block, which branches to a switch for some cases. gcc seems
> to get confused by the if-goto construct, in this case, and it is
> dependent on the number of branches in the function somehow:
> 
>         IF_(s1Ee_ret) {
>                 W_ _c1Es;
>                 FB_
>                 _c1Es = (W_)((*((StgWord16*)((*R1.p) + (-0x2)))));
>               >>>>>
>                 if (_c1Es < 0x5) goto _c1EB;
>                 if (_c1Es < 0x7) goto _c1EC;
>                 if (_c1Es < 0x8) goto _c1ED;
>                 if (_c1Es != 0x8) goto _c1EE;
>               <<<<<
>                 R1.p = (P_)(W_)GHCziBase_True_closure;
>                 Sp=Sp+1;
>                 JMP_(*((P_)((*Sp) + (-0x14))));
>         ...
>             _c1EB:
>                 switch (_c1Es) {
>                     case 0x0: goto _c1EF;
>                     case 0x1: goto _c1EG;
>                     case 0x2: goto _c1EH;
>                     case 0x3: goto _c1EI;
>                     case 0x4: goto _c1EE;
>                 }

Regardless of the gcc bug, that sequence of ifs looks really dumb.  Can
we see the STG fragment that gives rise to this code?

Cheers,
	Simon


More information about the Cvs-ghc mailing list