Created attachment 804511 [details, diff] avr-gcc-bug-105753_1.patch Upstream bug: https://gcc.gnu.org/bugzilla//show_bug.cgi?id=105753 Patch for fix suggested in that bug's Comment 1 attached - seems to work for me, although I don't understand nearly enough about compiler internals to know what precisely it does. I don't know which is the first release of cross-avr/gcc series affected by this issue, I just stumbled across it today - upstream bug is 3.5 months old though, the commit it blames is 4.5 months old, and one commenter says it may affect releases as old as 12.1. I have a short (~20 line) bit of (Arduino) test code where changing a char to an int will trigger the bug, and changing it back will no longer trigger the bug at https://gist.github.com/triffid/bd72429605b810ca30e54ac8b26624a6 if anyone's curious - the code won't actually run though because it skips a bunch of setup and feeds a method an uninitialized instance of its own class for brevity of demonstrating the compiler bug.
I have posted the attached patch to the upstream bug and confirmed that it appears to fix the issue.
Will be in today's 13 snapshot. Thank you!
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8cba73661e286989eae65f5b1c26dbc2eb899568 commit 8cba73661e286989eae65f5b1c26dbc2eb899568 Author: Sam James <sam@gentoo.org> AuthorDate: 2023-05-28 16:01:43 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2023-05-28 16:01:43 +0000 sys-devel/gcc: keyword 13.1.1_p20230527 Closes: https://bugs.gentoo.org/869536 Closes: https://bugs.gentoo.org/905818 Signed-off-by: Sam James <sam@gentoo.org> sys-devel/gcc/gcc-13.1.1_p20230527.ebuild | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)