🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #2037

GCC 1.31 mangles structure assignment on the SPARC

#2037
From: Charles Pilkington
Date: Thu, 08 Dec 1988 19:59
37 lines
1237 bytes
/*

  program illustrating problem with gcc structure assignment on the SPARC - 
  structure assignment code uses load and store double, which 
  craps out if structure is not on a double word boundary.

*/

struct s1 {
  int s1_foo1;
  int s1_foo2;
};

struct s2 {
    struct s1 s2_first;		/* this struct is on a double-word boundary */
    int s2_1;
    struct s1 s2_second;	/* ... and this struct is not		    */
};

struct s1 foo1;
struct s2 foo2;

main() {

    foo2.s2_first  = foo1;
    printf("we should get here\n");
    foo2.s2_second = foo1;
    printf("we should get here if structure assignment works\n");
}

-- 
Chuck Pilkington
	    Computer Systems Research Institute       University of Toronto
	    Usenet:	{linus, ihnp4, allegra, decvax, floyd}!utcsri!chuck
	    CSNET:	chuck@Toronto
	    ARPA:	chuck%Toronto@CSNet-Relay
Technical Details
Message-ID: <88Dec8.145929est.4327@turing.toronto.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!turing.toronto.edu!chuck

Show Full Headers
Complete Article Headers
Newsgroups: gnu.gcc.bug
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!turing.toronto.edu!chuck
From: chuck@turing.toronto.edu (Charles Pilkington)
Subject: GCC 1.31 mangles structure assignment on the SPARC
Message-ID: <88Dec8.145929est.4327@turing.toronto.edu>
Organization: University of Toronto, CSRI
Distribution: na
Date: Thu, 8 Dec 88 14:59:15 EST