[Bug target/50928] m32c ICE building RTEMS
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50928 Eric Gallager changed: What|Removed |Added Status|WAITING |RESOLVED Resolution|--- |FIXED --- Comment #21 from Eric Gallager --- (In reply to Joel Sherrill from comment #20) > I filed this in 2011 and we dropped RTEMS support for the m32c last year for > our next release. If you all think it is fixed, please feel free to close it. OK.
[Bug target/50928] m32c ICE building RTEMS
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50928 --- Comment #20 from Joel Sherrill --- I filed this in 2011 and we dropped RTEMS support for the m32c last year for our next release. If you all think it is fixed, please feel free to close it.
[Bug target/50928] m32c ICE building RTEMS
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50928 Eric Gallager changed: What|Removed |Added Status|UNCONFIRMED |WAITING Last reconfirmed||2019-02-19 Ever confirmed|0 |1 --- Comment #19 from Eric Gallager --- (In reply to Martin Liška from comment #18) > Can the bug be marked as resolved? WAITING on a reply
[Bug target/50928] m32c ICE building RTEMS
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50928 Martin Liška changed: What|Removed |Added CC||marxin at gcc dot gnu.org --- Comment #18 from Martin Liška --- Can the bug be marked as resolved?
[Bug target/50928] m32c ICE building RTEMS
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50928 --- Comment #17 from Eric Gallager --- *** Bug 63683 has been marked as a duplicate of this bug. ***
[Bug target/50928] m32c ICE building RTEMS
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50928 Eric Gallager changed: What|Removed |Added CC||egallager at gcc dot gnu.org --- Comment #16 from Eric Gallager --- (In reply to DJ Delorie from comment #15) > The binutils team has been working a lot on patching vulnerabilities in the > binutils tools. The m32c, however, has a 3-byte reloc that might occur at > the end of a section, and was implemented as three bytes of a four-byte > "word", which would then be outside the bounds of the section. Recent > patches check for such bounds crossings, hence the breakage. I've checked > in a patch to binutils head to manually process the R_M32C_24 relocations so > that the range checking is more appropriate to the three-byte relocation. Which version of binutils was the patch released in?
[Bug target/50928] m32c ICE building RTEMS
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50928 --- Comment #15 from DJ Delorie --- The binutils team has been working a lot on patching vulnerabilities in the binutils tools. The m32c, however, has a 3-byte reloc that might occur at the end of a section, and was implemented as three bytes of a four-byte "word", which would then be outside the bounds of the section. Recent patches check for such bounds crossings, hence the breakage. I've checked in a patch to binutils head to manually process the R_M32C_24 relocations so that the range checking is more appropriate to the three-byte relocation.
[Bug target/50928] m32c ICE building RTEMS
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50928 --- Comment #14 from Bernd Edlinger --- Author: edlinger Date: Fri Jan 23 16:32:34 2015 New Revision: 220048 URL: https://gcc.gnu.org/viewcvs?rev=220048&root=gcc&view=rev Log: 2015-01-23 Bernd Edlinger PR target/50928 * config/m32c/m32c.c (encode_pattern_1): Removed gcc_unreachable here. (DEBUG_RELOAD): Removed define. (m32c_limit_reload_class): Enable traces with if DEBUG0. (m32c_function_arg): Added a type cast. (m32c_legitimize_reload_address): Push A_REGS reload with PSImode. * config/m32c/addsub.md (addsi3_1): Specify the mode of all arguments. * config/m32c/bitops.md (andqi3_16): Likewise. * config/m32c/mov.md (m32c_immd_dbl_mov): Likewise. (push_a01_l): Likewise. Modified: trunk/gcc/ChangeLog trunk/gcc/config/m32c/addsub.md trunk/gcc/config/m32c/bitops.md trunk/gcc/config/m32c/m32c.c trunk/gcc/config/m32c/mov.md
[Bug target/50928] m32c ICE building RTEMS
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50928 --- Comment #13 from Bernd Edlinger --- ok, now I see. the binutils-2.25.tar.gz works, but if we build directly from the git it does not. is this a new check that makes this problem? regarding my patch on pr26255.c, this happens: m32c-elf-gcc -O1 -mcpu=m32c pr26255.c pr26255.c: In function 'foo': pr26255.c:31:1: error: insn does not satisfy its constraints: } ^ (insn 62 61 63 2 (set (reg:PSI 4 a0) (plus:PSI (reg:PSI 4 a0) (reg/v/f:PSI 28 [ w ]))) pr26255.c:29 5 {addpsi3} (expr_list:REG_EQUIV (plus:PSI (reg/v/f:PSI 28 [ w ]) (const_int 128 [0x80])) (nil))) pr26255.c:31:1: internal compiler error: in extract_constrain_insn, at recog.c:2246 0x9e9478 _fatal_insn(char const*, rtx_def const*, char const*, int, char const*) ../../gcc-trunk/gcc/rtl-error.c:110 0x9e949f _fatal_insn_not_found(rtx_def const*, char const*, int, char const*) ../../gcc-trunk/gcc/rtl-error.c:121 0x9c0505 extract_constrain_insn(rtx_insn*) ../../gcc-trunk/gcc/recog.c:2246 0x9a1a5d reload_cse_simplify_operands ../../gcc-trunk/gcc/postreload.c:430 0x9a4485 reload_cse_simplify ../../gcc-trunk/gcc/postreload.c:207 0x9a4485 reload_cse_regs_1 ../../gcc-trunk/gcc/postreload.c:246 0x9a459b reload_cse_regs ../../gcc-trunk/gcc/postreload.c:94 0x9a459b execute ../../gcc-trunk/gcc/postreload.c:2367 I had similar traps and could avoid them by adding an explicit mode to some patterns. But here I have no idea at the moment. DJ do you see anything obvious in the addpsi3 pattern?
[Bug target/50928] m32c ICE building RTEMS
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50928 --- Comment #12 from DJ Delorie --- The reloc bug is caused when gcc puts a JMP.A at the very end of .text and also adds debug info; this puts a 3-byte reloc right at the end of a section (m32c-as pads the last section if it's a code section, the debug info makes .text not last) but BFD has no option for a non-power-of-two reloc in the HOWTO table, so it thinks it's 4 bytes and thus extends past the end of the section. I suspect the way to fix this is to handle that one reloc specially (the rest are handled by generic reloc handlers), unless someone has an alternate idea?
[Bug target/50928] m32c ICE building RTEMS
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50928 --- Comment #11 from DJ Delorie --- I see the "relocation out of range" error too. I'm configuring for m32c-elf
[Bug target/50928] m32c ICE building RTEMS
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50928 --- Comment #10 from Bernd Edlinger --- Hmm... I use this configuration: binutils-build: ../binutils-2.25/configure --prefix=/home/ed/gnu/m32c-rtems --target=m32c-rtems --disable-werror gcc-build: ../gcc-trunk/configure --prefix=/home/ed/gnu/m32c-rtems --target=m32c-rtems --enable-languages=c --disable-libssp Revision: 219900 with above patch. => build succeeds. But pr26255.c does not work. I have no idea how to fix that. Something wrong with addpsi3 constraints? I think there is another relatively simple issue with exception handling. What are your configure options?
[Bug target/50928] m32c ICE building RTEMS
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50928 --- Comment #9 from Joel Sherrill --- I updated binutils, newlib and gcc. The build fails very early for me: /users/joel/test-gcc/b-m32c-rtems4.11-gcc/./gcc/xgcc -B/users/joel/test-gcc/b-m32c-rtems4.11-gcc/./gcc/ -nostdinc -B/users/joel/test-gcc/b-m32c-rtems4.11-gcc/m32c-rtems4.11/newlib/ -isystem /users/joel/test-gcc/b-m32c-rtems4.11-gcc/m32c-rtems4.11/newlib/targ-include -isystem /users/joel/test-gcc/gcc/newlib/libc/include -B/users/joel/test-gcc/install-head/m32c-rtems4.11/bin/ -B/users/joel/test-gcc/install-head/m32c-rtems4.11/lib/ -isystem /users/joel/test-gcc/install-head/m32c-rtems4.11/include -isystem /users/joel/test-gcc/install-head/m32c-rtems4.11/sys-include-g -O2 -mcpu=m32cm -O2 -I../../../../gcc/libgcc/../newlib/libc/sys/rtems/include -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -Dinhibit_libc -I. -I. -I../../.././gcc -I../../../../gcc/libgcc -I../../../../gcc/libgcc/. -I../../../../gcc/libgcc/../gcc -I../../../../gcc/libgcc/../include -DHAVE_CC_TLS -DUSE_EMUTLS -o _muldi3.o -MT _muldi3.o -MD -MP -MF _muldi3.dep -DL_muldi3 -c ../../../../gcc/libgcc/libgcc2.c -fvisibility=hidden -DHIDE_EXPORTS /tmp/ccx0vJbF.s: Assembler messages: /tmp/ccx0vJbF.s: Error: relocation out of range make[4]: *** [_muldi3.o] Error 1
[Bug target/50928] m32c ICE building RTEMS
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50928 --- Comment #8 from DJ Delorie --- There are a few regressions in the testsuite (pr26255.c with -mcpu=m32c for example) and libstdc++ still doesn't build, but ieee/920810-1 now passes and newlib builds. I suppose that's "better".
[Bug target/50928] m32c ICE building RTEMS
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50928 --- Comment #7 from Joel Sherrill --- DJ.. do you think the patch from Bernd can be applied to the 4.9 branch? and maybe the head?
[Bug target/50928] m32c ICE building RTEMS
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50928 camden lindsay changed: What|Removed |Added CC||camden.lindsay at gmail dot com --- Comment #6 from camden lindsay --- Hello- I ran into the same error message as below while compiling for m32c ('error: unable to find a register to spill in class 'A_REGS'') I applied the patches provided in Comment 5 Now the build succeeds. Cannot test code coming out of the build, though. newlib-2.2.0 binutils-2.25 gcc-4.9.2
[Bug target/50928] m32c ICE building RTEMS
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50928 Bernd Edlinger changed: What|Removed |Added CC||bernd.edlinger at hotmail dot de --- Comment #5 from Bernd Edlinger --- Created attachment 32892 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=32892&action=edit Patch to fix the ICE on building libgcc I tried this patch on 4.9.0 and 4.10 trunk. It seems to work. At least it is successfully building libgcc and libquadmath, but I cannot test, if the generated code works in practice. Maybe one of you can test it?