tromey at sourceware dot org
2016-07-12 19:38:42 UTC
https://sourceware.org/bugzilla/show_bug.cgi?id=20362
Bug ID: 20362
Summary: bug in arm-tdep.c
Product: gdb
Version: unknown
Status: NEW
Severity: normal
Priority: P2
Component: tdep
Assignee: unassigned at sourceware dot org
Reporter: tromey at sourceware dot org
Target Milestone: ---
I tried compiling gdb with -Wduplicated-cond.
gcc complained about arm_record_vfp_data_proc_insn.
I think there are two bugs here.
First, gcc complains:
../../binutils-gdb/gdb/arm-tdep.c:11364:8: error: duplicated ‘if’ condition
[-Werror=duplicated-cond]
else if (opc1 == 0x0b)
^~
../../binutils-gdb/gdb/arm-tdep.c:11356:17: note: previously used here
else if (opc1 == 0x0b)
~~~~~^~~~~~~
Second, and IMO more seriously, most of these cases can't be taken
at all AFAICT. In that function:
opc1 = opc1 & 0x04;
...
else if (opc1 == 0x01)
...
else if (opc1 == 0x02 && !(opc3 & 0x01))
...
else if (opc1 == 0x03)
...
else if (opc1 == 0x0b)
I think none of these can possibly be true.
I'll file a bug about gcc not warning for these.
Bug ID: 20362
Summary: bug in arm-tdep.c
Product: gdb
Version: unknown
Status: NEW
Severity: normal
Priority: P2
Component: tdep
Assignee: unassigned at sourceware dot org
Reporter: tromey at sourceware dot org
Target Milestone: ---
I tried compiling gdb with -Wduplicated-cond.
gcc complained about arm_record_vfp_data_proc_insn.
I think there are two bugs here.
First, gcc complains:
../../binutils-gdb/gdb/arm-tdep.c:11364:8: error: duplicated ‘if’ condition
[-Werror=duplicated-cond]
else if (opc1 == 0x0b)
^~
../../binutils-gdb/gdb/arm-tdep.c:11356:17: note: previously used here
else if (opc1 == 0x0b)
~~~~~^~~~~~~
Second, and IMO more seriously, most of these cases can't be taken
at all AFAICT. In that function:
opc1 = opc1 & 0x04;
...
else if (opc1 == 0x01)
...
else if (opc1 == 0x02 && !(opc3 & 0x01))
...
else if (opc1 == 0x03)
...
else if (opc1 == 0x0b)
I think none of these can possibly be true.
I'll file a bug about gcc not warning for these.
--
You are receiving this mail because:
You are on the CC list for the bug.
You are receiving this mail because:
You are on the CC list for the bug.