This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/35658] [4.3/4.4 regression] Bad interaction on ia64 between -funroll-loops -fno-automatic -O2 and common block variable
- From: "sje at cup dot hp dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 5 Jun 2008 23:02:07 -0000
- Subject: [Bug target/35658] [4.3/4.4 regression] Bad interaction on ia64 between -funroll-loops -fno-automatic -O2 and common block variable
- References: <bug-35658-15955@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #7 from sje at cup dot hp dot com 2008-06-05 23:02 -------
I now think this is a register scheduling bug. If I use -fno-schedule-insns2
then the bug doesn't happen even with "-O2 fno-automatic -frename-registers".
The problem seems to be scheduling the assignment to TEMP2 and assigning TEMP2
to F(K).
In the good code, in C201S I see the following instructions, in this order:
addl r17 = @gprel(temp2.717#), gp - r17 is addr of temp2
stfd [r17] = f0 - zero out temp2
(p11) stfd [r17] = f10 - (maybe) put value (2.0) in temp2
ldfd f9 = [r17] - load temp2
add r16 = r34, r37 - r16 is addr of F(1)
stfd [r16] = f9 - store temp2 in F(1)
In the bad code (with instruction scheduling turned on) I see:
addl r17 = @gprel(temp2.717#), gp - r17 is addr of temp2
add r16 = r34, r37 - r16 is addr of F(1)
ldfd f9 = [r17] - load temp2
stfd [r17] = f0 - zero out temp2
stfd [r16] = f9 - store (old) temp2 in F(1)
(p11) stfd [r17] = f10 - (maybe) put value (2.0) in temp2
The store into F(1) is done before we have put the correct value int temp2.
I don't understand how instruction scheduling could be this broken.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35658