target/8340: [mainline regression] ICE on x86 inline asm w/ -fPIC

Glen Nakamura glen@imodulo.com
Thu Oct 24 10:40:00 GMT 2002


http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8340

On second thought, maybe this really is invalid code when compiled w/ -fPIC?
gcc-3.2.1 silently generates the following incorrect code:

00000000 <foo>:
   0:	55                   	push   %ebp
   1:	89 e5                	mov    %esp,%ebp
   3:	53                   	push   %ebx
   4:	e8 00 00 00 00       	call   9 <foo+0x9>
   9:	5b                   	pop    %ebx
   a:	81 c3 03 00 00 00    	add    $0x3,%ebx
  10:	31 db                	xor    %ebx,%ebx
  12:	89 9b 00 00 00 00    	mov    %ebx,0x0(%ebx)
  18:	8b 83 00 00 00 00    	mov    0x0(%ebx),%eax
  1e:	5b                   	pop    %ebx
  1f:	5d                   	pop    %ebp
  20:	c3                   	ret    

A better error message would be nice, especially for gcc-3.2.1,
but this isn't a high priority since the code seems invalid to me.

- glen



More information about the Gcc-bugs mailing list