Summary: | [4.1 regression] global-alloc (reload) trips over own confusion for unexpected addressing modes | ||
---|---|---|---|
Product: | gcc | Reporter: | Hans-Peter Nilsson <hp> |
Component: | middle-end | Assignee: | Hans-Peter Nilsson <hp> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | gcc-bugs |
Priority: | P3 | Keywords: | ice-on-valid-code, patch |
Version: | 4.1.0 | ||
Target Milestone: | 4.1.0 | ||
Host: | x86_64-unknown-linux-gnu | Target: | cris-axis-elf |
Build: | Known to work: | ||
Known to fail: | Last reconfirmed: | 2005-11-09 02:23:16 | |
Attachments: | Compile with -Os |
Description
Hans-Peter Nilsson
2005-11-09 02:10:57 UTC
I should mention that (plus:SI (sign_extend:SI (reg:HI 10 r10)) (reg:SI 1 r1)) is not a valid address, but (plus:SI (sign_extend:SI (sign_extend:SI (mem:HI (post_inc:SI (reg/f:SI 12 r12))))) (reg:SI 1 r1)) is; the problem seems related to reload choosing to reload inner MEM expressions replacing them with REG even though that's not needed and sometimes (i.e. for some targets) not valid. The "real" need is just to reload SRP. Or perhaps that SRP was chosen as part of an address in the first place. Or both. Or maybe we should just bail out and declare LEGITIMIZE_RELOAD_ADDRESS as a sometimes actually *necessary* macro rather than just for optimization, for certain cases, like when a MEM inside an expression can't be validly replaced with a REG. Created attachment 10182 [details] Compile with -Os Note the brittleness of the test-case. Apparently there's a bug, PR 20656, causing the empty, seemingly-reducible, sometimes redundant for-loops aren't gone when RTL is generated and can't be replaced with a single assignment without causing the test-case to PASS. For example, the "for (i = 1; i <= u0; i++) { }" loop can't be removed. Pinskia brings to attention that the loop removal thingy is more related to PR 23361. A much shorter, but CRIS-specific testcase, that fails for the same reason but in a slightly different way is: int f (short *a, char *y) { asm ("" : : : "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12"); return y[*a]; } The "slightly different way" being: /tmp/st20.c: In function âfâ: /tmp/st20.c:6: internal compiler error: output_operand: unexpected index-type in cris_print_index A regression hunt using a cris-axis-elf cross compiler on powerpc-linux identified this patch: r95823 | hp | 2005-03-03 03:53:29 +0000 (Thu, 03 Mar 2005) | 40 lines http://gcc.gnu.org/viewcvs?view=rev&rev=95823 Subject: Re: [4.1 regression] global-alloc (reload) trips over own confusion for unexpected addressing modes On Thu, 10 Nov 2005, janis at gcc dot gnu dot org wrote: > ------- Comment #8 from janis at gcc dot gnu dot org 2005-11-10 23:40 ------- > A regression hunt using a cris-axis-elf cross compiler on powerpc-linux > identified this patch: > > r95823 | hp | 2005-03-03 03:53:29 +0000 (Thu, 03 Mar 2005) | 40 lines > > http://gcc.gnu.org/viewcvs?view=rev&rev=95823 (Wherein SRP and MOF are first described as actual registers.) Yeah, well, sort-of. Cause of exposure, but not the bug. Nice to know that the reghunt scripts work, though! brgds, H-P Patch at <URL:http://gcc.gnu.org/ml/gcc-patches/2005-11/msg00790.html>. Subject: Bug 24750 Author: hp Date: Fri Nov 11 23:17:16 2005 New Revision: 106804 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=106804 Log: PR middle-end/24750 * reload.c (find_reloads_address_1) <case TRUNCATE, SIGN_EXTEND, ZERO_EXTEND>: New cases. Modified: trunk/gcc/ChangeLog trunk/gcc/reload.c Subject: Bug 24750 Author: hp Date: Fri Nov 11 23:19:26 2005 New Revision: 106806 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=106806 Log: PR middle-end/24750 * gcc.dg/torture/pr24750-1.c, gcc.target/cris/torture/pr24750-2.c: New tests. Added: trunk/gcc/testsuite/gcc.dg/torture/pr24750-1.c trunk/gcc/testsuite/gcc.target/cris/torture/pr24750-2.c Modified: trunk/gcc/testsuite/ChangeLog gah Subject: Bug 24750 Author: hp Date: Sat Nov 19 21:56:17 2005 New Revision: 107231 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=107231 Log: PR middle-end/24912 PR middle-end/24750 * reload.c (find_reloads_address_1): Mention dependency on gen_reload. * reload1.c (gen_reload): For IN with an unary operation, try moving inner expression to OUT if trivial SET is not valid. Confirm that the result is valid. Move common code block into... (emit_insn_if_valid_for_reload): New function. Modified: trunk/gcc/ChangeLog trunk/gcc/reload.c trunk/gcc/reload1.c Subject: Bug 24750 Author: hp Date: Sat Nov 19 21:59:48 2005 New Revision: 107233 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=107233 Log: PR middle-end/24912 PR middle-end/24750 * reload.c (find_reloads_address_1): Mention dependency on gen_reload. * reload1.c (gen_reload): For IN with an unary operation, try moving inner expression to OUT if trivial SET is not valid. Confirm that the result is valid. Move common code block into... (emit_insn_if_valid_for_reload): New function. Modified: branches/gcc-4_1-branch/gcc/ChangeLog branches/gcc-4_1-branch/gcc/reload.c branches/gcc-4_1-branch/gcc/reload1.c |