#16 compiling with pgcc (solved)

closed-accepted
nobody
None
1
2003-08-25
2001-04-25
No

After compliling glide3 with pgcc 2.95.2.1 and the default CNODEBUG flags (-O6 -m486 -fomit-frame-pointer -funroll-loops -fexpensive-optimizations -ffast-math -DBIG_OPT) the generated libglide3 did not work, while the same CVS snapshot worked fine when I compiled it with gcc 2.91.66 (egcs-1.1.2).

To be able to get a working libglide when compiling with pgcc 2.95.2.1 I had to change CNODEBUG in swlibs/include/make/3dfx.[linux.]mak to:

-O -m486 -fomit-frame-pointer -funroll-loops -ffast-math

I also had to modify GLIDE_DEBUG_GCFLAGS (to -O -m486) and GLIDE_DEBUG_GDEFS (to -fomit-frame-pointer -funroll-loops -ffast-math) in swlibs/include/make/makefile.autoconf.bottom.

Why -O ?

Well, I tried -O3 and -O2, but even without -fomit-frame-pointer, -funroll-loops and -ffast-math I only got a working library with -O.
Because we are not optimizing with -O3 or higher I removed -DBIG_OPT.

The library also did not work when I specifed -fexpensive-optimizations, independent of which -O level I used, so I removed it.

My friend got the same problem on his system with pgcc 2.95.3 (pgcc 2.95.2.1 is newer than 2.95.3).
For him it also only helped to replace -O6 with -O and to remove -DBIG_OPT and -fexpensive-optimizations.

Yes, I know, this is not really a bug.
And yep, it is not your fault, it is pgcc's fault.
Oh, and I know, it is not recommended to use pgcc ...

But would it be possible to check for the gcc version and to use different compiler flags when detecting pgcc, or to "warn" the users in the documentation ?

Discussion

  • Daniel Borca

    Daniel Borca - 2003-08-25
    • priority: 5 --> 1
    • status: open --> closed-accepted
     
  • Daniel Borca

    Daniel Borca - 2003-08-25

    Logged In: YES
    user_id=718668

    Okidok! Tis a compiler bug! We don't bother since most of us
    are using gcc 3.x now!

     

Log in to post a comment.