This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Is this a known problem?
- From: Martin Kahlert <martin dot kahlert at infineon dot com>
- To: gcc at gcc dot gnu dot org
- Date: Fri, 23 Nov 2001 13:04:11 +0100
- Subject: Is this a known problem?
- Reply-to: martin dot kahlert at infineon dot com
Hi!
I think, that i have found a compiler bug in gcc 2.95.3 20010315 (release)
on Linux.
The source file is very large and i cannot post it complete.
Here are the bad lines:
if (model->trnqsMod) <--- line 2997
{ out->qcdump = qdef * ScalingFactor;
out->capdump = ScalingFactor;
}
else
{ out->qcdump = qdef * ScalingFactor;
out->capdump = ScalingFactor;
}
(Yes i know, that does not make sense a lot).
gcc -O -g generates this code:
.L497:
.stabn 68,0,2997,.LM2035-b41eva
.LM2035:
movl 12(%ebp),%eax
fldl 80(%eax) <--- where is this pushed again?
.stabn 68,0,3002,.LM2036-b41eva
.LM2036:
fldl -1888(%ebp)
fmull .LC15
fstpl 688(%edi)
.stabn 68,0,3003,.LM2037-b41eva
.LM2037:
fldl .LC15
fstpl 696(%edi)
.stabn 68,0,3006,.LM2038-b41eva
.LM2038:
fldl -328(%ebp)
fstpl 472(%edi)
.stabn 68,0,3007,.LM2039-b41eva
if i change the code so, that the blocks are different:
if (model->trnqsMod)
{ out->qcdump = qdef * ScalingFactor;
out->capdump = ScalingFactor;
}
else
{ out->qcdump = qdef * ScalingFactor;
out->capdump = ScalingFactor;
}
then gcc generates this code:
.L497:
.stabn 68,0,2997,.LM2035-b41eva
.LM2035:
movl 12(%ebp),%eax
fldl 80(%eax)
fldz
fucompp
fnstsw %ax
andb $69,%ah
cmpb $64,%ah
je .L500
.stabn 68,0,2998,.LM2036-b41eva
.LM2036:
fldl -1888(%ebp)
fadd %st(0),%st
fmull .LC15
fstpl 688(%edi)
.stabn 68,0,2999,.LM2037-b41eva
.LM2037:
fldl .LC15
fadd %st(0),%st
.stabn 68,0,3000,.LM2038-b41eva
.LM2038:
jmp .L538
.p2align 4,,7
.L500:
.stabn 68,0,3002,.LM2039-b41eva
.LM2039:
fldl -1888(%ebp)
fmull .LC15
fstpl 688(%edi)
.stabn 68,0,3003,.LM2040-b41eva
.LM2040:
fldl .LC15
.L538:
fstpl 696(%edi)
.stabn 68,0,3006,.LM2041-b41eva
.LM2041:
fldl -328(%ebp)
fstpl 472(%edi)
.stabn 68,0,3007,.LM2042-b41eva
Seems to be an optimization bug. gcc-3.0.* gets that right.
I get very strange errors from that on totally unrelated lines.
Is there a known fix to 2.93.3? The problem is, that i use this version as a cross compiler
for Windows (Mingw).
Thanks for any hint in advance,
Martin.
--
The early bird catches the worm. If you want something else for
breakfast, get up later.