[LLVMdev] [LLVMDev] trouble building gcc-frontend from source

Gautam Sewani gautamcool88 at gmail.com
Fri Mar 13 22:45:30 PDT 2009


On Fri, Mar 13, 2009 at 8:09 PM, John Criswell <criswell at cs.uiuc.edu> wrote:
> Gautam Sewani wrote:
>> On Fri, Mar 13, 2009 at 2:38 PM, Duncan Sands <baldrick at free.fr> wrote:
>>
>>> Hi, the versions of llvm-gcc and llvm you are using are
>>> not synchronized.  Probably one is from subversion while
>>> the other is not.
>>>
> I've run into this, too.  The problem is that the inliner pass uses a 30
> bit integer to store the inline cost; the code that calculates the
> inline cost generates a cost that is too large, and so you hit the
> assertion.
>
> I haven't yet distilled a test case for this yet (had some problems with
> bugpoint for some mysterious reason), but I do have a work-around: go
> into include/llvm/Transforms/Utils/InlineCost.h and make the following
> change:
>
>
> Index: InlineCost.h
> ===================================================================
> --- InlineCost.h        (revision 66848)
> +++ InlineCost.h        (working copy)
> @@ -37,8 +37,13 @@
>       Never
>     };
>
> +#if 0
>     int Cost : 30;
>     unsigned Type :  2;
> +#else
> +    int Cost;
> +    unsigned Type :  2;
> +#endif
>
>     InlineCost(int C, int T) : Cost(C), Type(T) {
>       assert(Cost == C && "Cost exceeds InlineCost precision");
>
> Basically, you're changing the inline cost variable from 30 to 32 bits.
> After that, do a RELEASE build of LLVM and retry building llvm-gcc.
>
> -- John T.
>

That worked like a charm. Thanks a lot!

Gautam



More information about the llvm-dev mailing list