Red Hat Bugzilla – Bug 121600
[PATCH] gcc -O/-O2 generate wrong code on structure modification
Last modified: 2007-11-30 17:07:01 EST
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
Description of problem:
More details of this compiler bug are at
For gcc version 3.2, use the test case acpi-gcc32-bug.c uploaded at
the above bugzilla.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. compile the test case with -O2
Actual Results: # gcc -v
Reading specs from /usr/lib/gcc-lib/x86_64-redhat-linux/3.2.3/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --
infodir=/usr/share/info --enable-shared --enable-threads=posix --
disable-checking --with-system-zlib --enable-__cxa_atexit --
Thread model: posix
gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-32)
# gcc -O2 ./acpi-gcc32-bug.c
# gcc -Os ./acpi-gcc32-bug.c
Created attachment 99754 [details]
This patch has been checked into gcc 3.3 and 3.4. I have verified that
it also fixes gcc 3.2.
I see this patch has been approved by Jan for HEAD (and after a week
on mainline for 3.3/3.4 as well) almost 2 weeks ago.
Are you going to commit it?
RHEL4 will pick it up with the next gcc-3_4-branch merge and RHEL3
I didn't check it into mainline. I thought Jan wanted to use a
slightly different approach in mainline. I did check it into gcc
3.3 and 3.4. Do you want me to check it into gcc 3.2 Red Hat
From what I understood he just wanted to keep the movsi_insv_1_rex64
pattern in i386.md in addition to the new movdi_insv_1_rex64.
I'll check this into gcc-3_2-rhl8-branch myself.
This fix will appear in gcc-3.2.3-35.
An errata has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.