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]

[Bug tree-optimization/17111] New: tree check ICE in value_insert_into_set_bitmap on inlining a memcmp-like function


If I try to compile a file that looks like this at -O3:

int memcmp_like(const void *v1, const void *v2, int count) {
    int i;
    const char *s1 = (const char *)v1, *s2 = (const char *)v2;
    for (i = 0; i < count; i++) {
        if (s1[i] != s2[i])
            return 1;
    }
    return 0;
}
int g(void);
int f(void) {
    return memcmp_like ("hello", "bye", g()) + 5;
}

recent GCC development snapshots die with the following message:

bad.c:11: internal compiler error: tree check: expected value_handle, have
addr_expr in value_insert_into_set_bitmap, at tree-ssa-pre.c:471

For instance, if the attached file is named "bad.c", I get an error
from

gcc -O3 -c bad.c

I can reproduce this with a recent version of the Debian "gcc-snapshot"
package, which is the 20040717 snapshot configured as follows:
Configured with: ../src/configure -v --enable-languages=c,c++,java,f95,objc
--prefix=/usr/lib/gcc-snapshot --enable-shared --with-system-zlib --enable-nls
--enable-threads=posix --without-included-gettext --disable-werror
--enable-__cxa_atexit --enable-libstdcxx-allocator=mt --enable-clocale=gnu
--enable-libstdcxx-debug --enable-java-gc=boehm --enable-java-awt=gtk i486-linux-gnu

or with a fresh checkout from CVS, 3.5.0 20040819 configured with no arguments
on an i686.

The problem seems to be triggered by inlining, since it's present under "-O3"
and "-O2 -finline-functions" but not "-O2" or "-O3 -fno-inline".

-- 
           Summary: tree check ICE in value_insert_into_set_bitmap on
                    inlining a memcmp-like function
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: smcc at MIT dot EDU
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-linux-gnu
  GCC host triplet: i686-linux-gnu
GCC target triplet: i486-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17111


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