I get an ICE in extract_insn with -maltivec. The original source file works with gcc 4.0 but fails with 4.1 and 4.2. This reduced test case fails with 4.1 but works with 4.2. I'll run it through delta again to find a test case for 4.2. 304:tbm@test: ~/delta/bin] gcc-4.1 -maltivec -O1 -c mini.c 305:tbm@test: ~/delta/bin] gcc-4.1 -maltivec -O2 -c mini.c mini.c: In function ‘nb_kernel112_ppc_altivec’: mini.c:110: error: unrecognizable insn: (insn 287 43 227 3 (set (reg:V4SF 90 13) (mem/u/c/i:V4SF (symbol_ref/u:SI ("*.LC0") [flags 0x2]) [3 S16 A128])) -1 (nil) (nil)) mini.c:110: internal compiler error: in extract_insn, at recog.c:2084 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. For Debian GNU/Linux specific bug reporting instructions, see <URL:file:///usr/share/doc/gcc-4.1/README.Bugs>. Preprocessed source stored into /tmp/cc6nkhMT.out file, please attach this to your bugreport. zsh: exit 1 gcc-4.1 -maltivec -O2 -c mini.c 306:tbm@test: ~/delta/bin] /usr/lib/gcc-snapshot/bin/gcc -maltivec -O2 -c mini.c 307:tbm@test: ~/delta/bin] This may be related to PR19960 but doesn't appear to be the same.
Created attachment 11266 [details] test case for 4.1 shows the ICE in gcc 4.1
Created attachment 11267 [details] test case for 4.2
Created attachment 11268 [details] preprocessed source Unfortunately, I don't get delta to generate a test case that shows the bug both in 4.1 and 4.2. The preprocessed file shows the ICE on 4.1 and 4.2 though.
Created attachment 11269 [details] preprocessed source Unfortunately, I don't get delta to generate a test case that shows the bug both in 4.1 and 4.2. The preprocessed file shows the ICE on 4.1 and 4.2 though.
Usually what is happening is that reload is doing the constant loading for some reason.
Thanks for the testcases.
Confirmed.
Seems similar to PR24230, but cannot be fixed really in the same way.
The mem is for a (const_vector:V4SF [ (const_double:SF -NaN [-NaN]) (const_double:SF -NaN [-NaN]) (const_double:SF -NaN [-NaN]) (const_double:SF -NaN [-NaN]) ])
It's probably two different bugs, since the 4.1 bug is in loop.c. We need to add a can_assign_to_reg_p call before creating a movable.
... but then anyway the bug pops up in reload. So it is definitely the same bug as PR24230, and here is a modified version of the PR24230 testcase: /* Compile with -O2 -maltivec */ #define REGLIST \ "77", "78", "79", "80", "81", "82", "83", "84", "85", "86",\ "87", "88", "89", "90", "91", "92", "93", "94", "95", "96",\ "97", "98", "99", "100", "101", "102", "103", "104", "105", "106",\ "107", "108" typedef __attribute__ ((vector_size (16))) float v4sf; void foo (int H) { volatile v4sf tmp; while (H-- > 0) { asm ("" : : : REGLIST); tmp = (v4sf) __builtin_altivec_vspltisw (1); } } fails on 4.1, didn't test on 4.2.
also fails on 4.2.
The problem here is that we don't recongize the constant is resepentable with vspltisw. Hmm.
Hmm, maybe really this is just the RA playing tricks in that it should be able to move (insn 22 16 48 3 (set (reg:V4SI 126) (vec_duplicate:V4SI (const_int 1 [0x1]))) 755 {altivec_vspltisw} (nil) (expr_list:REG_EQUIV (const_vector:V4SI [ (const_int 1 [0x1]) (const_int 1 [0x1]) (const_int 1 [0x1]) (const_int 1 [0x1]) ]) (nil))) Back into the loop after the asm.
Subject: Bug 27158 Author: sayle Date: Mon May 8 21:09:49 2006 New Revision: 113632 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=113632 Log: PR target/27158 * reload.c (find_reloads_toplev): Only return the simplified SUBREG of a reg_equiv_constant if the result is a legitimate constant. * gcc.target/powerpc/pr27158.c: New test case. Added: trunk/gcc/testsuite/gcc.target/powerpc/pr27158.c Modified: trunk/gcc/ChangeLog trunk/gcc/reload.c trunk/gcc/testsuite/ChangeLog
Subject: Bug 27158 Author: sayle Date: Thu May 11 14:17:19 2006 New Revision: 113695 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=113695 Log: PR target/27158 * reload.c (find_reloads_toplev): Only return the simplified SUBREG of a reg_equiv_constant if the result is a legitimate constant. * gcc.target/powerpc/pr27158.c: New test case. Added: branches/gcc-4_1-branch/gcc/testsuite/gcc.target/powerpc/pr27158.c Modified: branches/gcc-4_1-branch/gcc/ChangeLog branches/gcc-4_1-branch/gcc/reload.c branches/gcc-4_1-branch/gcc/testsuite/ChangeLog
Fixed.
Subject: Bug 27158 Author: sayle Date: Mon Jun 12 02:02:14 2006 New Revision: 114558 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=114558 Log: PR target/27158 * config/rs6000/rs6000.c (const_vector_elt_as_int): New function to extract a CONST_VECTOR element and interpret it as an integer. (vspltis_constant): Use const_vector_elt_as_int instead of the macro CONST_VECTOR_ELT in order to handle FP vector modes. * config/rs6000/predicates.md (easy_vector_const): Consider floating point ALTIVEC_VECTOR_MODEs via easy_altivec_constant. Modified: trunk/gcc/ChangeLog trunk/gcc/config/rs6000/predicates.md trunk/gcc/config/rs6000/rs6000.c
Subject: Bug 27158 Author: sayle Date: Mon Jun 12 02:10:24 2006 New Revision: 114559 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=114559 Log: PR target/27858 Revert incorrect fix for PR target/27158 2006-05-08 Roger Sayle <roger@eyesopen.com> * reload.c (find_reloads_toplev): Only return the simplified SUBREG of a reg_equiv_constant if the result is a legitimate constant. Modified: trunk/gcc/ChangeLog trunk/gcc/reload.c
Subject: Bug 27158 Author: sayle Date: Wed Jun 14 14:43:49 2006 New Revision: 114641 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=114641 Log: PR target/27158 * config/rs6000/rs6000.c (const_vector_elt_as_int): New function to extract a CONST_VECTOR element and interpret it as an integer. (vspltis_constant): Use const_vector_elt_as_int instead of the macro CONST_VECTOR_ELT in order to handle FP vector modes. * config/rs6000/predicates.md (easy_vector_const): Consider floating point ALTIVEC_VECTOR_MODEs via easy_altivec_constant. Modified: branches/gcc-4_1-branch/gcc/ChangeLog branches/gcc-4_1-branch/gcc/config/rs6000/predicates.md branches/gcc-4_1-branch/gcc/config/rs6000/rs6000.c
Subject: Bug 27158 Author: sayle Date: Wed Jun 14 14:46:33 2006 New Revision: 114642 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=114642 Log: PR target/27858 Revert incorrect fix for PR target/27158 2006-05-11 Roger Sayle <roger@eyesopen.com> * reload.c (find_reloads_toplev): Only return the simplified SUBREG of a reg_equiv_constant if the result is a legitimate constant. Modified: branches/gcc-4_1-branch/gcc/ChangeLog branches/gcc-4_1-branch/gcc/reload.c