No Subject

Rahul Sahadevan srahul@csa.iisc.ernet.in
Wed Apr 1 21:12:00 GMT 1998


Hi,
	I get an "illegal instruction" when I run the following program
after compiling it with egcs-1.0.2 on a sparc running solaris 2.4. ( It
works normally under an i586 running redhat-4.2 & egcs-1.0.2 ( compiled
on both machine as gcc -o program program.c )

-----------------------------------------------------------------------

/* Relevant part from:   gcc -E program.c   */

extern int	printf(const char *, ...);

typedef void (*builtin_func)();

int myprintf( char *format, ... ) {
  void *ARGS, *RESULT;
  ARGS = __builtin_apply_args();
  RESULT = __builtin_apply( (builtin_func)&printf, ARGS, 64 );
  __builtin_return( RESULT );
}

main() {
  myprintf( "%s: %d\n", "Hello world", 10 );
}

-----------------------------------------------------------------------

Using "dis" to disassemble  the binary shows:
        10ac8:  40 00 44 2c        call         printf
        10acc:  01 00 00 00        nop    
        10ad0:  00 00 0f ff        unimp        0xfff
				^^^^^^^^^^^^^^^^^^^^^^^ ??? Any ideas?

-----------------------------------------------------------------------

Output of "gcc -v"
Reading specs from /opt/EGCSgcc/lib/gcc-lib/sparc-sun-solaris2.4/egcs-2.90.27/specs
gcc version egcs-2.90.27 980315 (egcs-1.0.2 release)

-----------------------------------------------------------------------

Output of "uname -a"
SunOS bhrigu 5.4 Generic_101945-56 sun4m sparc

-----------------------------------------------------------------------

egcs-1.0.2 was configured as:
$SOMEDIR/configure --prefix=/opt/EGCSgcc --enable-shared

-----------------------------------------------------------------------

I get the same error with gcc version 2.7.2.3.f.1 also.

-----------------------------------------------------------------------

Any hints/comments would be appreciated,
Rahul S,
( srahul@csa.iisc.ernet.in )






More information about the Gcc-bugs mailing list