|
From: <raf...@gm...> - 2006-10-29 02:05:22
|
Reducing a function in qt4 to fix a warning about a branch depending
on uninitialised values, I ended up with
--------------------------------
_ZN18QRasterPaintEngine12updateMatrixERK7QMatrix:
movl 4(%esp), %eax
movl 16(%eax), %ecx
fldz
fldz
fxch %st(1)
fucompp
fnstsw %ax
sahf
jp .L262
andb $128, 8761(%ecx)
fldz
fldz
fxch %st(1)
fucompp
fnstsw %ax
sahf
jp 1.L262
.L262:
ret
---------------------------------------
Note that the code does two identical fp compares. Valgrind gives a
warning only on the second "jp". If the "andb" instruction is removed,
the warning disappears.
Any suggestions on where to look in the code?
Thanks,
Rafael
|
|
From: Julian S. <js...@ac...> - 2006-10-30 15:08:37
|
I need to see the IR (internal intermediate representation) created for=20 these blocks. Can you run with =2D-tool=3Dnone --trace-flags=3D10001000 --vex-guest-chase-thresh=3D0 --tra= ce-notbelow=3D0 which will give you many megabytes of log file. Then find and send the presumably 3 blocks which pertain to this function. The blocks in the log have their function name + offset attached so it is easy to find them. Thanks. J On Sunday 29 October 2006 02:05, Rafael Esp=EDndola wrote: > Reducing a function in qt4 to fix a warning about a branch depending > on uninitialised values, I ended up with > -------------------------------- > _ZN18QRasterPaintEngine12updateMatrixERK7QMatrix: > movl 4(%esp), %eax > movl 16(%eax), %ecx > > fldz > fldz > fxch %st(1) > fucompp > fnstsw %ax > sahf > jp .L262 > > andb $128, 8761(%ecx) > > fldz > fldz > fxch %st(1) > fucompp > fnstsw %ax > sahf > jp 1.L262 > > .L262: > ret > --------------------------------------- > > Note that the code does two identical fp compares. Valgrind gives a > warning only on the second "jp". If the "andb" instruction is removed, > the warning disappears. > > Any suggestions on where to look in the code? > > Thanks, > Rafael > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job > easier Download IBM WebSphere Application Server v.1.0.1 based on Apache > Geronimo > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat= =3D121642 > _______________________________________________ > Valgrind-developers mailing list > Val...@li... > https://lists.sourceforge.net/lists/listinfo/valgrind-developers |
|
From: <raf...@gm...> - 2006-11-01 01:18:02
Attachments:
psi.log.bz2
|
On 10/30/06, Julian Seward <js...@ac...> wrote: > > I need to see the IR (internal intermediate representation) created for > these blocks. Can you run with > > --tool=none --trace-flags=10001000 --vex-guest-chase-thresh=0 --trace-notbelow=0 > > which will give you many megabytes of log file. Then find and send the > presumably 3 blocks which pertain to this function. The blocks in the log > have their function name + offset attached so it is easy to find them. Attached. > Thanks. > > J My pleasure! Rafael |
|
From: Julian S. <js...@ac...> - 2006-11-01 05:10:15
|
Thanks for the logging info. I was able to construct a test case from
it and the attached patch fixes it (I assume this is on x86-linux).
Can you try it?
J
Index: priv/guest-x86/ghelpers.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
=2D-- priv/guest-x86/ghelpers.c (revision 1671)
+++ priv/guest-x86/ghelpers.c (working copy)
@@ -1161,6 +1161,23 @@
);
}
+ if (isU32(cc_op, X86G_CC_OP_COPY) && isU32(cond, X86CondP)) {
+ /* COPY, then P --> extract P from dep1, and test (P =3D=3D 1). */
+ return
+ unop(
+ Iop_1Uto32,
+ binop(
+ Iop_CmpNE32,
+ binop(
+ Iop_And32,
+ binop(Iop_Shr32, cc_dep1, mkU8(X86G_CC_SHIFT_P)),
+ mkU32(1)
+ ),
+ mkU32(0)
+ )
+ );
+ }
+
return NULL;
}
On Wednesday 01 November 2006 01:17, Rafael Esp=EDndola wrote:
> On 10/30/06, Julian Seward <js...@ac...> wrote:
> > I need to see the IR (internal intermediate representation) created for
> > these blocks. Can you run with
> >
> > --tool=3Dnone --trace-flags=3D10001000 --vex-guest-chase-thresh=3D0
> > --trace-notbelow=3D0
> >
> > which will give you many megabytes of log file. Then find and send the
> > presumably 3 blocks which pertain to this function. The blocks in the
> > log have their function name + offset attached so it is easy to find
> > them.
>
> Attached.
>
> > Thanks.
> >
> > J
>
> My pleasure!
>
> Rafael
|
|
From: <raf...@gm...> - 2006-11-02 02:01:36
|
On 11/1/06, Julian Seward <js...@ac...> wrote: > > Thanks for the logging info. I was able to construct a test case from > it and the attached patch fixes it (I assume this is on x86-linux). > Can you try it? It works! > J > Thank you very much. Rafael |