This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

c/6689: GCC-3.1: ICE / insn does not satisfy its constraints



>Number:         6689
>Category:       c
>Synopsis:       GCC-3.1: ICE / insn does not satisfy its constraints
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          ice-on-legal-code
>Submitter-Id:   net
>Arrival-Date:   Fri May 17 02:36:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Jukka Suomela
>Release:        gcc (GCC) 3.1
>Organization:
>Environment:
sparc-sun-solaris2.7
>Description:
Output generated by "gcc -v -save-temps -O2 -c test.c":
------
Reading specs from /usr/local/gcc-3.1/lib/gcc-lib/sparc-sun-solaris2.7/3.1/specs
Configured with: ../gcc-3.1/configure --prefix=/usr/local/gcc-3.1
Thread model: posix
gcc version 3.1
 /usr/local/gcc-3.1/lib/gcc-lib/sparc-sun-solaris2.7/3.1/cpp0 -lang-c -v -iprefix /usr/local/bin/../lib/gcc-lib/sparc-sun-solaris2.7/3.1/ -D__GNUC__=3 -D__GNUC_MINOR__=1 -D__GNUC_PATCHLEVEL__=0 -Dsparc -Dsun -Dunix -D__svr4__ -D__SVR4 -D__PRAGMA_REDEFINE_EXTNAME -D__sparc__ -D__sun__ -D__unix__ -D__svr4__ -D__SVR4 -D__PRAGMA_REDEFINE_EXTNAME -D__sparc -D__sun -D__unix -Asystem=unix -Asystem=svr4 -D__OPTIMIZE__ -D__STDC_HOSTED__=1 -D__SIZE_TYPE__=unsigned int -D__PTRDIFF_TYPE__=int -D__WCHAR_TYPE__=long int -D__WINT_TYPE__=long int -D__GCC_NEW_VARARGS__ -Acpu=sparc -Amachine=sparc test.c test.i
GNU CPP version 3.1 (cpplib) (sparc ELF)
ignoring nonexistent directory "/usr/local/lib/gcc-lib/sparc-sun-solaris2.7/3.1/include"
ignoring nonexistent directory "/usr/local/lib/gcc-lib/sparc-sun-solaris2.7/3.1/../../../../sparc-sun-solaris2.7/include"
ignoring nonexistent directory "/usr/local/gcc-3.1/sparc-sun-solaris2.7/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/local/gcc-3.1/include
 /usr/local/gcc-3.1/lib/gcc-lib/sparc-sun-solaris2.7/3.1/include
 /usr/include
End of search list.
 /usr/local/gcc-3.1/lib/gcc-lib/sparc-sun-solaris2.7/3.1/cc1 -fpreprocessed test.i -quiet -dumpbase test.c -O2 -version -o test.s
GNU CPP version 3.1 (cpplib) (sparc ELF)
GNU C version 3.1 (sparc-sun-solaris2.7)
        compiled by GNU C version 3.1.
test.c: In function `bar':
test.c:30: insn does not satisfy its constraints:
(insn 337 62 57 (set (reg:SI 8 %o0)
        (reg/f:SI 184)) 51 {*movsi_insn} (nil)
    (nil))
test.c:30: Internal compiler error in reload_cse_simplify_operands, at reload1.c:8368
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
------

Similar results with -O3. No problem with -O. No problem on FreeBSD/i386 platform.

See the preprocessed (test.i) source code in "How-To-Repeat" section.

The sample code is a modified and simplified version of progs/infocomp.c from GNU ncurses-5.2 package, original code Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. I noticed the bug as "configure && make" of ncurses-5.2 failed after installing gcc-3.1.
>How-To-Repeat:
# 1 "test.c"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "test.c"
typedef struct {
    char *a;
} X;

static X x[2];
static int c;

int foo(short);

int bar(int k, int l) {
    X *p;
    int y = 0;
    switch (k) {
    case 0:
        for (p = &x[1]; p < x + c; p++)
            if (p->a[l] == 1) {
                y = x[0].a[l];
                break;
            }
        return y != x[0].a[l];
    case 1:
        for (p = &x[1]; p < x + c; p++)
            if (p->a[l] == 1) {
                y = x[0].a[l];
                break;
            }
        return y != x[0].a[l];
    }
    return 0;
}
>Fix:
Using -O seems to work as a workaround.
>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]