avr-gcc explorer

Go To Last Post
18 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Just put out avr-gcc.senthilthecoder.com - an interactive environment that lets you see code generated from a bunch of Atmel compilers and FSF trunk.

 

I ran into Matt Godbolt's compiler explorer a while back, and wanted something like that for avr - the version he provides is ancient. I tried something similar before -  but his was way better. In particular, the option to view code generated by different toolchain versions side by side, with color coding for source line mapping, was irresistible.

 

He's graciously put the source for the website out on github, so I took that, tweaked it a bit, downloaded and plugged in a few Atmel toolchains, setup a cron job to build and plugin FSF trunk, and hosted it on my VPS. Was planning to build and plugin gcc-5 and gcc-6 for avr too, but disk space is tight.

 

Hope you guys like it

Regards

Senthil

 

blog | website

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

My only niggle with that is that it eats "Ctrl-D" ;-)

 

(so to bookmark it you have to use the actual bookmark icon on Firefox's toolbar).

 

BTW am I the only one to who the numbers 3.2.3, 3.4.5 and 3.5.4 mean absolutely nothing? I tend to think of GCC version in terms of the version number of the gcc itself. Things like 4.8.1, 4.9.2 etc.

 

Also it's kind of a shame that the compiler options don't default to the same as for a "standard" AS7 project. As there's no -Os or -mmcu given the default code output is atrocious code for a micro that has no MUL. At least the options you give do appear to be "sticky" (presumably stored in a cookie).

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:

BTW am I the only one to who the numbers 3.2.3, 3.4.5 and 3.5.4 mean absolutely nothing? I tend to think of GCC version in terms of the version number of the gcc itself. Things like 4.8.1, 4.9.2 etc.

 

I'll add the gcc versions to those as well, but those version numbers let people see how a newer Atmel toolchain release compares against an older one. IIRC, 3.5.1 to 3.5.4 are all based on gcc 4.9.2, with increasing number of backports.

 

clawson wrote:

Also it's kind of a shame that the compiler options don't default to the same as for a "standard" AS7 project. As there's no -Os or -mmcu given the default code output is atrocious code for a micro that has no MUL. At least the options you give do appear to be "sticky" (presumably stored in a cookie).

Should be easy to add those. And yes, the options stick around until you clear the cache.

 

Regards

Senthil

 

blog | website

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Added gcc version numbers to the Atmel toolchains, and am now building and plugging in gcc-5-branch and gcc-6-branch daily too.

Regards

Senthil

 

blog | website

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I love the way you can use -Ox and instantly see the effect on any particular optimisation level but something weird I never knew. If you just type -O without any parameter I guess I always assumed that would be taken as -O0 but clearly not.

 

BTW what is "Intel" on the toolbar for?

Last Edited: Mon. Oct 24, 2016 - 09:20 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:

I love the way you can use -Ox and instantly see the effect on any particular optimisation level but something weird I never knew. If you just type -O without any parameter I guess I always assumed that would be taken as -O0 but clearly not.

 

Yeah, -O is -O1 (https://gcc.gnu.org/onlinedocs/g...)

 

clawson wrote:

BTW what is "Intel" on the toolbar for?

 

Intel assembly syntax, but I can't click on it either :)

Regards

Senthil

 

blog | website

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Just realized it can handle #including URLs, like this

Regards

Senthil

 

blog | website

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Cool!

:: Morten

 

(yes, I work for Microchip, yes, I do this in my spare time, now stop sending PMs)

 

The postings on this site are my own and do not represent Microchip’s positions, strategies, or opinions.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Cool!

 

[EDIT] Reminds me of Knuths famous "Structured Programming with go to Statements" article, chapter "Program Manipulation Systems".

The programmer using such a system will write his beautifully-structured, but possibly inefficient, program P; then he will inter actively specify transformations that make it efficient.

Last Edited: Mon. Oct 24, 2016 - 12:39 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Been watching some of the presentations from CppCon 2016 lately, and C++ for embedded seems to be getting there. Especially 

was interesting (of the ones I've seen until now).

:: Morten

 

(yes, I work for Microchip, yes, I do this in my spare time, now stop sending PMs)

 

The postings on this site are my own and do not represent Microchip’s positions, strategies, or opinions.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

[without seeing those lengthy videos - maybe in the evening] no, C++ is just on the opposite side, making source more abstract and less connected to the outcome.

 

Knuth was talking about the developer seeing directly the result of his actions, allowing to (micro)optimize him interactively. This is the merit I see in Senthil's tool.

 

JW

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I would like C++ support..

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

OP's contact details are on his website - linked in #1 - in case he's still working on this after 5 years ...

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Doesn't everyone just use Godbolt anyway these days?

 

https://godbolt.org/

 

Senthil even mentioned this in #1 though at that time the AVR support may not have been maintained - it is now.

Last Edited: Mon. Sep 13, 2021 - 01:12 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have been, and wanted to use it again earlier today, but alas, no avr compilers to choose from any longer..

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


hooverphonique wrote:
no avr compilers to choose from any longer..

Really?

“Everyone knows that debugging is twice as hard as writing a program in the first place. So if you're as clever as you can be when you write it, how will you ever debug it?” - Brian W. Kernighan

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Really? +1

 

To verify the link I gave above I went to the site and verified it had support for both AVR C and C++ compilers. Wonder why you're not seeing that? 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Heisen wrote:

hooverphonique wrote:
no avr compilers to choose from any longer..

Really?

That's weird - in the compiler window that's open when I enter the site, there is no AVR option, but if I close it, and open a new compiler window, AVR is there... blush