OpenBSD Journal

Portable C Compiler 1.0 Branched!

Contributed by jason on from the pretty-cool-compiler dept.

Michael Dexter writes in with news about the PCC project:

Thanks to the hard work of Anders "Ragge" Magnusson and his team plus the help of donors from around the world, the Portable C Compiler is now ready for final beta testing in preparation for its 1.0 release.

"This is the beta of the first release of pcc since almost forever."

Please download it, put it through its paces and report any bugs you encounter along the way!

(Comments are closed)


Comments
  1. By Peter J. Philipp (pjp) pjp@solarscale.de on http://centroid.eu

    I downloaded it and compiled some of my programs with it. It compiles a binary. Compared to gcc the binary is a bit larger, but the compilation is faster. I compared the number of NOP's with objdump from both binaries and the gcc had more NOP's in it. In conclusion, is it fair to say that when executed pcc binaries are a bit slower than gcc? I guess freedom has a price.

    Comments
    1. By Thomas Pfaff (tpfaff) on http://www.tp76.info

      "This is the beta of the first release of pcc since almost forever."

      Maybe you missed that part. I can't blame you. It was pretty well hidden in the quoted text.

    2. By phessler (phessler) on http://theapt.org

      > I downloaded it and compiled some of my programs with it. It compiles a binary. Compared to gcc the binary is a bit larger, but the compilation is faster. I compared the number of NOP's with objdump from both binaries and the gcc had more NOP's in it. In conclusion, is it fair to say that when executed pcc binaries are a bit slower than gcc? I guess freedom has a price.

      you guess that pcc binaries are slower, because gcc has more NOPs in it? did you try, I dunno, actually running a pcc binary?

      Comments
      1. By Peter J. Philipp (pjp) on http://centroid.eu

        > you guess that pcc binaries are slower, because gcc has more NOPs in it? did you try, I dunno, actually running a pcc binary?

        Aside from the NOPs the pcc binary is larger, even when stripped. Theoretically then there should be more instructions in the binary, that's all I'm getting at.

        -peter

        Comments
        1. By Daniel Gracia (paladdin) on http://www.alpuntodesal.com

          > > you guess that pcc binaries are slower, because gcc has more NOPs in it? did you try, I dunno, actually running a pcc binary?
          >
          > Aside from the NOPs the pcc binary is larger, even when stripped. Theoretically then there should be more instructions in the binary, that's all I'm getting at.
          >
          > -peter

          I catch your point, but you should consider that every single i386/amd64 instruction can take an indeterminate number of processor cycles, so guessing a program speed in a CISC processor as a function of the number of instructions it has is a poor approach.

          Not saying pcc is faster/slower than gcc. In fact, aside all of this size vs speed nonsense conversation, I would expect pcc being a little slower as it's in beta and doesn't have a so fancy optimizer as gcc -and very proud of it, that bunch of hacks!-.

        2. By Otto Moerbeek (otto) on http://www.drijf.net

          > > you guess that pcc binaries are slower, because gcc has more NOPs in it? did you try, I dunno, actually running a pcc binary?
          >
          > Aside from the NOPs the pcc binary is larger, even when stripped. Theoretically then there should be more instructions in the binary, that's all I'm getting at.
          >
          > -peter


          More instructions does not imply slower or faster in any way. A lot of instructions in a program are executed multiple times, and others not at all.

        3. By Andy Crichton (andyc) on

          Are there any differences in the security side here (with regards stack randomisation, canaries etc..) ?

          Comments
          1. By Janne Johansson (jj) on http://www.inet6.se

            > Are there any differences in the security side here (with regards stack randomisation, canaries etc..) ?


            Yes, pcc has none, or at least less of these kinds of features. And I'm sure it will produce worse code in most cases, but this is all besides the point right now. If it allows you to "make build" in 30 minutes instead of 60, it wont matter if /bin/ls got 1% bigger or slower, it means devs can run "make build" twice as often and test more code in the same day.

            Seeing as the number of half-supported platforms exploded in the last few months on the pcc mail list, it must be easy to port this to other architectures, which also it promising.

            Comments
            1. By Venture37 (venture37) on http://www.geeklan.co.uk

              > Yes, pcc has none, or at least less of these kinds of features. And I'm sure it will produce worse code in most cases, but this is all besides the point right now. If it allows you to "make build" in 30 minutes instead of 60, it wont matter if /bin/ls got 1% bigger or slower, it means devs can run "make build" twice as often and test more code in the same day.
              >
              > Seeing as the number of half-supported platforms exploded in the last few months on the pcc mail list, it must be easy to port this to other architectures, which also it promising.


              great reply :)

Credits

Copyright © - Daniel Hartmeier. All rights reserved. Articles and comments are copyright their respective authors, submission implies license to publish on this web site. Contents of the archive prior to as well as images and HTML templates were copied from the fabulous original deadly.org with Jose's and Jim's kind permission. This journal runs as CGI with httpd(8) on OpenBSD, the source code is BSD licensed. undeadly \Un*dead"ly\, a. Not subject to death; immortal. [Obs.]