From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7706 invoked by alias); 2 Jun 2003 17:44:35 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 7650 invoked by uid 48); 2 Jun 2003 17:44:34 -0000 Date: Mon, 02 Jun 2003 17:44:00 -0000 From: "jourgun@club-internet.fr" To: gcc-bugs@gcc.gnu.org Message-ID: <20030602174433.11066.jourgun@club-internet.fr> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug optimization/11066] New: error in the optimization of packed structures X-Bugzilla-Reason: CC X-SW-Source: 2003-06/txt/msg00365.txt.bz2 List-Id: PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org. http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11066 Summary: error in the optimization of packed structures Product: gcc Version: 3.2.2 Status: UNCONFIRMED Severity: major Priority: P2 Component: optimization AssignedTo: unassigned@gcc.gnu.org ReportedBy: jourgun@club-internet.fr CC: gcc-bugs@gcc.gnu.org error in the optimization of packed structures, when using -O2 or -O3. preprossesor file: # 1 "test.c" # 1 "" # 1 "" # 1 "c:/djgpp/lib/gcc-lib/djgpp/3.23/djgpp.ver" 1 # 1 "c:/djgpp/include/sys/version.h" 1 3 # 2 "c:/djgpp/lib/gcc-lib/djgpp/3.23/djgpp.ver" 2 # 2 "" 2 # 1 "test.c" unsigned long long GateDescriptor(Offset,Segment,TypeDPL,ParamCount) unsigned long Offset; unsigned short Segment; unsigned char TypeDPL,ParamCount; { typedef struct { unsigned short Offset0_15; unsigned short Segment; unsigned char ParamCount; unsigned char TypeDPL; unsigned short Offset16_31; }Tdescripteur __attribute__ ((packed)); Tdescripteur Descripteur; Descripteur.Offset0_15=Offset; Descripteur.Offset16_31=Offset>>16; Descripteur.Segment=Segment; Descripteur.TypeDPL=TypeDPL; Descripteur.ParamCount=ParamCount; return *(unsigned long long*)&Descripteur; } int main(void){ printf("%llX",GateDescriptor(0x65B,0x08,0xEF,0)); getchar(); } Normaly, we would see : EF000008065B but we see: EF000000065B the complete command line is: gcc test.c -o test.exe -O2 I am working on DJGPP on Windows XP. ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.