[Bug target/101697] [11/12 regression] ICE compiling uClibc-ng for h8300-linux
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101697 Andrew Pinski changed: What|Removed |Added CC||mike at mnmoran dot org --- Comment #11 from Andrew Pinski --- *** Bug 108913 has been marked as a duplicate of this bug. ***
[Bug target/101697] [11/12 regression] ICE compiling uClibc-ng for h8300-linux
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101697 Andrew Pinski changed: What|Removed |Added Target Milestone|11.4|13.0 Resolution|--- |FIXED Status|ASSIGNED|RESOLVED --- Comment #10 from Andrew Pinski --- .
[Bug target/101697] [11/12 regression] ICE compiling uClibc-ng for h8300-linux
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101697 --- Comment #9 from Mikael Pettersson --- I can confirm that building the latest uClibc-ng for h8300 now succeeds with gcc master @ 4374c424a60777a7658050f0aeb1dcc9af915647.
[Bug target/101697] [11/12 regression] ICE compiling uClibc-ng for h8300-linux
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101697 Jeffrey A. Law changed: What|Removed |Added Summary|[11/12/13 regression] ICE |[11/12 regression] ICE |compiling uClibc-ng for |compiling uClibc-ng for |h8300-linux |h8300-linux --- Comment #8 from Jeffrey A. Law --- Fixed for gcc-13. No plans to backport.
[Bug target/101697] [11/12 regression] ICE compiling uClibc-ng for h8300-linux
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101697 Richard Biener changed: What|Removed |Added Target Milestone|11.3|11.4 --- Comment #5 from Richard Biener --- GCC 11.3 is being released, retargeting bugs to GCC 11.4.
[Bug target/101697] [11/12 regression] ICE compiling uClibc-ng for h8300-linux
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101697 Jeffrey A. Law changed: What|Removed |Added Priority|P3 |P4
[Bug target/101697] [11/12 regression] ICE compiling uClibc-ng for h8300-linux
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101697 Jeffrey A. Law changed: What|Removed |Added Ever confirmed|0 |1 Status|UNCONFIRMED |ASSIGNED Assignee|unassigned at gcc dot gnu.org |law at gcc dot gnu.org Last reconfirmed||2021-08-17 --- Comment #4 from Jeffrey A. Law --- I've managed to reproduce. It's possible I was missing the -fno-builtin on my command line. A much simplified testcase: struct gaih_servtuple { struct gaih_servtuple *next; }; int gaih_inet (const char *name, const void *req) { struct gaih_servtuple *st; int *tp; if (req) ++tp; struct gaih_servtuple **pst = while (1) { struct gaih_servtuple *newp; newp = __builtin_alloca (sizeof (struct gaih_servtuple)); frob (name, tp, req, newp); *pst = newp; pst = &(newp->next); tp++; } } We're fine up to and including IRA. (insn 20 18 22 5 (set (reg/f:SI 28) (reg/f:SI 7 sp)) "k.c":21:14 19 {*movsi} (nil)) (insn 22 20 23 5 (set (mem/f:SI (pre_dec:SI (reg/f:SI 7 sp)) [1 S4 A32]) (reg/f:SI 28)) "k.c":22:7 19 {*movsi} (expr_list:REG_ARGS_SIZE (const_int 4 [0x4]) (nil))) And IRA allocates hard reg #6 for pseudo #28, which is also fine. Reload reports: Reload 1: reload_in (SI) = (reg/f:SI 28) GENERAL_REGS, RELOAD_FOR_INPUT (opnum = 1) reload_in_reg: (reg/f:SI 28) reload_reg_rtx: (reg/f:SI 7 sp) Which is not good as replacing (reg 28) with (reg sp) is not valid. I haven't tried converting the H8 to LRA yet, which would be the ultimate solution if it worked. Ideally any port not converted to LRA ought to be flagged as deprecated for gcc-12 and dropped if not fixed by gcc-13.
[Bug target/101697] [11/12 regression] ICE compiling uClibc-ng for h8300-linux
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101697 --- Comment #3 from Mikael Pettersson --- As far as I can tell the problem is introduced by reload. With a gcc-11.2.0 cross, getaddrinfo.i.290r.ira has (insn 161 159 163 31 (set (reg/f:SI 185) (reg/f:SI 7 sp)) "libc/inet/getaddrinfo.c":465:13 13 {*movsi} (nil)) (insn 163 161 164 31 (set (mem/f:SI (pre_dec:SI (reg/f:SI 7 sp)) [3 S4 A32]) (reg/f:SI 185)) "libc/inet/getaddrinfo.c":466:11 13 {*movsi} (expr_list:REG_ARGS_SIZE (const_int 4 [0x4]) (nil))) these are adjacent. Then getaddrinfo.i.291r.reload has Reloads for insn # 161 Reload 0: reload_out (SI) = (reg/f:SI 185) NO_REGS, RELOAD_FOR_OUTPUT (opnum = 0), optional reload_out_reg: (reg/f:SI 185) Reloads for insn # 163 Reload 0: reload_out (SI) = (mem/f:SI (pre_dec:SI (reg/f:SI 7 sp)) [3 S4 A32]) NO_REGS, RELOAD_FOR_OUTPUT (opnum = 0), optional reload_out_reg: (mem/f:SI (pre_dec:SI (reg/f:SI 7 sp)) [3 S4 A32]) Reload 1: reload_in (SI) = (reg/f:SI 185) GENERAL_REGS, RELOAD_FOR_INPUT (opnum = 1) reload_in_reg: (reg/f:SI 185) reload_reg_rtx: (reg/f:SI 7 sp) and later (insn 161 159 995 31 (set (mem/c:SI (plus:SI (reg/f:SI 6 r6) (const_int -140 [0xff74])) [30 %sfp+-132 S4 A32]) (reg/f:SI 7 sp)) "libc/inet/getaddrinfo.c":465:13 13 {*movsi} (nil)) (insn 995 161 163 31 (set (reg/f:SI 7 sp) (mem/c:SI (plus:SI (reg/f:SI 6 r6) (const_int -140 [0xff74])) [30 %sfp+-132 S4 A32])) "libc/inet/getaddrinfo.c":466:11 13 {*movsi} (expr_list:REG_ARGS_SIZE (const_int 0 [0]) (nil))) (insn 163 995 164 31 (set (mem/f:SI (pre_dec:SI (reg/f:SI 7 sp)) [3 S4 A32]) (reg/f:SI 7 sp)) "libc/inet/getaddrinfo.c":466:11 13 {*movsi} (expr_list:REG_ARGS_SIZE (const_int 4 [0x4]) (nil))) It's strange you can't reproduce. My current build is literally: > mkdir objdir-binutils; cd objdir-binutils > /tmp/binutils-2.37/configure --target=h8300-unknown-linux-uclibc > --prefix=/tmp/cross-h8300 --with-sysroot=/tmp/cross-h8300 > make -jN > make install > cd .. > mkdir objdir-gcc; cd objdir-gcc > PATH=/tmp/cross-h8300/bin:/usr/bin /tmp/gcc-11.2.0/configure > --target=h8300-unknown-linux-uclibc --prefix=/tmp/cross-h8300 > --with-sysroot=/tmp/cross-h8300 --with-newlib --disable-libquadmath > --disable-libssp --disable-threads --disable-libatomic --disable-libgomp > --enable-languages=c --enable-checking=release > PATH=/tmp/cross-h8300/bin:/usr/bin make -jN > gcc/xgcc -Bgcc -fno-builtin -Os -S /tmp/getaddrinfo.i
[Bug target/101697] [11/12 regression] ICE compiling uClibc-ng for h8300-linux
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101697 --- Comment #2 from Jeffrey A. Law --- I can't reproduce this on the trunk or with the referenced git hashes. (insn 1444 1443 164 31 (parallel [ (set (mem/f:SI (pre_dec:SI (reg/f:SI 7 sp)) [3 S4 A32]) (reg/f:SI 7 sp)) (clobber (reg:CC 12 cc)) ]) "libc/inet/getaddrinfo.c":466:11 -1 (expr_list:REG_ARGS_SIZE (const_int 4 [0x4]) (nil))) I'm pretty sure this is ill-formed though. The register inside the auto-increment addressing mode isn't allowed to be used elsewhere in the same insn. In particular note that we have (pre_dec (reg sp)) and another reference to (reg sp) in the same insn. I would probably start by identifying when that happens in the dumps.
[Bug target/101697] [11/12 regression] ICE compiling uClibc-ng for h8300-linux
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101697 --- Comment #1 from Mikael Pettersson --- The ICE in gcc-11 started with: [f16897cb4b1468374d63b1a6b12d8b7be845874a] H8 cc0 conversion It changed from "unrecognizable insn" to "could not split insn" in gcc-12 with: [549d7f4310f6f8c2c64efcb6f3efcee99c9d9f4f] Fix split conditions in H8/300 port
[Bug target/101697] [11/12 regression] ICE compiling uClibc-ng for h8300-linux
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101697 Andrew Pinski changed: What|Removed |Added Target Milestone|--- |11.3 Keywords||ice-on-valid-code