Chris Lattner wrote:>I think that we should switch to C constants in this case. Can you try >#include <math.h> and use HUGE_VAL instead? >It works: [finna at coplin11 ~/test]$ cat tst.cpp #include <limits> #include <iostream> #include <math.h> int main() { std::cerr << std::numeric_limits<float>::infinity() << "\n"; std::cerr << HUGE_VAL << "\n"; } [finna at coplin11 ~/test]$ g++ tst.cpp [finna at coplin11 ~/test]$ ./a.out 0 inf [finna at coplin11 ~/test]$ But making the consequential changes in LLVM seems trickier. Do you plan to correct it in CVS, or is there a path I can follow to fix it myself on my own installation ? Best regard /Finn
On Thu, May 06, 2004 at 04:06:27PM +0200, Finn S Andersen wrote:> Chris Lattner wrote: > > >I think that we should switch to C constants in this case. Can you try > >#include <math.h> and use HUGE_VAL instead? > > > It works: > > [finna at coplin11 ~/test]$ cat tst.cpp > #include <limits> > #include <iostream> > #include <math.h> > int main() { > std::cerr << std::numeric_limits<float>::infinity() << "\n"; > std::cerr << HUGE_VAL << "\n"; > } > [finna at coplin11 ~/test]$ g++ tst.cpp > [finna at coplin11 ~/test]$ ./a.out > 0 > inf > [finna at coplin11 ~/test]$ > > But making the consequential changes in LLVM seems trickier. > Do you plan to correct it in CVS, or is there a path I can follow > to fix it myself on my own installation ?The easy way to do it in your area is to replace all occurences of std::numeric_limits<float>::infinity() with HUGE_VAL. The only two files that use std::numeric_limits<float>::infinity() are lib/CodeGen/RegAllocLinearScan.cpp and lib/CodeGen/LiveIntervals.cpp. As for CVS, I am not sure this should be fixed because there is really no LLVM bug here :-) -- Alkis
Alkis Evlogimenos wrote:>As for CVS, I am not sure this should be fixed because there is >really no LLVM bug here :-) > > >No, you are right. But perhaps it is worth it to mention the problem somewhere in the documentation, because there appear to be many installations with this problem (I've found 3: my home installation, my work and the nearest university), and it is tricky unless you know where to look. Thank you all very much for your assistance. Best regards, /Finn
On Thu, 6 May 2004, Alkis Evlogimenos wrote:> > But making the consequential changes in LLVM seems trickier. > > Do you plan to correct it in CVS, or is there a path I can follow > > to fix it myself on my own installation ? > > The easy way to do it in your area is to replace all occurences of > std::numeric_limits<float>::infinity() with HUGE_VAL. The only two files > that use std::numeric_limits<float>::infinity() are > lib/CodeGen/RegAllocLinearScan.cpp and lib/CodeGen/LiveIntervals.cpp. > > As for CVS, I am not sure this should be fixed because there is > really no LLVM bug here :-)While this is not an LLVM bug, if Finn has run into it, other people probably will too. I've fixed it in CVS: if you update llvm/lib/CodeGen and rebuild, hopefully linscan will magically work for Finn now. :) -Chris