Bug 48325 - ICE in reload_cse_simplify_operands, at postreload.c:403 with neon optimized code
Summary: ICE in reload_cse_simplify_operands, at postreload.c:403 with neon optimized ...
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.5.2
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2011-03-29 02:31 UTC by Luke Kim
Modified: 2021-09-09 00:57 UTC (History)
2 users (show)

See Also:
Host: i686-pc-linux-gnu
Target: arm-none-linux-gnueabi
Build: i686-pc-linux-gnu
Known to work:
Known to fail: 4.5.3, 4.7.0
Last reconfirmed: 2011-03-29 16:23:26


Attachments
preprocessed file (22.91 KB, application/octet-stream)
2011-03-29 02:31 UTC, Luke Kim
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Luke Kim 2011-03-29 02:31:40 UTC
Created attachment 23794 [details]
preprocessed file

I have following error while building neon optimized code.


$ cat insn-unsat-constr.c 
#include <arm_neon.h>

void test(signed int *output)
{ 
	int16_t * out = (int16_t *) output;
	{
		int16x4_t a = {0, };
		int16x4_t b = {1, };
		int16x4x4_t z;
		z.val[0] = vadd_s16(a, b); 
		z.val[1] = vadd_s16(a, b); 
		z.val[2] = vsub_s16(a, b); 
		z.val[3] = vadd_s16(a, b); 
		
		vst4_lane_s16(&out[0]+0*4, z, 0);
		vst4_lane_s16(&out[8]+0*4, z, 1);
		
	}
}



$ arm-none-linux-gnueabi-gcc -mfloat-abi=softfp -mfpu=neon -O1 -o insn-unsat-constr.o -c insn-unsat-constr.c
insn-unsat-constr.c: In function 'test':
insn-unsat-constr.c:19:1: error: insn does not satisfy its constraints:
(insn 40 38 26 2 /scratchbox/compilers/arm-linux-gnueabi-gcc4.5.1-2010.09-50/bin/../lib/gcc/arm-none-linux-gnueabi/4.5.1/include/arm_neon.h:10277 (set (reg:OI 95 d16 [orig:152 __b ] [152])
        (mem/s/c:OI (pre_dec:SI (reg/f:SI 3 r3 [151])) [0 __b+0 S32 A64])) 740 {*neon_movoi} (expr_list:REG_INC (reg/f:SI 3 r3 [151])
        (nil)))
insn-unsat-constr.c:19:1: internal compiler error: in reload_cse_simplify_operands, at postreload.c:403
Please submit a full bug report,
with preprocessed source if appropriate.



$ arm-none-linux-gnueabi-gcc -v
Using built-in specs.
COLLECT_GCC=/scratchbox/compilers/arm-linux-gnueabi-gcc4.5.1-2010.09-50/bin/arm-none-linux-gnueabi-gcc
COLLECT_LTO_WRAPPER=/scratchbox/compilers/arm-linux-gnueabi-gcc4.5.1-2010.09-50/bin/../libexec/gcc/arm-none-linux-gnueabi/4.5.1/lto-wrapper
Target: arm-none-linux-gnueabi
Configured with: /scratch/nathan/arm-lite/src/gcc-4.5-2010.09/configure --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --target=arm-none-linux-gnueabi --enable-threads --disable-libmudflap --disable-libssp --disable-libstdcxx-pch --enable-extra-sgxxlite-multilibs --with-arch=armv5te --with-gnu-as --with-gnu-ld --with-specs='%{save-temps: -fverbose-asm} %{funwind-tables|fno-unwind-tables|mabi=*|ffreestanding|nostdlib:;:-funwind-tables} -D__CS_SOURCERYGXX_MAJ__=2010 -D__CS_SOURCERYGXX_MIN__=9 -D__CS_SOURCERYGXX_REV__=50 %{O2:%{!fno-remove-local-statics: -fremove-local-statics}} %{O*:%{O|O0|O1|O2|Os:;:%{!fno-remove-local-statics: -fremove-local-statics}}}' --enable-languages=c,c++ --enable-shared --enable-lto --enable-symvers=gnu --enable-__cxa_atexit --with-pkgversion='Sourcery G++ Lite 2010.09-50' --with-bugurl=https://support.codesourcery.com/GNUToolchain/ --disable-nls --prefix=/opt/codesourcery --with-sysroot=/opt/codesourcery/arm-none-linux-gnueabi/libc --with-build-sysroot=/scratch/nathan/arm-lite/install/arm-none-linux-gnueabi/libc --with-gmp=/scratch/nathan/arm-lite/obj/host-libs-2010.09-50-arm-none-linux-gnueabi-i686-pc-linux-gnu/usr --with-mpfr=/scratch/nathan/arm-lite/obj/host-libs-2010.09-50-arm-none-linux-gnueabi-i686-pc-linux-gnu/usr --with-mpc=/scratch/nathan/arm-lite/obj/host-libs-2010.09-50-arm-none-linux-gnueabi-i686-pc-linux-gnu/usr --with-ppl=/scratch/nathan/arm-lite/obj/host-libs-2010.09-50-arm-none-linux-gnueabi-i686-pc-linux-gnu/usr --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --with-cloog=/scratch/nathan/arm-lite/obj/host-libs-2010.09-50-arm-none-linux-gnueabi-i686-pc-linux-gnu/usr --with-libelf=/scratch/nathan/arm-lite/obj/host-libs-2010.09-50-arm-none-linux-gnueabi-i686-pc-linux-gnu/usr --disable-libgomp --enable-poison-system-directories --with-build-time-tools=/scratch/nathan/arm-lite/install/arm-none-linux-gnueabi/bin --with-build-time-tools=/scratch/nathan/arm-lite/install/arm-none-linux-gnueabi/bin
Thread model: posix
gcc version 4.5.1 (Sourcery G++ Lite 2010.09-50)
Comment 1 Mikael Pettersson 2011-03-29 07:43:35 UTC
That's a heavily modified compiler by CodeSourcery.  Please reproduce with a vanilla FSF GCC, or report the problem to CodeSourcery as their compiler clearly directs you to do (see the --with-bugurl= setting).
Comment 2 Ian Bolton 2011-03-29 16:23:26 UTC
I get the same thing when I use r171282 of FSF 4.5 branch.

arm-none-linux-gnueabi-gcc pr48325.c -mfloat-abi=softfp -mfpu=neon -O1 
pr48325.c: In function 'test':
pr48325.c:19:1: error: insn does not satisfy its constraints:
(insn 40 38 26 2 /work/ianbol01/cross-build/gcc45-r171282-thumb/arm-none-linux-gnueabi/tools/lib/gcc/arm-none-linux-gnueabi/4.5.3/include/arm_neon.h:10277 (set (reg:OI 95 d16 [orig:152 __b ] [152])
        (mem/s/c:OI (pre_dec:SI (reg/f:SI 3 r3 [151])) [0 __b+0 S32 A64])) 731 {*neon_movoi} (expr_list:REG_INC (reg/f:SI 3 r3 [151])
        (nil)))
pr48325.c:19:1: internal compiler error: in reload_cse_simplify_operands, at postreload.c:396


Here is the command-line just for cc1:

cc1 -quiet pr48325.c -mfloat-abi=softfp -mfpu=neon -marm -mcpu=cortex-a9 -O1


Doesn't work for thumb either.

It also fails on trunk.

There are two other bugs in flight that manifest in reload_cse_simplify_operands: PR48250 (broke on trunk for EABI, works on 4.5 for EABI) and PR42949 (works on EABI for trunk and gcc4.5, broke for OABI).

I do not know if they are duplicates of each other, or if there are two or more separate bugs causing this.