[Bug target/101177] sh3: internal compiler error: Illegal instruction
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101177 --- Comment #13 from Oleg Endo --- (In reply to John Paul Adrian Glaubitz from comment #12) > > That was super-fast! Thanks a lot! Not really. ~2 years from patch to commit. Sorry about that.
[Bug target/101177] sh3: internal compiler error: Illegal instruction
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101177 --- Comment #12 from John Paul Adrian Glaubitz --- (In reply to Oleg Endo from comment #11) > (In reply to John Paul Adrian Glaubitz from comment #5) > > (In reply to Segher Boessenkool from comment #4) > > > (In reply to Harold Gutch from comment #1) > > > > I cannot claim to understand the details of this patch, but note that > > > > in the > > > > second part of the diff the condition gets inverted. > > > > > > Yes, that looks like a clear mistake. I don't know why I did that, > > > perhaps > > > at first I flipped the control flow there? Who knows. Sorry for it > > > anyway! > > > > Was this ever fixed? > > It should be now. That was super-fast! Thanks a lot!
[Bug target/101177] sh3: internal compiler error: Illegal instruction
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101177 Oleg Endo changed: What|Removed |Added Resolution|--- |FIXED Status|UNCONFIRMED |RESOLVED --- Comment #11 from Oleg Endo --- (In reply to John Paul Adrian Glaubitz from comment #5) > (In reply to Segher Boessenkool from comment #4) > > (In reply to Harold Gutch from comment #1) > > > I cannot claim to understand the details of this patch, but note that in > > > the > > > second part of the diff the condition gets inverted. > > > > Yes, that looks like a clear mistake. I don't know why I did that, perhaps > > at first I flipped the control flow there? Who knows. Sorry for it anyway! > > Was this ever fixed? It should be now.
[Bug target/101177] sh3: internal compiler error: Illegal instruction
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101177 --- Comment #10 from CVS Commits --- The releases/gcc-11 branch has been updated by Oleg Endo : https://gcc.gnu.org/g:e784ba28ae0214b02ae45734d5106ca421711a8a commit r11-11069-ge784ba28ae0214b02ae45734d5106ca421711a8a Author: Oleg Endo Date: Fri Oct 20 18:48:34 2023 +0900 SH: Fix PR 101177 Fix accidentally inverted comparison. gcc/ChangeLog: PR target/101177 * config/sh/sh.md (unnamed split pattern): Fix comparison of find_regno_note result.
[Bug target/101177] sh3: internal compiler error: Illegal instruction
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101177 --- Comment #9 from CVS Commits --- The releases/gcc-12 branch has been updated by Oleg Endo : https://gcc.gnu.org/g:21ce4f97b2c158778fbf96858e7e589ad648b3c8 commit r12-9932-g21ce4f97b2c158778fbf96858e7e589ad648b3c8 Author: Oleg Endo Date: Fri Oct 20 18:48:34 2023 +0900 SH: Fix PR 101177 Fix accidentally inverted comparison. gcc/ChangeLog: PR target/101177 * config/sh/sh.md (unnamed split pattern): Fix comparison of find_regno_note result.
[Bug target/101177] sh3: internal compiler error: Illegal instruction
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101177 --- Comment #8 from CVS Commits --- The releases/gcc-13 branch has been updated by Oleg Endo : https://gcc.gnu.org/g:3ce4e99303d01d348229cca22bf8d3dd63004e01 commit r13-7966-g3ce4e99303d01d348229cca22bf8d3dd63004e01 Author: Oleg Endo Date: Fri Oct 20 18:48:34 2023 +0900 SH: Fix PR 101177 Fix accidentally inverted comparison. gcc/ChangeLog: PR target/101177 * config/sh/sh.md (unnamed split pattern): Fix comparison of find_regno_note result.
[Bug target/101177] sh3: internal compiler error: Illegal instruction
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101177 --- Comment #7 from CVS Commits --- The master branch has been updated by Oleg Endo : https://gcc.gnu.org/g:1d0ca7ecd4f4dfef4145ad3a41fa0a72c8b19697 commit r14-4782-g1d0ca7ecd4f4dfef4145ad3a41fa0a72c8b19697 Author: Oleg Endo Date: Fri Oct 20 18:48:34 2023 +0900 SH: Fix PR 101177 Fix accidentally inverted comparison. gcc/ChangeLog: PR target/101177 * config/sh/sh.md (unnamed split pattern): Fix comparison of find_regno_note result.
[Bug target/101177] sh3: internal compiler error: Illegal instruction
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101177 --- Comment #6 from John Paul Adrian Glaubitz --- @Segher: In case it's trivial to fix, could you get this fixed or revert the patch?
[Bug target/101177] sh3: internal compiler error: Illegal instruction
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101177 John Paul Adrian Glaubitz changed: What|Removed |Added CC||glaubitz at physik dot fu-berlin.d ||e --- Comment #5 from John Paul Adrian Glaubitz --- (In reply to Segher Boessenkool from comment #4) > (In reply to Harold Gutch from comment #1) > > I cannot claim to understand the details of this patch, but note that in the > > second part of the diff the condition gets inverted. > > Yes, that looks like a clear mistake. I don't know why I did that, perhaps > at first I flipped the control flow there? Who knows. Sorry for it anyway! Was this ever fixed?
[Bug target/101177] sh3: internal compiler error: Illegal instruction
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101177 Segher Boessenkool changed: What|Removed |Added CC||segher at gcc dot gnu.org --- Comment #4 from Segher Boessenkool --- (In reply to Harold Gutch from comment #1) > I cannot claim to understand the details of this patch, but note that in the > second part of the diff the condition gets inverted. Yes, that looks like a clear mistake. I don't know why I did that, perhaps at first I flipped the control flow there? Who knows. Sorry for it anyway!
[Bug target/101177] sh3: internal compiler error: Illegal instruction
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101177 --- Comment #3 from Harold Gutch --- With my patch, the NetBSD/dreamcast build successfully reaches multiuser. Also, note that the rest of the commit looks very much like what the commit message described, but I don't see anything that might explain the inversion in the comparison, leading me to believe that this was a typo that managed to sneak in by accident.
[Bug target/101177] sh3: internal compiler error: Illegal instruction
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101177 --- Comment #2 from Harold Gutch --- Created attachment 51098 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51098=edit revert the change of condition
[Bug target/101177] sh3: internal compiler error: Illegal instruction
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101177 Harold Gutch changed: What|Removed |Added CC||gcc_bugzilla at foobar dot franken ||.de --- Comment #1 from Harold Gutch --- (In reply to Roland Illig from comment #0) > $ cat lex.c > int > lex_input(void); > > int > lex_character_constant(void); > > int > lex_character_constant(void) > { > int c = lex_input(); > if (c == 7) > return c; > c &= 255; > return c == 0 ? -1 : c; > } > > $ /home/rillig/builds/sh3-tools/bin/sh--netbsdelf-gcc --version > sh--netbsdelf-gcc (NetBSD nb1 20200907) 9.3.0 > Copyright (C) 2019 Free Software Foundation, Inc. > > $ /home/rillig/builds/sh3-tools/bin/sh--netbsdelf-gcc lex.c -O1 > sh--netbsdelf-gcc: internal compiler error: Illegal instruction signal > terminated program cc1 This is not specific to the NetBSD cross toolchain, this also happens with a vanilla GCC built on Linux, verified with both 9.3.0 and git head. I bisected this to commit 91f66e78cc141da77ff9e0e3c8519e1af3f26c07 , https://gcc.gnu.org/git/?p=gcc.git;a=blobdiff;f=gcc/config/sh/sh.md;h=e19e977087db4d5231f2276af53a42ee82bd50de;hp=2645fca47383c96571f4750033f893ad869e;hb=91f66e78cc141da77ff9e0e3c8519e1af3f26c07;hpb=8faa81184f856447084a9ee41a63fc4be6bca572 I cannot claim to understand the details of this patch, but note that in the second part of the diff the condition gets inverted. Take for this the simple case of SUBREG_P(reg) being false, then this changed from if (find_regno_note (curr_insn, REG_DEAD, REGNO (operands[0])) == NULL_RTX) to if (find_regno_note (curr_insn, REG_DEAD, REGNO (operands[0])) != NULL_RTX) After changing this back to "==", the test case passes for me again, and I can run a full build of NetBSD/Dreamcast (SH3). I have not verified however if the built system works correctly.