Jump to content
 
w4gns

xc8 gcc clang

Recommended Posts

Howdy folks

 I was just browsing my xc8 folder and of course in the avr folder I found gcc, which I expected. But when I went through the pic folder I found no gcc which I expected, but I did find clang. I was under the impression xc8 used gcc for pic's also. Has there been a change or am I simply that forgetful.

 

  • Helpful 1

Share this post


Link to post
Share on other sites

XC8 has never used GCC for PICs. XC16 and XC32 are both based on gcc but XC8 was always based (and is still) on the HiTech compiler which Microchip purchased back in 2009. 

The HiTech compiler had it's own custom front-end and back-end, until v2.x. The most significant change when moving to v2 of XC8 is that the front-end of the compiler was replaced by Clang. This was a great improvement as it brought C99 to the compiler in a much more comprehensive way.  The back-end is still the HiTech compiler back-end.

For backwards compatability you can still set the compiler to C90 mode in which case it will run the old front-end for you to give you more consistent behavior to what you had in the past, but I would really recommend to everyone to use the shiny new Clang based front-end. 

On a different note the support for AVR in XC8 is based on GCC again, so you should as you say find gcc in there.

Share this post


Link to post
Share on other sites

One more thing to note! The Clang implementation comes with a new standard library implementation which is not nearly as optimized as the HiTech version, so expect your code to be quite a bit bigger! I think we have seen bloat of at least 10% when we tested this, but of course this depends a whole lot on what you are doing exactly.

Share this post


Link to post
Share on other sites

Anyone here using SDCC? I tried xc8 (free version) but the IDE is so slow that it is unusable and I got the impression the generated code is quite bloated..So now I use SDCC in combination with cmake

Share this post


Link to post
Share on other sites

If you are using cmake why not use xc8 with that and avoid the IDE all together?

The pro version is pretty good, and the free version is good enough to prove concepts and evaluate with.

Besides you can get an evaluation license for the pro version either way...

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


 


×
×
  • Create New...