|
From: <raf...@gm...> - 2006-10-24 20:41:16
|
Generally when compiling a ((short|1) == constant) compression, gcc
generates this code:
---------------------------------------
movl (%rdi), %eax
orl $1, %eax
cmpw $43, %ax
je .L17
---------------------------------------
This works correctly on valgrind even if the second half of eax is
undefined (cmpw doesn't use it).
But if the constant is 0xffff, the generated code is
------------------------------------
movl (%rdi), %eax
orl $1, %eax
incw %ax
je .L17
------------------------------------
In this case valgrind prints the warning
------------------------------------
Conditional jump or move depends on uninitialised value(s)
------------------------------------
But the Z flag doesn't depend on the high part of eax. So the jump
doesn't depend on uninitialized values.
Should I submit a bug report? Where should I look in the code to try
to fix this?
Thanks,
Rafael
|
|
From: Julian S. <js...@ac...> - 2006-10-24 21:41:39
|
Yes, please submit a bug report. It would also be good to have a C program which reproduced the problem, if you can construct one.=20 J On Tuesday 24 October 2006 21:41, Rafael Esp=EDndola wrote: > Generally when compiling a ((short|1) =3D=3D constant) compression, gcc > generates this code: > > --------------------------------------- > movl (%rdi), %eax > orl $1, %eax > cmpw $43, %ax > je .L17 > --------------------------------------- > > This works correctly on valgrind even if the second half of eax is > undefined (cmpw doesn't use it). > > But if the constant is 0xffff, the generated code is > > ------------------------------------ > movl (%rdi), %eax > orl $1, %eax > incw %ax > je .L17 > ------------------------------------ > > In this case valgrind prints the warning > ------------------------------------ > Conditional jump or move depends on uninitialised value(s) > ------------------------------------ > > But the Z flag doesn't depend on the high part of eax. So the jump > doesn't depend on uninitialized values. > > Should I submit a bug report? Where should I look in the code to try > to fix this? > > 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-10-25 12:54:18
|
On 10/24/06, Julian Seward <js...@ac...> wrote: > > Yes, please submit a bug report. It would also be good to have > a C program which reproduced the problem, if you can construct > one. Just compile the attached files with "g++ -O2 -g main.cpp test.cpp -o test". It will print the warning ==13355== Conditional jump or move depends on uninitialised value(s) ==13355== at 0x400568: f(my_s*) (test.cpp:9) ==13355== by 0x400591: main (main.cpp:11) With the change you proposed, no warning is printed. Should I submit a bug report anyway? > J Thanks, Rafael |
|
From: Julian S. <js...@ac...> - 2006-10-24 21:52:17
|
> > ------------------------------------
> > movl (%rdi), %eax
> > orl $1, %eax
> > incw %ax
> > je .L17
> > ------------------------------------
Hmm, hang on. I just dealt with this one 5 days ago.
Firstly, what V version is this with? What gcc version? And
what program were you running on V to get this error?
Anyway, can you try the following (on a 3.2.1 tree):
In VEX/priv/guest-amd64/ghelper.c function
guest_amd64_spechelper find the case for DECW (will be obvious,
near line 1188) and after it add this:
/*---------------- INCW ----------------*/
if (isU64(cc_op, AMD64G_CC_OP_INCW) && isU64(cond, AMD64CondZ)) {
/* 16-bit inc, then Z --> test dst == 0 */
return unop(Iop_1Uto64,
binop(Iop_CmpEQ64,
binop(Iop_Shl64,cc_dep1,mkU8(48)),
mkU64(0)));
}
Rebuild (make clean ; make ; make install) and try again. Does
that fix it?
If that doesn't work try instead with AMD64CondNZ and Iop_CmpNE64.
J
|
|
From: <raf...@gm...> - 2006-10-25 12:44:54
|
> Hmm, hang on. I just dealt with this one 5 days ago.
>
> Firstly, what V version is this with? What gcc version? And
> what program were you running on V to get this error?
3.2.1 and svn. gcc 4.1.2. I was running psi. The error is in this Qt4
qxml.cpp check:
-------------
if (atEnd()) {
-------------
atEnd is inlined into
------------------------
ushort u = c.unicode()
if((u|0x0001) == 0xffff) {
------------------------
> Anyway, can you try the following (on a 3.2.1 tree):
>
> In VEX/priv/guest-amd64/ghelper.c function
> guest_amd64_spechelper find the case for DECW (will be obvious,
> near line 1188) and after it add this:
>
> /*---------------- INCW ----------------*/
>
> if (isU64(cc_op, AMD64G_CC_OP_INCW) && isU64(cond, AMD64CondZ)) {
> /* 16-bit inc, then Z --> test dst == 0 */
> return unop(Iop_1Uto64,
> binop(Iop_CmpEQ64,
> binop(Iop_Shl64,cc_dep1,mkU8(48)),
> mkU64(0)));
> }
>
> Rebuild (make clean ; make ; make install) and try again. Does
> that fix it?
I have tried it on svn rev 6340. It works! Thank you very much.
> If that doesn't work try instead with AMD64CondNZ and Iop_CmpNE64.
>
> J
>
Rafael
|