Bug 52855 - ARM: Internal compiler error: in extract_insn, at recog.c:2109
Summary: ARM: Internal compiler error: in extract_insn, at recog.c:2109
Status: RESOLVED DUPLICATE of bug 50099
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.6.3
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-03 20:09 UTC by Mike Thompson
Modified: 2014-02-16 13:16 UTC (History)
4 users (show)

See Also:
Host:
Target: arm-linux-gnueabi
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
Preprocessed *.i* file that triggers the bug. See command line in description to trigger bug. (92.92 KB, text/plain)
2012-04-03 20:09 UTC, Mike Thompson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Thompson 2012-04-03 20:09:04 UTC
Created attachment 27080 [details]
Preprocessed *.i* file that triggers the bug.  See command line in description to trigger bug.

Using GCC 4.6.3 on Debian armhf to create ARMv6+VFP binaries for Raspberry Pi computer.  The compiler differs from the standard Debian Wheezy armhf as the configured with the options: --with-arch=armv6 --with-float=hard --with-fpu=vfp

The file that triggers the error mg.c from a build of the Perl package.  Test files and information to reproduce the error given below.

##
## GCC Version and Configurations Options 
##
## Note: --with-arch=armv6 --with-float=hard --with-fpu=vfp
##

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabihf/4.6/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: ../src/configure -v --with-pkgversion='Debian 4.6.3-1' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-plugin --enable-objc-gc --disable-sjlj-exceptions --with-arch=armv6 --with-float=hard --with-fpu=vfp --enable-checking=release --build=arm-linux-gnueabihf --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf
Thread model: posix
gcc version 4.6.3 (Debian 4.6.3-1)

##
## System Type and Information
##

Debian Wheezy armhf (hard float) install.

$ uname -a
Linux armor.home.lan 2.6.35.3-mx5 #1 PREEMPT Wed Mar 28 04:03:29 PDT 2012 armv7l GNU/Linux

$ cat /proc/cpuinfo
Processor       : ARMv7 Processor rev 5 (v7l)
BogoMIPS        : 999.42
Features        : swp half thumb fastmult vfp edsp neon vfpv3
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x2
CPU part        : 0xc08
CPU revision    : 5
Hardware        : Freescale MX53 LOCO Board
Revision        : 53321
Serial          : 0000000000000000

##
## Command Line To Reproduce Bug
##

gcc -DPERL_CORE -c -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64   -O2 -g -Wall   -W -Wextra -Wdeclaration-after-statement -Wendif-labels -Wc++-compat -Wwrite-strings -o cccPDUUP.o cccPDUUP.i

##
## Compiler Error Messages
##

mg.c: In function ‘Perl_magic_get’:
mg.c:1168:1: error: unrecognizable insn:
(insn 1708 1707 1709 69 (set (reg:SI 2 r2)
        (sign_extend:SI (mem/s/j:QI (plus:SI (reg:SI 0 r0)
                    (const_int 1681 [0x691])) [0 my_perl_54(D)->Iutf8cache+0 S1 A8]))) mg.c:967 -1
     (nil))
mg.c:1168:1: internal compiler error: in extract_insn, at recog.c:2109
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.6/README.Bugs> for instructions.
Preprocessed source stored into /tmp/ccsQAOCv.out file, please attach this to your bugreport.
$
Comment 1 Mike Thompson 2012-04-04 15:29:47 UTC
This bug can be reproduced using the standard gcc 4.6.3 packages that is part of the Debian wheezy armhf port.  The command line to trigger the bug is:

 gcc -DPERL_CORE -c -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64   -O2 -g -Wall   -W -Wextra -Wdeclaration-after-statement -Wendif-labels -Wc++-compat -Wwrite-strings -marm -march=armv6 -mfpu=vfp -o cccPDUUP.o cccPDUUP.

The regular Debian wheezy gcc is configured with the following options:

Configured with: ../src/configure -v --with-pkgversion='Debian 4.6.3-1' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-plugin --enable-objc-gc --disable-sjlj-exceptions --with-arch=armv7-a --with-float=hard --with-fpu=vfpv3-d16 --with-mode=thumb --enable-checking=release --build=arm-linux-gnueabihf --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf
Thread model: posix
Comment 2 Mans Rullgard 2012-10-24 13:38:10 UTC
Confirmed with 4.6.3 and -march=armv6 or higher at -O1 and higher, no other flags needed.  No error with 4.5, 4.7, or 4.8.

The Linaro 4.6 branch does not have the problem either, so whatever they've
added seems to fix it.
Comment 3 Mikael Pettersson 2012-10-27 13:26:47 UTC
The ICE is fixed by the patch for PR50099.  See especially
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50099#c6 which shows the same ICE in Perl as shown here.  Therefore I think this is a dup of PR50099.
Comment 4 Steinar Midtskogen 2012-11-16 09:48:36 UTC
I've run into the same bug.  The code below reproduces it:

#include <arm_neon.h>

static const __attribute__((aligned(16)))
int16_t c[][2][8] =
{
    { { 0 }, { 0 } }, { { 0 }, { 0 } }, { { 0 }, { 0 } }, { { 0 }, { 0 } },
    { { 0 }, { 0 } }, { { 0 }, { 0 } }, { { 0 }, { 0 } }, { { 0 }, { 0 } }
};


int16x8_t test2(int off)
{
    return vld1q_u8((uint8_t*)c[off][0]);
}

int16x8_t test(int off, uint8_t **c)
{
    static int8_t m[] = { 1, 2, 3 };
    long long cf = m[off];

    return vld1q_u8((uint8_t*)c[cf]);
}

Version: 4.6.3
Options: -mapcs-frame -mfloat-abi=softfp -mfpu=neon -flax-vector-conversions -O1

Changing "long long cf" into "int cf" eliminates the crash.
Comment 5 Ramana Radhakrishnan 2012-11-28 03:22:18 UTC
appears to be a dup of PR50099

*** This bug has been marked as a duplicate of bug 50099 ***
Comment 6 Jackie Rosen 2014-02-16 13:16:30 UTC Comment hidden (spam)