This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/2182: Internal compiler error in latest gcc (trunk & gcc 3) using -fpic
- To: gcc-gnats at gcc dot gnu dot org
- Subject: c++/2182: Internal compiler error in latest gcc (trunk & gcc 3) using -fpic
- From: fnf at ninemoons dot com
- Date: Mon, 5 Mar 2001 10:19:13 -0700
- Cc: fnf at ninemoons dot com
- Reply-To: fnf at ninemoons dot com
>Number: 2182
>Category: c++
>Synopsis: Internal compiler error in latest gcc (trunk & gcc 3 branch) using -fpic
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: ice-on-legal-code
>Submitter-Id: net
>Arrival-Date: Mon Mar 05 09:26:04 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:
>Release: 2.97 20010201 (experimental)
>Organization:
none
>Environment:
System: Linux fishpond 2.2.16-22smp #1 SMP Tue Aug 22 16:39:21 EDT 2000 i686 unknown
Architecture: i686
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: /src/sourceware/gcc/gcc/configure -v --prefix=/usr/sourceware
>Description:
Gcc produces an internal compiler error using the provided preprocessed testcase.
I've tested the latest head of the development trunk, as well as the gcc 3 branch.
>How-To-Repeat:
Script started on Mon Mar 5 10:01:52 2001
$ ./cc1plus -quiet bug.ii
$ ./cc1plus -quiet -fpic bug.ii
MPEGyuv2rgb.cpp: In function `void yuv2rgb(unsigned char*, const unsigned
char*, const unsigned char*, const unsigned char*, int, int, int)':
MPEGyuv2rgb.cpp:250: Internal compiler error in instantiate_virtual_regs_1, at
function.c:3911
Please submit a full bug report, with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
$ cat bug.ii
# 1 "MPEGyuv2rgb.cpp"
# 1 "MPEGyuv2rgb.h" 1
extern "C" {
void yuv2rgb(unsigned char * destination,
const unsigned char * Y,
const unsigned char * Cb,
const unsigned char * Cr,
int width, int height, int stride);
}
# 2 "MPEGyuv2rgb.cpp" 2
void yuv2rgb(unsigned char * destination,
const unsigned char * Y,
const unsigned char * Cb,
const unsigned char * Cr,
int width, int height, int stride)
{
static const unsigned short delta[] = {
0x8080, 0x8080, 0x8080, 0x8080,
0x00ff, 0x00ff, 0x00ff, 0x0000 };
static const short scale[] = {
short(1.732 * 256), short(-0.336 * 256), 0, 0,
0, short(-0.698 * 256), short(1.371 * 256), 0 };
asm volatile(
"2:"
"pushl %0\n"
"pushl %6\n"
"1:"
"movq (%1),%%mm0\n"
"movq (%2),%%mm1\n"
"psubb %4,%%mm0\n"
"psubb %4,%%mm1\n"
"punpcklbw %%mm0,%%mm0\n"
"movq %%mm0,%%mm4\n"
"punpcklbw %%mm1,%%mm1\n"
"movq %%mm1,%%mm5\n"
"punpcklwd %%mm0,%%mm0\n"
"punpcklwd %%mm1,%%mm1\n"
"movq %%mm0,%%mm2\n"
"punpckldq %%mm0,%%mm0\n"
"movq %%mm1,%%mm3\n"
"punpckhdq %%mm2,%%mm2\n"
"pmulhw %5,%%mm0\n"
"punpckldq %%mm1,%%mm1\n"
"pmulhw 8+%5,%%mm1\n"
"punpckhdq %%mm3,%%mm3\n"
"pmulhw %5,%%mm2\n"
"punpckhwd %%mm4,%%mm4\n"
"movq %%mm4,%%mm6\n"
"punpckhwd %%mm5,%%mm5\n"
"pmulhw 8+%5,%%mm3\n"
"punpckldq %%mm4,%%mm4\n"
"pmulhw %5,%%mm4\n"
"punpckhdq %%mm6,%%mm6\n"
"pmulhw %5,%%mm6\n"
"movq %%mm5,%%mm7\n"
"punpckldq %%mm5,%%mm5\n"
"paddsw %%mm1,%%mm0\n"
"pmulhw 8+%5,%%mm5\n"
"punpckhdq %%mm7,%%mm7\n"
"pmulhw 8+%5,%%mm7\n"
"paddsw %%mm3,%%mm2\n"
"paddsw %%mm5,%%mm4\n"
"paddsw %%mm7,%%mm6\n"
"movq (%8),%%mm1\n"
"punpcklbw %%mm1,%%mm1\n"
"movq %%mm1,%%mm5\n"
"punpcklwd %%mm1,%%mm1\n"
"punpckhwd %%mm5,%%mm5\n"
"movq %%mm1,%%mm3\n"
"movq %%mm5,%%mm7\n"
"punpckldq %%mm1,%%mm1\n"
"punpckldq %%mm5,%%mm5\n"
"pand 8+%4,%%mm1\n"
"punpckhdq %%mm3,%%mm3\n"
"paddsw %%mm0,%%mm1\n"
"pand 8+%4,%%mm5\n"
"punpckhdq %%mm7,%%mm7\n"
"pand 8+%4,%%mm3\n"
"paddsw %%mm2,%%mm5\n"
"pand 8+%4,%%mm7\n"
"paddsw %%mm0,%%mm3\n"
"packuswb %%mm3,%%mm1\n"
"paddsw %%mm2,%%mm7\n"
"packuswb %%mm7,%%mm5\n"
"movq %%mm1,0x00(%0)\n"
"movq %%mm5,0x08(%0)\n"
"movq (%8),%%mm1\n"
"punpckhbw %%mm1,%%mm1\n"
"movq %%mm1,%%mm5\n"
"punpcklwd %%mm1,%%mm1\n"
"punpckhwd %%mm5,%%mm5\n"
"movq %%mm1,%%mm3\n"
"movq %%mm5,%%mm7\n"
"punpckldq %%mm1,%%mm1\n"
"punpckldq %%mm5,%%mm5\n"
"pand 8+%4,%%mm1\n"
"punpckhdq %%mm3,%%mm3\n"
"paddsw %%mm4,%%mm1\n"
"pand 8+%4,%%mm5\n"
"punpckhdq %%mm7,%%mm7\n"
"pand 8+%4,%%mm3\n"
"paddsw %%mm6,%%mm5\n"
"pand 8+%4,%%mm7\n"
"paddsw %%mm4,%%mm3\n"
"packuswb %%mm3,%%mm1\n"
"paddsw %%mm6,%%mm7\n"
"packuswb %%mm7,%%mm5\n"
"movq %%mm1,0x10(%0)\n"
"movq %%mm5,0x18(%0)\n"
"addl (%%esp),%8\n"
"movq (%8),%%mm1\n"
"punpcklbw %%mm1,%%mm1\n"
"movq %%mm1,%%mm5\n"
"punpcklwd %%mm1,%%mm1\n"
"punpckhwd %%mm5,%%mm5\n"
"movq %%mm1,%%mm3\n"
"movq %%mm5,%%mm7\n"
"punpckldq %%mm1,%%mm1\n"
"punpckldq %%mm5,%%mm5\n"
"pand 8+%4,%%mm1\n"
"punpckhdq %%mm3,%%mm3\n"
"paddsw %%mm0,%%mm1\n"
"pand 8+%4,%%mm5\n"
"punpckhdq %%mm7,%%mm7\n"
"pand 8+%4,%%mm3\n"
"paddsw %%mm2,%%mm5\n"
"pand 8+%4,%%mm7\n"
"paddsw %%mm0,%%mm3\n"
"packuswb %%mm3,%%mm1\n"
"paddsw %%mm2,%%mm7\n"
"packuswb %%mm7,%%mm5\n"
"movq %%mm1,0x00(%0,%3)\n"
"movq %%mm5,0x08(%0,%3)\n"
"movq (%8),%%mm1\n"
"punpckhbw %%mm1,%%mm1\n"
"movq %%mm1,%%mm5\n"
"punpcklwd %%mm1,%%mm1\n"
"punpckhwd %%mm5,%%mm5\n"
"movq %%mm1,%%mm3\n"
"movq %%mm5,%%mm7\n"
"punpckldq %%mm1,%%mm1\n"
"punpckldq %%mm5,%%mm5\n"
"pand 8+%4,%%mm1\n"
"punpckhdq %%mm3,%%mm3\n"
"paddsw %%mm4,%%mm1\n"
"pand 8+%4,%%mm5\n"
"punpckhdq %%mm7,%%mm7\n"
"pand 8+%4,%%mm3\n"
"paddsw %%mm6,%%mm5\n"
"pand 8+%4,%%mm7\n"
"paddsw %%mm4,%%mm3\n"
"packuswb %%mm3,%%mm1\n"
"paddsw %%mm6,%%mm7\n"
"packuswb %%mm7,%%mm5\n"
"movq %%mm1,0x10(%0,%3)\n"
"movq %%mm5,0x18(%0,%3)\n"
"subl (%%esp),%8\n"
"addl $32,%0\n"
"addl $4,%1\n"
"addl $4,%2\n"
"addl $8,%8\n"
"subl $8,%6\n"
"jg 1b\n"
"popl %6\n"
"popl %0\n"
"addl %6,%8\n"
"leal (%0,%3,2),%0\n"
"subl $2,%7\n"
"jg 2b\n"
"emms\n"
:
: "r" (destination), "r" (Cb), "r" (Cr), "r" (stride),
"m" (delta), "m" (scale), "m" (width), "m" (height), "r" (Y)
);
}
$ exit
Script done on Mon Mar 5 10:02:14 2001
>Fix:
Workaround is to compile without -fpic.
>Release-Note:
>Audit-Trail:
>Unformatted: