egcs-1.1 unrecognizable insn on HPPA with -fPIC
Bruno Haible
haible@ilog.fr
Wed Oct 28 14:22:00 GMT 1998
Hi,
Compiling the program given below gives an internal compiler error.
$ gcc -v
Reading specs from /nfs/ishare/lib/egcs/1.1b/hppa1.1-hp-hpux10.20/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.91.57/specs
gcc version egcs-2.91.57 19980901 (egcs-1.1 release)
$ gcc -O -fPIC -S bug.c
bug.c: In function `alloc_trampoline':
bug.c:15: internal error--unrecognizable insn:
(insn 32 30 34 (set (reg:SI 99)
(plus:SI (reg:SI 19 %r19)
(high:SI (symbol_ref/v:SI ("@tramp"))))) -1 (nil)
(expr_list:REG_DEAD (reg:SI 19 %r19)
(nil)))
toplev.c:1360: Internal compiler error in function fatal_insn
$ gcc -O -fPIC -S bug.c -v
Reading specs from /nfs/ishare/lib/egcs/1.1b/hppa1.1-hp-hpux10.20/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.91.57/specs
gcc version egcs-2.91.57 19980901 (egcs-1.1 release)
/nfs/ishare/lib/egcs/1.1b/hppa1.1-hp-hpux10.20/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.91.57/cpp -lang-c -v -undef -D__GNUC__=2 -D__GNUC_MINOR__=91 -Dhppa -Dhp9000s800 -D__hp9000s800 -Dhp9k8 -DPWB -Dhpux -Dunix -D__hppa__ -D__hp9000s800__ -D__hp9000s800 -D__hp9k8__ -D__PWB__ -D__hpux__ -D__unix__ -D__hppa -D__hp9000s800 -D__hp9k8 -D__PWB -D__hpux -D__unix -Asystem(unix) -Asystem(hpux) -Acpu(hppa) -Amachine(hppa) -D__OPTIMIZE__ -D__hp9000s700 -D_PA_RISC1_1 -D_HPUX_SOURCE -D_HIUX_SOURCE bug.c /var/tmp/cc8wmC5g.i
GNU CPP version egcs-2.91.57 19980901 (egcs-1.1 release) (hppa)
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include
/nfs/ishare/lib/egcs/1.1b/hppa1.1-hp-hpux10.20/hppa1.1-hp-hpux10.20/include
/nfs/ishare/lib/egcs/1.1b/hppa1.1-hp-hpux10.20/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.91.57/include
/usr/include
End of search list.
/nfs/ishare/lib/egcs/1.1b/hppa1.1-hp-hpux10.20/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.91.57/cc1 /var/tmp/cc8wmC5g.i -quiet -dumpbase bug.c -O -version -fPIC -o bug.s
GNU C version egcs-2.91.57 19980901 (egcs-1.1 release) (hppa1.1-hp-hpux10.20) compiled by GNU C version egcs-2.91.57 19980901 (egcs-1.1 release).
bug.c: In function `alloc_trampoline':
bug.c:15: internal error--unrecognizable insn:
(insn 32 30 34 (set (reg:SI 99)
(plus:SI (reg:SI 19 %r19)
(high:SI (symbol_ref/v:SI ("@tramp"))))) -1 (nil)
(expr_list:REG_DEAD (reg:SI 19 %r19)
(nil)))
toplev.c:1360: Internal compiler error in function fatal_insn
============================= bug.c =====================================
typedef int (*TR_function) ();
extern void tramp ();
extern void* malloc (unsigned int size);
TR_function alloc_trampoline (address, variable, data)
TR_function address;
void* variable;
void* data;
{
char* function;
char* room = malloc(sizeof(void*) + 20 + 16 -1);
function = (char*)(((long)room + sizeof(void*) + 16 -1) & - 16 );
((char**)function)[-1] = room;
*(long *) (function + 0) = ((long *) ((char*)&tramp-2))[0];
return (TR_function) (function + 2 );
}
=========================================================================
Regards,
Bruno
----------------------------------------------------------------------------
Bruno Haible email: <haible@ilog.fr>
ILOG S.A. tel: +33 1 4908 3585
9, rue de Verdun - BP 85 fax: +33 1 4908 3510
94253 Gentilly Cedex url: http://www.ilog.fr/
France running Sparc-Linux-BSD-GNU-X11-KDE
More information about the Gcc-bugs
mailing list