Hi Arushi,> I got this from C code compiled by llvm-gcc. > > There is a consistent prototype for the function > > TypHandle Cyclotomic ( hdRes, n, m ) > TypHandle hdRes; > long n, m; > > the call looks as follows, > hdI = ProdCyc( hdI, Cyclotomic( HdResult, n, 1 ) );I bet the call occurs before the function is defined. In this case C treats the callee as being a varargs function (...) of the kind you see in your IR. Ciao, Duncan.> > which is basically > > Cyclotomic( HdResult, n, 1 ); > > The problem is the fact that it interprets 1 as an int32 instead of an int64. > And later converts it by assuming an unsigned to unsigned cast. > > Arushi
On Wed, Apr 6, 2011 at 8:35 AM, Duncan Sands <baldrick at free.fr> wrote:> Hi Arushi, > > > I got this from C code compiled by llvm-gcc. >> >> There is a consistent prototype for the function >> >> TypHandle Cyclotomic ( hdRes, n, m ) >> TypHandle hdRes; >> long n, m; >> >> the call looks as follows, >> hdI = ProdCyc( hdI, Cyclotomic( HdResult, n, 1 ) ); >> > > I bet the call occurs before the function is defined. In this case C > treats > the callee as being a varargs function (...) of the kind you see in your > IR. >Unfortunately that is't true either :( Also, the calls which do not pass a constant int, do not get the cast on the function.> > Ciao, Duncan. > > > >> which is basically >> >> Cyclotomic( HdResult, n, 1 ); >> >> The problem is the fact that it interprets 1 as an int32 instead of an >> int64. >> And later converts it by assuming an unsigned to unsigned cast. >> >> Arushi >> > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110406/ee912fd7/attachment.html>
Hi Arushi,> On Wed, Apr 6, 2011 at 8:35 AM, Duncan Sands <baldrick at free.fr > <mailto:baldrick at free.fr>> wrote: > > Hi Arushi, > > > I got this from C code compiled by llvm-gcc. > > There is a consistent prototype for the function > > TypHandle Cyclotomic ( hdRes, n, m ) > TypHandle hdRes; > long n, m; > > the call looks as follows, > hdI = ProdCyc( hdI, Cyclotomic( HdResult, n, 1 ) ); > > > I bet the call occurs before the function is defined. In this case C treats > the callee as being a varargs function (...) of the kind you see in your IR. > > > Unfortunately that is't true either :(something along these lines is clearly occurring. I suggest you open a bug report with preprocessed source.> Also, the calls which do not pass a constant int, do not get the cast on the > function.Probably because they have a type, which the compiler can use, while a constant like "1" gets a default type like i32. Ciao, Duncan.> > > Ciao, Duncan. > > > > which is basically > > Cyclotomic( HdResult, n, 1 ); > > The problem is the fact that it interprets 1 as an int32 instead of an > int64. > And later converts it by assuming an unsigned to unsigned cast. > > Arushi > > >