Description of problem: gcc 4.1.1 on Centos 4.5 x86_64 compiles fine a C code using __attribute((packed)) for a structure. Running Centos 5 x86_64, gcc 4.1.1 seems to silently ignores the attribute, and makes the resulting code computing wrong results. This behaviour under Centos 5 disappears if -O1 is used instead of -O2. CFLAGS used: -march=opteron -O2 -pipe. Version-Release number of selected component (if applicable): gcc (GCC) 4.1.1 20070105 (Red Hat 4.1.1-52) How reproducible: We use the code available here: http://www-icare.univ-lille1.fr/products/download/xrit_website/xrit-0.1.6.tar.gz The problem is data are not publicly available. I suppose any other code using __attribute((packed)) should show the same behaviour. Steps to Reproduce: 1. 2. 3. Actual results: zeroes are get from processing. (packed attribute ignored, but adresses calculated for a packed structure, so getting zeroes?) Expected results: We're supposed to get real numbers. Additional info:
Please create a self-contained testcase that shows the kind of problem you are talking about. There are zero changes in between RHEL4.5 and RHEL5 gcc{4,} that could affect this.
Please reopen when you have the requested information.