Giving GCC 4.4.3 the following code with the arguments "-O1 -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp": ############################################################ #include <stdio.h> #include <arm_neon.h> void printv_f32(const float32x4_t &v) { printf("%f\n", vgetq_lane_f32(v, 0)); } int main() { float32x4_t v = {0.0, 1.0f, 2.0f, 3.0f}; printv_f32(v); return 0; } ############################################################ Results into an ICE: /home/liranuna/Projects/mathlib_md/source/main.cpp: In function 'int main()': /home/liranuna/Projects/mathlib_md/source/main.cpp:21: error: insn does not satisfy its constraints: (insn 25 5 7 2 /home/liranuna/Projects/mathlib_md/source/main.cpp:11 (set (mem/c/i:V4SF (pre_dec:SI (reg/f:SI 0 r0 [134])) [0 v+0 S16 A64]) (reg:V4SF 95 d16)) 710 {*neon_movv4sf} (expr_list:REG_INC (reg/f:SI 0 r0 [134]) (nil))) /home/liranuna/Projects/mathlib_md/source/main.cpp:21: internal compiler error: in reload_cse_simplify_operands, at postreload.c:396 Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions.
I would like to add that changing void printv_f32(const float32x4_t &v) into: void printv_f32(float32x4_t v) makes the problem go away, but the generated code is suboptimal.
The equivalent C version of this test case ICEs with 4.4.4 but works with 4.3.5 and 4.5.0-RC-20100406.
gcc-4.5-20090514 (r147545): ICE gcc-4.5-20090521 (r147778): no ICE Continuing to investigate.
Appears to have been "fixed" for 4.5 by r147566, see <http://gcc.gnu.org/ml/gcc-patches/2009-05/msg00812.html>. But that patch doesn't change any ARM code so the issue may be still be latent in 4.5 unless some other patch fixed it properly.
Created attachment 20372 [details] reduced test case in plain C Reduced test case. This one ICEs both 4.4 and 4.3 but not 4.5. Using the reduced test case a new bisection of trunk identified r147577 as the fix for this bug. r147577 added support for PRE_DEC in NEON memory operands, which makes sense given the pre_dec in the insn that gcc complains about. r147577 applies easily to 4.4 and eliminates the ICE. I'll start a full bootstrap and regression test on this combo in a few minutes.
Created attachment 20373 [details] proposed 4.4 fix for PR43722 Turns out r147577 contains a few redundant changes wrt this bug. The attached patch backports just those bits needed to fix the bug.
Mikael's patch seems to do that trick as well as producing very nice assembly.
Could you submit the patch to gcc-patches@ ? If you need some help in testing this patch let me know and I can do it for you.
Created attachment 20388 [details] proposed 4.3 fix for PR43722
The proposed 4.4 patch has been posted here: http://gcc.gnu.org/ml/gcc-patches/2010-04/msg00885.html Both the 4.4 and 4.3 patches have been bootstrapped and regtested on armv5tel, but due to lack of NEON HW no NEON runtime tests have been done.
Fixed in 4.5.0