public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug optimization/11066] New: error in the optimization of packed structures
@ 2003-06-02 17:44 jourgun@club-internet.fr
2003-06-02 17:58 ` [Bug optimization/11066] " pinskia@physics.uc.edu
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: jourgun@club-internet.fr @ 2003-06-02 17:44 UTC (permalink / raw)
To: gcc-bugs
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 "<built-in>"
# 1 "<command line>"
# 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 "<command line>" 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.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug optimization/11066] error in the optimization of packed structures
2003-06-02 17:44 [Bug optimization/11066] New: error in the optimization of packed structures jourgun@club-internet.fr
@ 2003-06-02 17:58 ` pinskia@physics.uc.edu
2005-06-05 8:24 ` [Bug rtl-optimization/11066] " pinskia at gcc dot gnu dot org
2005-06-05 8:24 ` pinskia at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: pinskia@physics.uc.edu @ 2003-06-02 17:58 UTC (permalink / raw)
To: gcc-bugs
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
pinskia@physics.uc.edu changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
------- Additional Comments From pinskia@physics.uc.edu 2003-06-02 17:58 -------
This is not a bug, you are violating ANSI/ISO C aliasing rules, you should be
using an union.
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug rtl-optimization/11066] error in the optimization of packed structures
2003-06-02 17:44 [Bug optimization/11066] New: error in the optimization of packed structures jourgun@club-internet.fr
2003-06-02 17:58 ` [Bug optimization/11066] " pinskia@physics.uc.edu
2005-06-05 8:24 ` [Bug rtl-optimization/11066] " pinskia at gcc dot gnu dot org
@ 2005-06-05 8:24 ` pinskia at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-06-05 8:24 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-06-05 08:23 -------
Reopening to ...
--
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |UNCONFIRMED
Resolution|INVALID |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11066
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug rtl-optimization/11066] error in the optimization of packed structures
2003-06-02 17:44 [Bug optimization/11066] New: error in the optimization of packed structures jourgun@club-internet.fr
2003-06-02 17:58 ` [Bug optimization/11066] " pinskia@physics.uc.edu
@ 2005-06-05 8:24 ` pinskia at gcc dot gnu dot org
2005-06-05 8:24 ` pinskia at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-06-05 8:24 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-06-05 08:24 -------
Mark as a dup of bug 21920.
*** This bug has been marked as a duplicate of 21920 ***
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |DUPLICATE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11066
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2005-06-05 8:24 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-02 17:44 [Bug optimization/11066] New: error in the optimization of packed structures jourgun@club-internet.fr
2003-06-02 17:58 ` [Bug optimization/11066] " pinskia@physics.uc.edu
2005-06-05 8:24 ` [Bug rtl-optimization/11066] " pinskia at gcc dot gnu dot org
2005-06-05 8:24 ` pinskia at gcc dot gnu dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).