avr-gcc and avr-g++ are deprecated now.

Go To Last Post
147 posts / 0 new

Pages

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

Out of curiosity, and for comparison purposes, is there a repository somewhere with avr-gcc built from ALL of the major release of gcc after 5.4 (the version shipping from Microchip)?

Version 6.x, 7.x (Arduino is shipping 7.x), 8.x, 9.x. and 10.x ?

 

 

secondary is no significant regressions in applications (bootloader, libc, ...); westfw, the maintainer of Optiboot, has posted in this thread.

I don't really consider "the code is bigger now" to be a "regression" unless it's gratuitous and there is no way to way to work around it.

For example, with 4.8, Optiboot failed to fit in its 512 bytes because avr-gcc got more aggressive with inlining short functions (despite -Os), and I had to add "noinline" attributes to putch() and getch() and similar.

 

 

 

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

void

Last Edited: Wed. Dec 23, 2020 - 03:48 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

westfw wrote:
Out of curiosity, and for comparison purposes, is there a repository somewhere with avr-gcc built from ALL of the major release of gcc after 5.4 (the version shipping from Microchip)?

 

Well I know how to get them for windows and linux but you use Mac, right?

 

Anyway, I use the archives of Zak Kemble's blog (@abebeos also mentions it as reference) from the Wayback Machine

https://web.archive.org/web/*/https://blog.zakkemble.net/avr-gcc-builds/

 

If you go to different time periods, it's possible to get different versions of the avr-gcc toolchain. It's not a neat list, but it works.

 

Last Edited: Tue. Dec 15, 2020 - 01:39 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

void

Last Edited: Wed. Dec 23, 2020 - 03:49 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

abebeos wrote:
Not sure how the status/quality of clang is for avr.
status - no longer experimental, released

AVR LLVM released | AVR Freaks

 

"Dare to be naïve." - Buckminster Fuller

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

Yes gcc is full of holes but some are useful. Problem is, some programmers will rely on them working and then updating to a new avr-gcc version will break the code (in fact, just reveal holes already present).

 

Here is a small C++ example, it's kind of my pet issue cheeky

 

#include <stdint.h>
#define MMREGADDR 0x20

#define MMREG (*(volatile uint8_t*) MMREGADDR)

typedef struct
{
  volatile uint8_t data;
} port_t;

#define MMREG_s (*(port_t*) MMREGADDR)

// The following 2 lines should always generate errors, since they violate C++ standard regarding valid constant expressions
// (they include a reinterpret_cast, in fact 2: int -> pointer -> int)
constexpr uint16_t mmreg_addr = (uint16_t) &(MMREG_s.data);   // v5 compiles (AS7), v7 compiles (Arduino), v9, v10 fail
//constexpr uint16_t mmreg_addr = (uint16_t) &MMREG;              // v5 compiles (AS7), v7 fails (Arduino), v9, v10 fail

int main(void){
  return mmreg_addr;
}

Basically this is a cast from int to pointer and back to int. Even though the compiler actually knows this value at compile time and could use it as a constant expression, the C++ standard says it should pretend it doesn't and generate an error (I don't agree with the standard here, but hey, I hear these people are very smart so whatever they say must surely be right).

Only newer versions of avr-gcc do the check, version 7 currently used in the Arduino suite does the check only in some situations. It's quite a mess.

 

edit: link to live compiler (v5 and v9 only) https://godbolt.org/z/d9K4sY

Last Edited: Tue. Dec 15, 2020 - 03:01 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

El Tangas wrote:
It's quite a mess.

Well, you can of course blame the older versions of the compiler for accepting invalid code.

.

But the very problem is questionable C++ features like constexpr+reinterpret_cast and what is (not) allowed to do with them.

.

Or you could blame avr-libc for only supplying SFR accesses via dereferencing volatile pointers, but does not supply SFR addresses as (macros resolving to) scalars.

avrfreaks does not support Opera. Profile inactive.

Last Edited: Sat. Dec 19, 2020 - 11:09 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I guess I'm ranting because I've seen people using things like &PORTB as template arguments, because AS7 will accept that even though it's invalid code. I blame Microchip for still using avr-gcc v5 in their official toolchain when it has so many bugs.

Besides you added features like the optimized ISR prologue/epilogue to one of the v8 sub-versions, right? An  important feature IMO. Yet lots of people won't ever benefit from it because v5 ships with AS7 and v7 with Arduino.

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

El Tangas wrote:
Basically this is a cast from int to pointer and back to int. Even though the compiler actually knows this value at compile time and could use it as a constant expression, the C++ standard says it should pretend it doesn't and generate an error (I don't agree with the standard here, but hey, I hear these people are very smart so whatever they say must surely be right).
A useful extension occurs to me:

__builtin_const_expr(arg) is a constant expression if the compiler can evaluate it.

If an author is truly ambitious, 'tis a constant expression if the toolchain can evaluate it.

Moderation in all things. -- ancient proverb

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

void

 

Last Edited: Wed. Dec 23, 2020 - 03:49 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

abebeos wrote:

no way, dishwashing pays better

Exactly, we already commented earlier in this thread that the $7k reward could not possibly cover the work involved here. So basically only people very dedicated to the open software cause and to AVR would work here for a symbolic prize.

People in it for the money will quickly run out of motivation.

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

void

 

Last Edited: Wed. Dec 23, 2020 - 03:49 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I appreciate the effort; it was fun to spin the toolchain on one of my Linux machines; I hope you can get the bounty; it is probably lost otherwise.

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

The work is not that much the problem. Dealing with a mismanaged project, terrible infrastructure and rude ["co-workers and management"]

Sorry to have to tell you, but those sorts of problems are ALWAYS "part of the work."  :-)

 

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

void

Last Edited: Wed. Dec 23, 2020 - 03:50 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

void

Last Edited: Wed. Dec 23, 2020 - 03:50 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

void

Last Edited: Wed. Dec 23, 2020 - 03:50 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

El Tangas wrote:
Besides you added features like the optimized ISR prologue/epilogue to one of the v8 sub-versions,

It is in v8 mainline, see http://gcc.gnu.org/gcc-8/changes.html#avr

avrfreaks does not support Opera. Profile inactive.

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

void

Last Edited: Wed. Dec 23, 2020 - 03:50 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

abebeos wrote:
The work is not that much the problem. Dealing with a mismanaged project, terrible infrastructure and rude code-monkeys-in-a-position-of-power (those who see only code/patches, and not other kind of necessary efforts) is the motivation killer. I had so much momentum to continue this, but...

It's just a review https://gcc.gnu.org/ml/gcc-patches/2020-December/561757.html and nothing rude. It points out issues, asks questions and addresses parts that are wrong or overtly complicated (~30 lines where 1 line does it in ~100 places). And just the fact that you have spent some time on it is of no concern, what counts is what the patch does. Apart from the legal stuff, of course.
.
Your "I won't even change a blank" just shows that you don't know anything about it, presumably the only trigger is the bounty for which you set the goal to 13000$.
.
And just to make it clear: I do not blame the author for anything; the authors of either patch made clear that it is semi-working, incomplete, abandoned.
.
I don't even see what your contribution is, apart from dropping the stuff at gcc-patches@. Ok, you managed to build Binutils, GCC and found avr-libc and how to run the testsuite. So you have achieved milestone "Blinky". Congrats for that first essential step.
.
What you are writing is 80% complaints and rants, 10% how much work you put into it and 10% links to somewhere else, 0% about technical details or code.
.
Your split of the bounty into "2. get rid of cc0" and "3. introduce CCmode" is just not possible. And a bounty for "1. Me accomplished Blinky"? Come on.

avrfreaks does not support Opera. Profile inactive.

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

void

 

 

 

 

Last Edited: Wed. Dec 23, 2020 - 03:52 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

void

 

Last Edited: Wed. Dec 23, 2020 - 03:52 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

void

Last Edited: Wed. Dec 23, 2020 - 03:52 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

@abebos,

 

While I was (and a few others were, too) quite happy to assist you, I am disappointed in many of your responses.  So far the only evidence of any rudeness has been from you.

 

Irrespective of any work you may have done, and any contributions you may have made, mouthing off here (or anywhere else, for that matter) will not buy you a lick of respect, but only served to undermine any good you may have done.  Indeed, that is one of the most recognisable marks of an 'amateur'.

 

 

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

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

void

Last Edited: Wed. Dec 23, 2020 - 05:41 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

void

Last Edited: Wed. Dec 23, 2020 - 05:41 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Ababeos - what on earth is the point of deleting almost every one of your posts in this thread? Apart from anything else, it renders the entire thread pointless for anyone reading at a later date, and to be blunt, it's downright rude.

 

Neil

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


barnacle wrote:
what on earth is the point of deleting almost every one of your posts in this thread?
Not just here.  His github project is gone as well:

https://github.com/abebeos/avr-gnu

 

 

 

barnacle wrote:
to be blunt, it's downright rude.
I can think of a few other adjectives...

 

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

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

What do we think? He didn't get the bounty?

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#2 Hardware Problem? Read AVR042.

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

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

Brian Fairchild wrote:
What do we think? He didn't get the bounty?

 

I would guess... no.

 

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

Mostly for my sanity and reference:

 

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92729

 

https://github.com/saaadhu/gcc-avr-cc0/issues/2

 

at some point Georg told people on the GCC list who abebeos was

 

https://gcc.gnu.org/pipermail/gcc-patches/2020-December/561762.html

 

Brian Fairchild wrote:
What do we think?

 

I don't know what to think; if it is drama, I don't like drama, but maybe it is more like a Monty Python sketch.

 

 

 

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

"Dare to be naïve." - Buckminster Fuller

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

What was the status here ?

 

Did these patches get accepted , and avr-gcc "survived" or ?

https://gcc.gnu.org/pipermail/gc...

 

/Bingo

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

Bingo600 wrote:
What was the status here ?
GCC 11 may be imminent.

Bingo600 wrote:
Did these patches get accepted ,...
Appears to have missed the window.

Bingo600 wrote:
... and avr-gcc "survived" or ?
indecision

edit3 :

12.0?

 


GCC 11.0.1 Status Report (2021-04-09)

 

AVR CC0 conversion

https://gcc.gnu.org/git/?p=gcc.git;a=tree;f=gcc/config/avr;h=e116816421b2f63c8b923601bfff82bb8ff9ed8e;hb=HEAD

 

edit :
GCC 11.0.0 Status Report (2021-01-14), Stage 3 closes Jan 16th

 

edit2 : bottom of

92729 – [avr] Convert the backend to MODE_CC so it can be kept in future releases

 

"Dare to be naïve." - Buckminster Fuller

Last Edited: Sun. Apr 18, 2021 - 08:06 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

GCC 11.1 is definitely imminent.

GCC 12.0 is open.

 

GCC 11.0.1 Status Report (2021-04-20)

GCC 12.0.0 Status Report (2021-04-20)

 

"Dare to be naïve." - Buckminster Fuller

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

"Dare to be naïve." - Buckminster Fuller

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

"Dare to be naïve." - Buckminster Fuller

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

gchapman wrote:
AVR CC0 conversion patch applied into trunk

https://github.com/gcc-mirror/gcc/commit/3ba781d3b5c8efadb60866c9743b657e8f0eb222

abovelink wrote:
1. Automatic clobber of REG_CC in inline asm statements, via

TARGET_MD_ASM_ADJUST hook.
Does this mean that SREG will be presumed clobbered by inline assembly?

IIRC that was the case before CC) conversion.

I'd thought that that was one of the things that would change with the conversion.

Moderation in all things. -- ancient proverb

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

skeeve wrote:

gchapman wrote:
AVR CC0 conversion patch applied into trunk

https://github.com/gcc-mirror/gcc/commit/3ba781d3b5c8efadb60866c9743b657e8f0eb222

abovelink wrote:
1. Automatic clobber of REG_CC in inline asm statements, via

TARGET_MD_ASM_ADJUST hook.
Does this mean that SREG will be presumed clobbered by inline assembly?

IIRC that was the case before CC) conversion.

I'd thought that that was one of the things that would change with the conversion.

 

The problem is if you do clobber SREG in your asm() then I think you'd need to explicitly list "cc" in the clobbers, and there is probably lots of existing code that does not do that.

So, in any case, I'm guessing it would be good practice to list "cc" in your clobbers if you do ping SREG.

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

MattRW wrote:
The problem is if you do clobber SREG in your asm() then I think you'd need to explicitly list "cc" in the clobbers, and there is probably lots of existing code that does not do that.

So, in any case, I'm guessing it would be good practice to list "cc" in your clobbers if you do ping SREG.

That had been my expectation.

My understanding was that avr-gcc's implicit clobber of SREG was an

artifact of implementation and that it would go away after the conversion.

My problem is interpreting this statement:

Quote:
1. Automatic clobber of REG_CC in inline asm statements, via

TARGET_MD_ASM_ADJUST hook.
Emphasis added.

If avr-gcc no longer implicitly clobbers SREG,

some help for legacy code might be in order.

Perhaps add nocc as a possible clobber item.

It would not do anything except stifle a warning that would

be issued if the clobber list contained neither cc nor nocc.

Moderation in all things. -- ancient proverb

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

I did that to avoid breaking existing inline asm code that does not have an explicit clobber for cc. It was also the easiest option to implement :)

 

Would a command line option, say -mclobber-regcc-inlineasm, to turn implicit clobbering on/off, work better?

Regards

Senthil

 

blog | website

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

I received a ping on the bounty payout today.   It looks legit.  Thanks for the work , saaadu.   Here is the link: gcc issue on avr CCmode

 

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

saaadhu wrote:

I did that to avoid breaking existing inline asm code that does not have an explicit clobber for cc. It was also the easiest option to implement :)

 

Would a command line option, say -mclobber-regcc-inlineasm, to turn implicit clobbering on/off, work better?

 

I would suggest maybe -mclobber-inline-asm-cc=option where option is "none" "all", and, in the future -- maybe, something like "t", "i" "x".  So in the case future effort goes to break out multiple cc modes for T bit, I bit and the rest.  What do you think?

Last Edited: Sat. May 1, 2021 - 02:06 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

https://github.com/gcc-mirror/gcc/blob/master/gcc/ChangeLog

...

 

2021-04-30 Senthil Kumar Selvaraj <saaadhu@gcc.gnu.org>

 

* config/avr/avr.md: Adjust peepholes to match and

generate parallels with clobber of REG_CC.

(mov<mode>_insn): Rename to mov<mode>_insn_split.

(*mov<mode>_insn): Rename to mov<mode>_insn.

 

...

 

"Dare to be naïve." - Buckminster Fuller

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

saaadhu wrote:
Would a command line option, say -mclobber-regcc-inlineasm, to turn implicit clobbering on/off, work better?
I'd suggest four command line possibilities for the default: clobber with or without warning and don't not clobber with or without warning.

The option warning and no clobber would require a new clobber item to stifle the warning. nocc seems an obvious name.

 

As noted, it might be useful to break out the individual bits, especially T and I.

They are not affected by arithmetic.

Moderation in all things. -- ancient proverb

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

GCC patch 5-May'21 :

[committed] Get avr building again

 

"Dare to be naïve." - Buckminster Fuller

Pages