Closed SpenceKonde closed 1 year ago
I belive this is caused by the asm sections being inlined instead of kept separate, That causes there to be two copies of the same label in the generated assembly. That is illegal, and so the assembler cannot continue.
This bug impacts both DxC and mTC, and needs to be fixed ASAP.
There are likely a large number of other places where this can crop up as well. I will need to read up on the extensive (hah! One single sparsely worded webpage is all we fucking get, last updated when dinosaurs roamed the earth) to try to figure out how to solve this, but I need to get new versions of both cores out ASAP now to fix this issue and the fact that I broke analogWrite on the majority of pins on DxC in the last release
Ugh.I don't really understand what the compiler is turning it into, but I can't readily get human processable semi-compiled code out because of LTO. The USART code is full of painstakingly hand optimized naked ASM that executes within interrupt context - I can't tell why it's duplicating that label, but the fact that it is almost inescapably means it's generating less-optimal code than -Os does in that part of the program.
I can give no ETA on fixing it, nd generally I don't feel that it would be worth the amount of time it would take to fix because I have to manually flip a whole bunch of switches, putting the core into a state where none of the output it generates is any good - at which point the issue might well no longer manifest at all. This has time sink written all over it and I don't have time to sink. Use -Os. It usually doesn't generate code markedly slower. The optimizer on avr-gcc isn't very good at it's job, quite frankly, and every later version of avr-gcc has been getting worse or not changing.
If I didn't actually want to have the optimization menu there for my own testing purposes, I would totally just pull the optimization level menu out. It's worth the half hour it took to put in. It's not work several days of debugging effort.
Yeah I think I'm just gonna pull any options that cause compile failures out of the menu, and that might mean the whole menu goes away, until I learn how to fix this
Discussed in https://github.com/SpenceKonde/megaTinyCore/discussions/915