c/7267: GCC 3.1 crash when using MMX code and -funroll-loops

hakonrk@fys.uio.no hakonrk@fys.uio.no
Wed Jul 10 16:56:00 GMT 2002


>Number:         7267
>Category:       c
>Synopsis:       GCC 3.1 crash when using MMX code and -funroll-loops
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          ice-on-legal-code
>Submitter-Id:   net
>Arrival-Date:   Wed Jul 10 16:36:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Haakon Riiser
>Release:        3.1
>Organization:
University of Oslo
>Environment:
System: Linux s 2.4.18 #2 Thu Jun 6 00:23:32 CEST 2002 i686 unknown
Architecture: i686

host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: /local/build/gcc/gcc-3.1/configure --prefix=/usr/local/gcc-3.1 --enable-languages=c --disable-nls

Also verified o
>Description:
When compiling the code shown in "How-To-Repeat" with optimization
and unroll-loops enabled, GCC 3.1 dies with an internal compiler
error.  The bug looks exactly the same in GCC 2.96 from Red Hat
Linux 7.2 and 7.3, but GCC 2.95.3 produces the following output:

foo.c: In function `foo':
foo.c:7: invalid `asm': invalid expression as operand
foo.c:8: invalid `asm': invalid expression as operand
foo.c:7: invalid `asm': invalid expression as operand
foo.c:8: invalid `asm': invalid expression as operand

The code compiles perfectly with all tested GCC versions when
"-funroll-loops" is not used.
>How-To-Repeat:
Compile with "gcc -c -O -funroll-loops foo.c".  Preprocessor
output follows:

# 1 "foo.c"
void
foo(char *dst, int w)
{
        int i;

        for (i = 0; i < 2; i++) {
                asm volatile ("movq %%mm0, %0\n" : "=X" (*(dst + w * 2)));
                asm volatile ("movq %%mm0, %0\n" : "=X" (*(dst + w * 2)));
                dst++;
        }
        asm volatile ("emms\n");
}
>Fix:
Work-around: Don't use -funroll-loops.
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gcc-bugs mailing list