This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Debugging help; how to debug something wrong in the rtl withoptimisation
- To: gcc at gcc dot gnu dot org
- Subject: Debugging help; how to debug something wrong in the rtl withoptimisation
- From: Dave Gilbert <gilbertd at treblig dot org>
- Date: Sun, 11 Feb 2001 14:11:42 +0000 (GMT)
Hi,
(Re bug Optimization/1931)
As reported in the bug reference above I'm having problems crossing from
Alpha->68k.
The problem appears to be a floating point comparision with 0 is turning
into a comparision with -1.08709117743770659141e-1257 - I guess thats
close - but the assembler really doesn't like that.
So time to ask for some intermediate dumps; given the code:
typedef float DFtype __attribute__ ((mode (DF)));
crossbug (DFtype a)
{
int v=0;
if (a < 0)
v=1;
return v;
}
in the .00.rtl file is :
(insn 12 10 14 (set (reg:DF 31)
(const_double:DF (cc0) -5787213827046178816 [0xafafafafafaf0000]
-5787213827046133841 [0xafafafafafafafaf])) -1 (nil)
(expr_list:REG_EQUAL (const_double:DF (cc0) -5787213827046178816
[0xafafafafafaf0000] -5787213827046133841 [0xafafafafafafafaf])
(nil)))
But that only lands in there with -O2 - so how do I find out what caused
that transformation? With -O1 we get:
(jump_insn 14 13 15 (set (pc)
(if_then_else (lt (cc0)
(const_int 0 [0x0]))
(label_ref 17)
(pc))) -1 (nil)
(nil))
So I guess it is the transformation of the integer 0 into the double?
In the generated assembler we see:
|(insn:QI 14 44 15 (set (cc0)
| (compare (reg:DF 16 %fp0)
| (const_double:DF (cc0) -5787213827046178816
[0xafafafafafaf0000] -5787213827046133841 [0xafafafafafafafaf]))) 16
{*m68k.md:676} (insn_list 44 (nil))
| (expr_list:REG_DEAD (reg:DF 16 %fp0)
| (nil)))
fcmp.d #0r-1.08709117743770659141e-1257,%fp0 | 14
*m68k.md:676/1
Suggestions on where to look for this would be welcome. dconst0 in
emit-rtl.c looks OK to me.
Is there any way to trace the RTL generation process to see where it
produces that?
Dave
--
---------------- Have a happy GNU millennium! ----------------------
/ Dr. David Alan Gilbert | Running GNU/Linux on Alpha, | Happy \
\ gro.gilbert @ treblig.org | 68K,MIPS,x86,ARM and SPARC | In Hex /
\ ___________________________|___ http://www.treblig.org |_______/