From mboxrd@z Thu Jan 1 00:00:00 1970 From: exco@ligim.univ-lyon1.fr To: gcc-gnats@gcc.gnu.org Subject: c/2588: Bad alignment when passing structure by value to function Date: Thu, 19 Apr 2001 06:16:00 -0000 Message-id: <20010419131535.30051.qmail@sourceware.cygnus.com> X-SW-Source: 2001-04/msg00339.html List-Id: >Number: 2588 >Category: c >Synopsis: Bad alignment when passing structure by value to function >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: wrong-code >Submitter-Id: net >Arrival-Date: Thu Apr 19 06:16:01 PDT 2001 >Closed-Date: >Last-Modified: >Originator: Thierry EXCOFFIER >Release: gcc version 2.95.3 20010315 (release) >Organization: >Environment: IRIX b710sibn 6.5 01101246 IP32 >Description: For some structure size, when the structure is passed by value to a function, its content is incorrect. >How-To-Repeat: /* The problem always appear when size D+F > 16 and F odd */ #define D 14 #define F 3 typedef struct { int a[D] ; } DoubleAlignment ; typedef struct { int a[F] ; } FloatAlignment ; void display(FloatAlignment x, DoubleAlignment y) { int i ; for(i=0;iFix: Use -O3 option when compiling. >Release-Note: >Audit-Trail: >Unformatted: