[gnu.gcc.bug] bug002

rajeevc@oriley.intel.com (09/28/89)

---bug002----

/*
	multiple assignments between different types
	i receives l's value instead of b's value
	maybe the same bug as #1 (implicit casting).
*/
unsigned long l;
unsigned char b;
int    i;
 
main()
{
    i = (b = (l = 0xaf2db93e));
	printf("\
			l=%x\n\
			b=%x\n\
			i=%x\n\
			",
			l, b, i);
}

	.file	"bug002.c"
	.version	"GNU C 1.36"
	.optim
gcc_compiled.:
	.text
.LC0:
	.byte	0x9,0x9,0x9,0x6c,0x3d,0x25,0x78,0xa,0x9,0x9
	.byte	0x9,0x62,0x3d,0x25,0x78,0xa,0x9,0x9,0x9,0x69
	.byte	0x3d,0x25,0x78,0xa,0x9,0x9,0x9,0x0
	.align 4
	.globl	main
main:
	movl $-1355957954,l
	movb $-1355957954,b    / movl $62,b
	movl $-1355957954,i    / movl $62,i
	pushl $-1355957954     / pushl $62
	movzbl b,%eax
	pushl %eax             / pushl $62
	pushl $-1355957954
	pushl $.LC0
	call printf
	addl $16,%esp
	ret
	.comm	i,4
	.comm	b,1
	.comm	l,4