[Bug c/60668] New: simplify-rtx.c:1676: minor tidyup in if ... else chain
dcb314 at hotmail dot com
gcc-bugzilla@gcc.gnu.org
Wed Mar 26 09:06:00 GMT 2014
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60668
Bug ID: 60668
Summary: simplify-rtx.c:1676: minor tidyup in if ... else chain
Product: gcc
Version: 4.9.0
Status: UNCONFIRMED
Severity: minor
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: dcb314 at hotmail dot com
Source code is
if (arg0 == 0)
val = GET_MODE_PRECISION (mode) - 1;
else if (arg0 >= 0)
val = GET_MODE_PRECISION (mode) - floor_log2 (arg0) - 2;
else if (arg0 < 0)
val = GET_MODE_PRECISION (mode) - floor_log2 (~arg0) - 2;
Second if overlaps first and third if looks redundant.
Maybe better code might be
if (arg0 == 0)
val = GET_MODE_PRECISION (mode) - 1;
else if (arg0 > 0)
val = GET_MODE_PRECISION (mode) - floor_log2 (arg0) - 2;
else
val = GET_MODE_PRECISION (mode) - floor_log2 (~arg0) - 2;
More information about the Gcc-bugs
mailing list