[Bug target/44707] operand requires impossible reload
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44707 --- Comment #12 from Dominique d'Humieres dominiq at lps dot ens.fr 2011-07-11 09:44:00 UTC --- Hi, I see this test failing on powerpc-darwin8 (I know, not a critical platform). http://gcc.gnu.org/ml/gcc-testresults/2011-07/msg01092.html What information can I provide from my test runs? This is pr45233.
[Bug target/44707] operand requires impossible reload
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44707 David Fang fang at csl dot cornell.edu changed: What|Removed |Added CC||fang at csl dot cornell.edu --- Comment #8 from David Fang fang at csl dot cornell.edu 2011-07-10 17:34:25 UTC --- Hi, I see this test failing on powerpc-darwin8 (I know, not a critical platform). http://gcc.gnu.org/ml/gcc-testresults/2011-07/msg01092.html What information can I provide from my test runs?
[Bug target/44707] operand requires impossible reload
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44707 Jack Howarth howarth at nitro dot med.uc.edu changed: What|Removed |Added CC||howarth at nitro dot ||med.uc.edu --- Comment #9 from Jack Howarth howarth at nitro dot med.uc.edu 2011-07-11 03:03:55 UTC --- On powerpc-apple-darwin9, this fails under gcc-4.6.1 as... Executing on host: /sw/src/fink.build/gcc46-4.6.1-1000/darwin_objdir/gcc/xgcc -B/sw/src/fink.build/gcc46-4.6.1-1000/darwin_objdir/gcc/ -O1 -w -c -m32 -o pr44707.o /sw/src/fink.build/gcc46-4.6.1-1000/gcc-4.6.1/gcc/testsuite/gcc.c-torture/compile/pr44707.c (timeout = 300) /var/tmp//ccZ2tK1u.s:15:non-relocatable subtraction expression, _w minus L001$pb^M /var/tmp//ccZ2tK1u.s:15:symbol: _w can't be undefined in a subtraction expression^M /var/tmp//ccZ2tK1u.s:14:non-relocatable subtraction expression, _w minus L001$pb^M /var/tmp//ccZ2tK1u.s:14:symbol: _w can't be undefined in a subtraction expression^M /var/tmp//ccZ2tK1u.s:13:non-relocatable subtraction expression, _v minus L001$pb^M /var/tmp//ccZ2tK1u.s:13:symbol: _v can't be undefined in a subtraction expression^M /var/tmp//ccZ2tK1u.s:12:non-relocatable subtraction expression, _v minus L001$pb^M /var/tmp//ccZ2tK1u.s:12:symbol: _v can't be undefined in a subtraction expression^M compiler exited with status 1 which may be an assembler issue remembering that darwin is using the rather old... Apple Inc version cctools-698.1~1, GNU assembler version 1.38
[Bug target/44707] operand requires impossible reload
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44707 --- Comment #10 from Jack Howarth howarth at nitro dot med.uc.edu 2011-07-11 03:07:34 UTC --- Created attachment 24734 -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=24734 preprocessed source for pr44707.c from powerpc-apple-darwin9
[Bug target/44707] operand requires impossible reload
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44707 --- Comment #11 from Jack Howarth howarth at nitro dot med.uc.edu 2011-07-11 03:08:07 UTC --- Created attachment 24735 -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=24735 assembly for pr44707.c from powerpc-apple-darwin9
[Bug target/44707] operand requires impossible reload
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44707 --- Comment #7 from Peter Bergner bergner at gcc dot gnu.org 2011-03-09 19:20:47 UTC --- Author: bergner Date: Wed Mar 9 19:20:42 2011 New Revision: 170829 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=170829 Log: gcc/ Backport from mainline 2010-07-02 Ulrich Weigand ulrich.weig...@de.ibm.com PR target/44707 * config/rs6000/rs6000.c (rs6000_legitimize_reload_address): Recognize (lo_sum (high ...) ...) patterns generated by earlier passes. gcc/testsuite/ Backport from mainline 2010-07-02 Ulrich Weigand ulrich.weig...@de.ibm.com PR target/44707 * gcc.c-torture/compile/pr44707.c: New test. Added: branches/ibm/gcc-4_5-branch/gcc/testsuite/gcc.c-torture/compile/pr44707.c Modified: branches/ibm/gcc-4_5-branch/gcc/ChangeLog.ibm branches/ibm/gcc-4_5-branch/gcc/config/rs6000/rs6000.c branches/ibm/gcc-4_5-branch/gcc/testsuite/ChangeLog.ibm
[Bug target/44707] operand requires impossible reload
--- Comment #6 from ebotcazou at gcc dot gnu dot org 2010-07-25 21:46 --- Subject: Bug 44707 Author: ebotcazou Date: Sun Jul 25 21:46:32 2010 New Revision: 162521 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=162521 Log: PR target/44707 * config/sparc/sparc-protos.h (sparc_legitimize_reload_address): New. * config/sparc/sparc.c: Include reload.h. (legitimize_tls_address): Rename into... (sparc_legitimize_tls_address): ...this. (legitimize_pic_address): Rename into... (sparc_legitimize_pic_address): ...this. (sparc_expand_move): Adjust to above renaming. (sparc_tls_referenced_p): Likewise. (sparc_legitimize_tls_address): Likewise. (sparc_legitimize_pic_address): Likewise. (sparc_legitimize_address): Likewise. (sparc_output_mi_thunk): Likewise. (sparc_legitimize_reload_address): New global function. Recognize (lo_sum (high ...) ...) patterns generated by earlier passes. * config/sparc/sparc.h (LEGITIMIZE_RELOAD_ADDRESS): Use above function. Modified: trunk/gcc/ChangeLog trunk/gcc/config/sparc/sparc-protos.h trunk/gcc/config/sparc/sparc.c trunk/gcc/config/sparc/sparc.h -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44707
[Bug target/44707] operand requires impossible reload
--- Comment #4 from uweigand at gcc dot gnu dot org 2010-07-02 11:48 --- Subject: Bug 44707 Author: uweigand Date: Fri Jul 2 11:48:30 2010 New Revision: 161703 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=161703 Log: ChangeLog: PR target/44707 * config/rs6000/rs6000.c (rs6000_legitimize_reload_address): Recognize (lo_sum (high ...) ...) patterns generated by earlier passes. testsuite/ChangeLog: PR target/44707 * gcc.c-torture/compile/pr44707.c: New test. Added: trunk/gcc/testsuite/gcc.c-torture/compile/pr44707.c Modified: trunk/gcc/ChangeLog trunk/gcc/config/rs6000/rs6000.c trunk/gcc/testsuite/ChangeLog -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44707
[Bug target/44707] operand requires impossible reload
--- Comment #5 from uweigand at gcc dot gnu dot org 2010-07-02 11:50 --- Fixed. -- uweigand at gcc dot gnu dot org changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution||FIXED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44707
[Bug target/44707] operand requires impossible reload
-- uweigand at gcc dot gnu dot org changed: What|Removed |Added AssignedTo|unassigned at gcc dot gnu |uweigand at gcc dot gnu dot |dot org |org Status|NEW |ASSIGNED Last reconfirmed|2010-06-29 16:56:47 |2010-07-01 19:07:33 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44707
[Bug target/44707] operand requires impossible reload
--- Comment #3 from uweigand at gcc dot gnu dot org 2010-07-01 19:14 --- Patch posted here: http://gcc.gnu.org/ml/gcc-patches/2010-07/msg00082.html -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44707
[Bug target/44707] operand requires impossible reload
--- Comment #1 from uweigand at gcc dot gnu dot org 2010-06-29 16:56 --- I agree, this looks like a longstanding bug in rs6000_legitimize_reload_address. What happens here is that find_reloads is called on this insn: (insn 15 8 18 2 pr44707.c:13 (asm_operands/v (/* %0 %1 %2 %3 %4 */) () 0 [ (mem/s/c:SI (symbol_ref:SI (v) [flags 0xc0] var_decl 0xf6f90fc0 v) [3 v.a+0 S4 A32]) (mem/c/i:SI (symbol_ref:SI (w) [flags 0xc4] var_decl 0xf6f91020 w) [3 w+0 S4 A32]) (mem/s/c:SI (const:SI (plus:SI (symbol_ref:SI (v) [flags 0xc0] var_decl 0xf6f90fc0 v) (const_int 4 [0x4]))) [3 v.b+0 S4 A32]) (mem/s/c:SI (const:SI (plus:SI (symbol_ref:SI (v) [flags 0xc0] var_decl 0xf6f90fc0 v) (const_int 8 [0x8]))) [3 v.c+0 S4 A32]) (mem/s/c:SI (const:SI (plus:SI (symbol_ref:SI (v) [flags 0xc0] var_decl 0xf6f90fc0 v) (const_int 12 [0xc]))) [3 v.d+0 S4 A32]) ] [ (asm_input:SI (nro) (null):0) (asm_input:SI (nro) (null):0) (asm_input:SI (nro) (null):0) (asm_input:SI (nro) (null):0) (asm_input:SI (nro) (null):0) ] [] pr44707.c:14) -1 (nil)) rs6000_find_reloads_address notices that it can rewrite (symbol_ref:SI v) to (lo_sum:SI (high:SI (symbol_ref:SI v)) (symbol_ref:SI v)) (and place a reload on the (high:SI) subexpression) and does so. This change remains in the insn, and when in the next iteration find_reloads is called again, the insn now looks like: (insn 15 8 18 2 pr44707.c:13 (asm_operands/v (/* %0 %1 %2 %3 %4 */) () 0 [ (mem/s/c:SI (lo_sum:SI (high:SI (symbol_ref:SI (v) [flags 0xc0] var_decl 0xf6f90fc0 v)) (symbol_ref:SI (v) [flags 0xc0] var_decl 0xf6f90fc0 v)) [3 v.a+0 S4 A32]) (mem/c/i:SI (lo_sum:SI (high:SI (symbol_ref:SI (w) [flags 0xc4] var_decl 0xf6f91020 w)) (symbol_ref:SI (w) [flags 0xc4] var_decl 0xf6f91020 w)) [3 w+0 S4 A32]) (mem/s/c:SI (const:SI (plus:SI (symbol_ref:SI (v) [flags 0xc0] var_decl 0xf6f90fc0 v) (const_int 4 [0x4]))) [3 v.b+0 S4 A32]) (mem/s/c:SI (const:SI (plus:SI (symbol_ref:SI (v) [flags 0xc0] var_decl 0xf6f90fc0 v) (const_int 8 [0x8]))) [3 v.c+0 S4 A32]) (mem/s/c:SI (const:SI (plus:SI (symbol_ref:SI (v) [flags 0xc0] var_decl 0xf6f90fc0 v) (const_int 12 [0xc]))) [3 v.d+0 S4 A32]) ] [ (asm_input:SI (nro) (null):0) (asm_input:SI (nro) (null):0) (asm_input:SI (nro) (null):0) (asm_input:SI (nro) (null):0) (asm_input:SI (nro) (null):0) ] [] pr44707.c:14) -1 (nil)) However, this expression is now no longer recognized by rs6000_legitimize_reload_address, and therefore no reload on (high:SI) is pushed. Thus, when the reload is finally processed, a reload insn like this is generated: (insn 26 8 27 2 pr44707.c:13 (set (reg:SI 10 10) (lo_sum:SI (high:SI (symbol_ref:SI (v) [flags 0xc0] var_decl 0xf6f90fc0 v)) (symbol_ref:SI (v) [flags 0xc0] var_decl 0xf6f90fc0 v))) -1 (nil)) As this does not actually correspond to any valid pattern, an assertion is triggered. The underlying problem is that with the current reload setup, an implementation of LEGITIMATE_RELOAD_ADDRESS must always recognize expressions it has itself generated in an earlier call. And indeed, that's what a comment in rs6000_legitimize_reload_address says: static rtx rs6000_legitimize_reload_address (rtx x, enum machine_mode mode, int opnum, int type, int ind_levels ATTRIBUTE_UNUSED, int *win) { bool reg_offset_p = reg_offset_addressing_ok_p (mode); /* We must recognize output that we have already generated ourselves. */ if (GET_CODE (x) == PLUS GET_CODE (XEXP (x, 0)) == PLUS GET_CODE (XEXP (XEXP (x, 0), 0)) == REG GET_CODE (XEXP (XEXP (x, 0), 1)) == CONST_INT GET_CODE (XEXP (x, 1)) == CONST_INT) However, this recognizes only certain types of such output, and in particular not the one that shows up in this test case. It seems to me that simply extending rs6000_legitimate_reload_address to handle this case as well should fix the bug. -- uweigand at gcc dot gnu dot org changed: What|Removed |Added Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 Last reconfirmed|-00-00 00:00:00 |2010-06-29 16:56:47 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44707
[Bug target/44707] operand requires impossible reload
--- Comment #2 from uweigand at gcc dot gnu dot org 2010-06-29 17:03 --- Created an attachment (id=21041) -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21041action=view) Recognize (lo_sum (high ...) ...) in rs6000_legitimize_reload_address It seems to me that simply extending rs6000_legitimate_reload_address to handle this case as well should fix the bug. And indeed, this (otherwise untested) patch fixes the bug for me. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44707