public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Is this a known problem?
@ 2001-11-13 16:24 Martin Kahlert
  0 siblings, 0 replies; only message in thread
From: Martin Kahlert @ 2001-11-13 16:24 UTC (permalink / raw)
  To: gcc

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.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-11-23 12:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-11-13 16:24 Is this a known problem? Martin Kahlert

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).