../../xgcc -B../../ -c -g -O2 -fPIC -DELF=1 -DLINUX=1 -W -Wall -gnatpg i- cobol.adb -o i-cobol.o i-cobol.adb: In function 'Interfaces.Cobol.To_Display.Convert': i-cobol.adb:482: error: unrecognizable insn: (insn 213 77 83 5 i-cobol.adb:466 (set (reg/f:SI 112) (minus:SI (plus:SI (reg:SI 156) (reg/f:SI 151 [ <variable>.result___36 ])) (const_int -1 [0xffffffff]))) -1 (nil) (nil)) +===========================GNAT BUG DETECTED==============================+ | 4.1.0 20050629 (experimental) (hppa-unknown-linux-gnu) GCC error: | | in extract_insn, at recog.c:2082 | | Error detected at i-cobol.adb:989:1 | | Please submit a bug report; see http://gcc.gnu.org/bugs.html. | | Use a subject line meaningful to you and us to track the bug. | | Include the entire contents of this bug box in the report. | | Include the exact gcc or gnatmake command that you entered. | | Also include sources listed below in gnatchop format | | (concatenated together with no headers between files). | +==========================================================================+ Please include these source files with error report Note that list may not be accurate in some cases, so please double check that the problem can still be reproduced with the set of files listed. raised TYPES.UNRECOVERABLE_ERROR : comperr.adb:380 The instruction is generated in the loop pass here: (insn 96 95 213 5 i-cobol.adb:466 (set (reg:SI 132) (plus:SI (subreg:SI (reg:QI 131) 0) (const_int 48 [0x30]))) -1 (nil) (nil)) (insn 213 96 97 5 i-cobol.adb:466 (set (reg/f:SI 112) (minus:SI (plus:SI (reg:SI 156) (reg/f:SI 151 [ <variable>.result___36 ])) (const_int -1 [0xffffffff]))) -1 (nil) (nil)) (insn 97 213 98 5 i-cobol.adb:466 (set (mem/s/j:QI (plus:SI (reg/f:SI 112) (const_int -1 [0xffffffff])) [14 S1 A8]) (subreg:QI (reg:SI 132) 3)) -1 (nil) (nil))
Created attachment 9177 [details] Patch to loop.c Testing patch as possible fix.
Looks like the following change introduced the regression: 2005-04-16 Alexandre Oliva <aoliva@redhat.com> PR target/20126 * loop.c (loop_givs_rescan): Handle non-replaceable (plus (reg) (const)).
So this is a latent bug on the 4.0 branch too. I just wish loop.c would go away.
Subject: Bug 22239 CVSROOT: /cvs/gcc Module name: gcc Changes by: danglin@gcc.gnu.org 2005-07-07 22:53:31 Modified files: gcc : ChangeLog loop.c Log message: PR middle-end/22239 * loop.c (loop_givs_rescan): Check that v->new_reg is a REG. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.9376&r2=2.9377 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/loop.c.diff?cvsroot=gcc&r1=1.534&r2=1.535
The latest patch causes a bootstrap failure on arm-elf and arm-netbsdelf. I'll attach a file momentarily.
Created attachment 9233 [details] file that now ICEs with latest patch. Compile the this file with -O2 -g on an arm-elf cross
Subject: Re: [4.0/4.1 Regression] i-cobol.adb:482: error: unrecognizable insn > Compile the this file with -O2 -g on an arm-elf cross Looks like a target, or possibly a different loop bug to me: (gdb) p debug_rtx (v->new_reg) (plus:SI (reg:SI 993) (const_int -60 [0xffffffc4])) (gdb) p debug_rtx (v->insn) (insn 1785 3575 1792 (parallel [ (set (mem/s:SI (reg/f:SI 624) [41 adpm S4 A32]) (reg:SI 0 r0)) (set (mem/s:SI (plus:SI (reg/f:SI 624) (const_int 4 [0x4])) [41 adpm S4 A32]) (reg:SI 1 r1)) (set (mem/s:SI (plus:SI (reg/f:SI 624) (const_int 8 [0x8])) [41 adpm S4 A32]) (reg:SI 2 r2)) (set (mem/s:SI (plus:SI (reg/f:SI 624) (const_int 12 [0xc])) [41 adpm S4 A32]) (reg:SI 3 r3)) ]) -1 (nil) (nil)) (gdb) p debug_rtx (*v->location) (plus:SI (reg/f:SI 624) (const_int 12 [0xc])) So, it's apparently not valid to substitute a reg into the fourth instruction of the above parallel on arm-elf. Dave
Subject: Re: [4.0/4.1 Regression] i-cobol.adb:482: error: unrecognizable insn > --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=9233&action=view) > file that now ICEs with latest patch. > > Compile the this file with -O2 -g on an arm-elf cross This is totally untested but possibly something like the change below would resolve the problem for both ports. Dave -- J. David Anglin dave.anglin@nrc-cnrc.gc.ca National Research Council of Canada (613) 990-0752 (FAX: 952-6602) Index: loop.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/loop.c,v retrieving revision 1.535 diff -u -3 -p -r1.535 loop.c --- loop.c 7 Jul 2005 22:53:28 -0000 1.535 +++ loop.c 9 Jul 2005 02:34:18 -0000 @@ -5496,14 +5496,21 @@ loop_givs_rescan (struct loop *loop, str v->new_reg)); else if (GET_CODE (*v->location) == PLUS && REG_P (XEXP (*v->location, 0)) - && REG_P (v->new_reg) && CONSTANT_P (XEXP (*v->location, 1))) - loop_insn_emit_before (loop, 0, v->insn, - gen_move_insn (XEXP (*v->location, 0), - gen_rtx_MINUS - (GET_MODE (*v->location), - v->new_reg, - XEXP (*v->location, 1)))); + { + rtx reg, seq; + start_sequence (); + if (REG_P (v->new_reg)) + reg = v->new_reg; + else + reg = force_reg (GET_MODE (*v->location), v->new_reg); + emit_move_insn (XEXP (*v->location, 0), + gen_rtx_MINUS (GET_MODE (*v->location), reg, + XEXP (*v->location, 1))); + seq = get_insns (); + end_sequence (); + loop_insn_emit_before (loop, 0, v->insn, seq); + } else { /* If it wasn't a reg, create a pseudo and use that. */
Please see bug 20126, it contains a patch that will likely fix all of the problems you've run into, and some discussion on why it's not in yet. If you find it to fix the problem you have, and it's unsolvable otherwise, feel free to go ahead and check it in.
*** Bug 22384 has been marked as a duplicate of this bug. ***
Subject: Bug 22239 CVSROOT: /cvs/gcc Module name: gcc Changes by: danglin@gcc.gnu.org 2005-07-11 03:56:14 Modified files: gcc : ChangeLog loop.c Log message: PR middle-end/22239 PR target/20126 * loop.c (loop_givs_rescan): Use expand_simple_binop instead of gen_rtx_MINUS to handle non-replaceable (plus ((x) (const)). Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.9401&r2=2.9402 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/loop.c.diff?cvsroot=gcc&r1=1.535&r2=1.536
Fixed so closing as such.