summary refs log tree commit diff stats
path: root/results/classifier/118/mistranslation-ppc/1655708
diff options
context:
space:
mode:
Diffstat (limited to 'results/classifier/118/mistranslation-ppc/1655708')
-rw-r--r--results/classifier/118/mistranslation-ppc/1655708127
1 files changed, 127 insertions, 0 deletions
diff --git a/results/classifier/118/mistranslation-ppc/1655708 b/results/classifier/118/mistranslation-ppc/1655708
new file mode 100644
index 00000000..7238ef08
--- /dev/null
+++ b/results/classifier/118/mistranslation-ppc/1655708
@@ -0,0 +1,127 @@
+mistranslation: 0.960
+ppc: 0.930
+virtual: 0.918
+hypervisor: 0.836
+device: 0.812
+semantic: 0.811
+socket: 0.783
+PID: 0.745
+vnc: 0.741
+register: 0.697
+architecture: 0.673
+graphic: 0.661
+performance: 0.660
+boot: 0.654
+kernel: 0.589
+network: 0.587
+permissions: 0.583
+risc-v: 0.557
+files: 0.555
+assembly: 0.537
+arm: 0.522
+KVM: 0.520
+VMM: 0.506
+peripherals: 0.487
+TCG: 0.483
+user-level: 0.483
+debug: 0.473
+i386: 0.426
+x86: 0.424
+--------------------
+ppc: 0.929
+debug: 0.201
+semantic: 0.115
+kernel: 0.109
+x86: 0.080
+files: 0.059
+PID: 0.032
+register: 0.028
+TCG: 0.026
+virtual: 0.024
+hypervisor: 0.018
+performance: 0.016
+boot: 0.015
+device: 0.011
+user-level: 0.011
+VMM: 0.009
+socket: 0.009
+mistranslation: 0.008
+network: 0.008
+vnc: 0.005
+KVM: 0.005
+peripherals: 0.004
+architecture: 0.004
+permissions: 0.004
+assembly: 0.004
+risc-v: 0.002
+i386: 0.002
+graphic: 0.002
+arm: 0.000
+
+target/ppc/int_helper.c:2806: strange expression ?
+
+target/ppc/int_helper.c:2806:25: warning: ‘*’ in boolean context, suggest ‘&&’ instead [-Wint-in-bool-context]
+
+Source code is
+
+       zone_digit = (i * 2) ? b->u8[BCD_DIG_BYTE(i * 2)] >> 4 : zone_lead;
+
+Which I read as
+
+       zone_digit = (i * 2) ? (b->u8[BCD_DIG_BYTE(i * 2)] >> 4) : zone_lead;
+
+so I think the compiler warning is for the i * 2 lhs of the ?.
+
+I am not sure what to suggest as a bugfix.
+
+On 01/11/2017 10:41 AM, dcb wrote:
+> Public bug reported:
+> 
+> target/ppc/int_helper.c:2806:25: warning: ‘*’ in boolean context,
+> suggest ‘&&’ instead [-Wint-in-bool-context]
+> 
+> Source code is
+> 
+>        zone_digit = (i * 2) ? b->u8[BCD_DIG_BYTE(i * 2)] >> 4 :
+> zone_lead;
+
+Also, looking at BCD_DIG_BYTE():
+
+#if defined(HOST_WORDS_BIGENDIAN)
+#define BCD_DIG_BYTE(n) (15 - (n/2))
+#else
+#define BCD_DIG_BYTE(n) (n/2)
+#endif
+
+Oops. n is under-parenthesized, and will cause invalid expansions for
+some expressions.  Let's fix that as well.
+
+
+> so I think the compiler warning is for the i * 2 lhs of the ?.
+
+Yes - the compiler is complaining that 'i * 2' can only be non-zero if
+'i' was non-zero (given that the code occurs in a loop for i between 0
+and 16), so it is just as easy to write 'i ? ...' instead of the weirder
+'(i * 2) ? ...'.
+
+-- 
+Eric Blake   eblake redhat com    +1-919-301-3266
+Libvirt virtualization library http://libvirt.org
+
+
+
+> so it is just as easy to write 'i ? ...' instead of the weirder
+> '(i * 2) ? ...'.
+
+I suspect it is just possible that the i * 2 expression is a typo
+for something else, perhaps i & 2 or i << 2 or i >> 2 or something else.
+
+I don't know the code so I am unable to offer better guidance.
+ 
+
+Patch has been posted to the mailing list:
+https://lists.gnu.org/archive/html/qemu-devel/2017-01/msg02008.html
+
+Fix had been committed here:
+http://git.qemu.org/?p=qemu.git;a=commitdiff;h=365206aeb3d0bb72043d
+