🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.g++.bug
Article #1300

gcc2.3.[12] sparc-sun fails on ul = us = l = s = -1

#1300
From: Robert R. Henry
Date: Fri, 18 Dec 1992 16:58
43 lines
1909 bytes
When running gcc2.3.[12] with and without -O target==host==sparc-sun-sunos4.1
on the following program the chained assignment
	ul = us = l2 = s2 = -1;
ends up assigning to ul 0xffffffff instead of 0x0000ffff, thus
violating the semantics of assignment.
Reducing the length of the chain produces the proper thing.

Reading specs from /usr/local/lib/gcc-lib/sparc-sun/2.3.2/specs
gcc version 2.3.2
 /usr/local/lib/gcc-lib/sparc-sun/2.3.2/cpp -lang-c -v -undef -D__GNUC__=2 -Dsparc -Dsun -Dunix -D__sparc__ -D__sun__ -D__unix__ -D__sparc -D__sun -D__unix -D__OPTIMIZE__ bug2.c /usr/tmp/cca26873.i
GNU CPP version 2.3.2 (sparc)
 /usr/local/lib/gcc-lib/sparc-sun/2.3.2/cc1 /usr/tmp/cca26873.i -quiet -dumpbase bug2.c -O -version -o /usr/tmp/cca26873.s
GNU C version 2.3.2 (sparc) compiled by GNU C version 2.3.2.
 /usr/local/lib/gcc-lib/sparc-sun/2.3.2/as -o /usr/tmp/cca268731.o /usr/tmp/cca26873.s
 /usr/local/lib/gcc-lib/sparc-sun/2.3.2/ld -e start -dc -dp /lib/crt0.o -L/usr/local/lib/gcc-lib/sparc-sun/2.3.2 -L/usr/local/lib /usr/tmp/cca268731.o -lgcc -lc -lgcc

#include <stdio.h>

main()
{
	long l1, l2;
	unsigned short us;
	unsigned long  ul;
	short s1,s2;

	ul = us = l2 = s2 = -1;
	printf("ul=0x%08x\n", ul);
	printf("us=0x%08x\n", us);
	printf("l2=0x%08x\n", l2);
	printf("s2=0x%08x\n", s2);

	printf("\n");
	ul = us = -1;
	printf("ul=0x%08x\n", ul);
	printf("us=0x%08x\n", us);

	printf("\n");
	us = -1;
	ul = us;
	printf("ul=0x%08x\n", ul);
	printf("us=0x%08x\n", us);

}
Technical Details
Message-ID: <9212181658.AA28913@tera.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!tera.com!rrh

Show Full Headers
Complete Article Headers
Newsgroups: gnu.g++.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!tera.com!rrh
From: rrh@tera.com (Robert R. Henry)
Subject: gcc2.3.[12] sparc-sun fails on ul = us = l = s = -1
Message-ID: <9212181658.AA28913@tera.com>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
Distribution: gnu
Date: Fri, 18 Dec 1992 16:58:36 GMT
Approved: bug-g++@prep.ai.mit.edu
Lines: 44