[Bug binutils/15993] gdb-7.6.1/bfd/elf32-m32c.c:921: bad switch statement

2013-10-08 Thread dcb314 at hotmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=15993

--- Comment #3 from dcb  ---
(In reply to Sergio Durigan Junior from comment #1)
> I will post a patch soon.

Thanks.

Similar problems at 

gdb-7.6.1/bfd/elf32-rl78.c:1112

gdb-7.6.1/bfd/elf32-rx.c:3180

-- 
You are receiving this mail because:
You are on the CC list for the bug.

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/15993] gdb-7.6.1/bfd/elf32-m32c.c:921: bad switch statement

2013-10-08 Thread dcb314 at hotmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=15993

--- Comment #4 from dcb  ---
(In reply to dcb from comment #3)
> (In reply to Sergio Durigan Junior from comment #1)
> > I will post a patch soon.
> 
> Thanks.
> 
> Similar problems at 
> 
> gdb-7.6.1/bfd/elf32-rl78.c:1112
> 
> gdb-7.6.1/bfd/elf32-rx.c:3180

and

gdb-7.6.1/sim/erc32/float.c:95

-- 
You are receiving this mail because:
You are on the CC list for the bug.

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/15993] gdb-7.6.1/bfd/elf32-m32c.c:921: bad switch statement

2013-10-09 Thread dcb314 at hotmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=15993

--- Comment #8 from dcb  ---
>gdb-7.6.1/sim/erc32/float.c:95 is a GDB bug and can be opened against it.  You 
>>can put me on the Cc list and I will take ownership. 

Done. Bug #16108

-- 
You are receiving this mail because:
You are on the CC list for the bug.

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/16021] New: binutils-2.23.2/bfd/elf32-rl78.c:1110: bad switch statement

2013-10-09 Thread dcb314 at hotmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=16021

Bug ID: 16021
   Summary: binutils-2.23.2/bfd/elf32-rl78.c:1110: bad switch
statement
   Product: binutils
   Version: 2.23
Status: NEW
  Severity: normal
  Priority: P2
 Component: binutils
  Assignee: unassigned at sourceware dot org
  Reporter: dcb314 at hotmail dot com

I just ran the static analysis tool "cppcheck" over the
source code of binutils-2.23.2

It said

[binutils-2.23.2/bfd/elf32-rl78.c:1110] ->
[binutils-2.23.2/bfd/elf32-rl78.c:]: (warning) Variable 'st_info_str' is
reassigned a value before the old one has been used. 'break;' missing?

Source code is

  switch (ELF_ST_TYPE (isym->st_info))
{
case STT_FUNC: st_info_str = "STT_FUNC";
case STT_SECTION: st_info_str = "STT_SECTION";
case STT_FILE: st_info_str = "STT_FILE";
case STT_OBJECT: st_info_str = "STT_OBJECT";
case STT_TLS: st_info_str = "STT_TLS";
default: st_info_str = "";
}

Basic coding error. Suggest add break statements.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/16022] New: binutils-2.23.2/bfd/elf32-rx.c:3142: bad switch statement ?

2013-10-09 Thread dcb314 at hotmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=16022

Bug ID: 16022
   Summary: binutils-2.23.2/bfd/elf32-rx.c:3142: bad switch
statement ?
   Product: binutils
   Version: 2.23
Status: NEW
  Severity: normal
  Priority: P2
 Component: binutils
  Assignee: unassigned at sourceware dot org
  Reporter: dcb314 at hotmail dot com

I just ran the static analyser cppcheck over the source code
of binutils-2.23.2

It said

[binutils-2.23.2/bfd/elf32-rx.c:3142] -> [binutils-2.23.2/bfd/elf32-rx.c:3143]:
(warning) Variable 'st_info_str' is reassigned a value before the old one has
been used. 'break;' missing?

Source code is

  switch (ELF_ST_TYPE (isym->st_info))
{
case STT_FUNC: st_info_str = "STT_FUNC";
case STT_SECTION: st_info_str = "STT_SECTION";
case STT_FILE: st_info_str = "STT_FILE";
case STT_OBJECT: st_info_str = "STT_OBJECT";
case STT_TLS: st_info_str = "STT_TLS";
default: st_info_str = "";
}
  switch (ELF_ST_BIND (isym->st_info))
{
case STB_LOCAL: st_info_stb_str = "STB_LOCAL";
case STB_GLOBAL: st_info_stb_str = "STB_GLOBAL";
default: st_info_stb_str = "";
}
  switch (ELF_ST_VISIBILITY (isym->st_other))
{
case STV_DEFAULT: st_other_str = "STV_DEFAULT";
case STV_INTERNAL: st_other_str = "STV_INTERNAL";
case STV_PROTECTED: st_other_str = "STV_PROTECTED";
default: st_other_str = "";
}
  switch (isym->st_shndx)
{
case SHN_ABS: st_shndx_str = "SHN_ABS";
case SHN_COMMON: st_shndx_str = "SHN_COMMON";
case SHN_UNDEF: st_shndx_str = "SHN_UNDEF";
default: st_shndx_str = "";
}

Suggest add some break statements.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/15993] gdb-7.6.1/bfd/elf32-m32c.c:921: bad switch statement

2013-10-09 Thread dcb314 at hotmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=15993

--- Comment #9 from dcb  ---
>gdb-7.6.1/bfd/elf32-rl78.c:1112 and gdb-7.6.1/bfd/elf32-rx.c:3180 are BFD bugs 
>and should be opened against binutils. 

Done. Bugs # 16021 and 16022

-- 
You are receiving this mail because:
You are on the CC list for the bug.

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/16023] New: binutils-2.23.2/binutils/debug.c:3155: possible missing break ?

2013-10-09 Thread dcb314 at hotmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=16023

Bug ID: 16023
   Summary: binutils-2.23.2/binutils/debug.c:3155: possible
missing break ?
   Product: binutils
   Version: 2.23
Status: NEW
  Severity: normal
  Priority: P2
 Component: binutils
  Assignee: unassigned at sourceware dot org
  Reporter: dcb314 at hotmail dot com

Source code is

case DEBUG_KIND_RANGE:
  ret = (t1->u.krange->lower == t2->u.krange->lower
 && t1->u.krange->upper == t2->u.krange->upper
 && debug_type_samep (info, t1->u.krange->type,
  t2->u.krange->type));

case DEBUG_KIND_ARRAY:

Suggest add missing break.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/16024] New: binutils-2.23.2/binutils/objdump.c:3663: possible missing break ?

2013-10-09 Thread dcb314 at hotmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=16024

Bug ID: 16024
   Summary: binutils-2.23.2/binutils/objdump.c:3663: possible
missing break ?
   Product: binutils
   Version: 2.23
Status: NEW
  Severity: normal
  Priority: P2
 Component: binutils
  Assignee: unassigned at sourceware dot org
  Reporter: dcb314 at hotmail dot com

Source code is

case 'H':
  usage (stdout, 0);
  seenflag = TRUE;
case 'v':
case 'V':

Suggest add missing break.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gas/16025] New: binutils-2.23.2/gas/config/tc-epiphany.c:902: possible missing break ?

2013-10-09 Thread dcb314 at hotmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=16025

Bug ID: 16025
   Summary: binutils-2.23.2/gas/config/tc-epiphany.c:902: possible
missing break ?
   Product: binutils
   Version: 2.23
Status: NEW
  Severity: normal
  Priority: P2
 Component: gas
  Assignee: unassigned at sourceware dot org
  Reporter: dcb314 at hotmail dot com

Source code is

case EPIPHANY_RELAX_LDST_IMM3:
  addend = ((addend & 7) << 5) | opcode[0];
  opindx = EPIPHANY_OPERAND_DISP3;

case EPIPHANY_RELAX_BRANCH_SHORT:

Suggest add missing break.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gas/16026] New: binutils-2.23.2/gas/config/tc-mn10200.c:564: possible missing break ?

2013-10-09 Thread dcb314 at hotmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=16026

Bug ID: 16026
   Summary: binutils-2.23.2/gas/config/tc-mn10200.c:564: possible
missing break ?
   Product: binutils
   Version: 2.23
Status: NEW
  Severity: normal
  Priority: P2
 Component: gas
  Assignee: unassigned at sourceware dot org
  Reporter: dcb314 at hotmail dot com

Source code is

case 0xff:
  opcode = 0xfe;
case 0xe8:

Suggest add missing break.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gprof/16027] New: binutils-2.23.2/gprof: 2 * resource leaks ?

2013-10-09 Thread dcb314 at hotmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=16027

Bug ID: 16027
   Summary: binutils-2.23.2/gprof: 2 * resource leaks ?
   Product: binutils
   Version: 2.23
Status: NEW
  Severity: normal
  Priority: P2
 Component: gprof
  Assignee: unassigned at sourceware dot org
  Reporter: dcb314 at hotmail dot com

[binutils-2.23.2/gprof/corefile.c:166]: (error) Resource leak: file
[binutils-2.23.2/gprof/source.c:263]: (error) Resource leak: ifp

I have checked them both and I recommend a couple of calls to fclose.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/16028] New: binutils-2.23.2/ld/ldmain.c:729: possible resource leak ?

2013-10-09 Thread dcb314 at hotmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=16028

Bug ID: 16028
   Summary: binutils-2.23.2/ld/ldmain.c:729: possible resource
leak ?
   Product: binutils
   Version: 2.23
Status: NEW
  Severity: normal
  Priority: P2
 Component: ld
  Assignee: unassigned at sourceware dot org
  Reporter: dcb314 at hotmail dot com

I just ran the static analyser "cppcheck" over the source code
of the linker. It said

[binutils-2.23.2/ld/ldmain.c:729]: (error) Resource leak: file

I checked this and it looks to me like a call to fclose near
the end of function add_keepsyms_file would fix the problem.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gprof/16027] binutils-2.23.2/gprof: 2 * resource leaks ?

2013-10-09 Thread dcb314 at hotmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=16027

--- Comment #3 from dcb  ---
>Thanks for reporting all of these bugs!

All part of the service, sir ;->

You may wish to consider having cppcheck 

http://sourceforge.net/apps/mediawiki/cppcheck/index.php?title=Main_Page

as part of your development process. 

I've reported all the bugs I thought were appropriate with
today's cppcheck and today's binutils.

It's always possible new bugs may be introduced in new
binutils development, and cppcheck gets better, so it may find
old bugs in old code too.

Just an idea.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gprof/16027] binutils-2.23.2/gprof: 2 * resource leaks ?

2013-10-10 Thread dcb314 at hotmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=16027

--- Comment #7 from dcb  ---
>Thanks - I have downloaded and built the tool and added an invocation of 
>it to my master makefile...

Marvellous.

I find the default flag settings for it to be pretty quiet.
My usual settings are --enable=warning in normal development work. 
I find --enable=all to be a bit too chatty.

You might like to experiment with these settings and select
one that you prefer.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/18132] New: compile/compile-loc2c.c:729: += on uninit data ?

2015-03-16 Thread dcb314 at hotmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=18132

Bug ID: 18132
   Summary: compile/compile-loc2c.c:729: += on uninit data ?
   Product: binutils
   Version: 2.26 (HEAD)
Status: NEW
  Severity: normal
  Priority: P2
 Component: binutils
  Assignee: unassigned at sourceware dot org
  Reporter: dcb314 at hotmail dot com

I just tried to compile trunk binutils with clang. It said

../../src/gdb/compile/compile-loc2c.c:729:6: warning: variable 'uoffset' is
uninitialized when used here [-Wuninitialized]

Source code is

uoffset += dwarf2_per_cu_text_offset (per_cu);

-- 
You are receiving this mail because:
You are on the CC list for the bug.

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/18273] New: cppcheck meets sim - five bugs

2015-04-16 Thread dcb314 at hotmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=18273

Bug ID: 18273
   Summary: cppcheck meets sim - five bugs
   Product: binutils
   Version: 2.26 (HEAD)
Status: NEW
  Severity: normal
  Priority: P2
 Component: binutils
  Assignee: unassigned at sourceware dot org
  Reporter: dcb314 at hotmail dot com

I just ran static analyser cppcheck over the source code
of the simulator in binutils.

It said many things, but I think these are the most important.

1.

[src/sim/bfin/bfin-sim.c:4320]: (style) Same expression on both sides of '&&'.

Source code is

 else if ((aop == 0 || aop == 1 || aop == 2) && s == 1 && aopcde == 8
   && x == 0 && s == 1 && HL == 0)

Duplicate mention of s == 1. Suggest delete one.

2.

[src/sim/erc32/exec.c:295]: (style) Same expression on both sides of '||'.

  *carry = result < n1 || result < n1;

Maybe

  *carry = result < n1 || result < n2;

3.

[src/sim/igen/misc.c:105]: (style) Same expression on both sides of '||'.

  if (strcmp (a, "false") == 0 || strcmp (a, "false") == 0)

Maybe

 if (strcmp (a, "false") == 0 || strcmp (a, "FALSE") == 0)

4.

[src/sim/igen/misc.c:121]: (style) Same expression on both sides of '||'.

 else if (a[1] == 'b' || a[1] == 'b')

Maybe

 else if (a[1] == 'b' || a[1] == 'B')

5.

[src/sim/rx/reg.c:256]: (warning) Logical disjunction always evaluates to true:
id>= 1 || id <= 15.

if (id>= 1 || id <= 15)

Maybe

   if (id >= 1 && id <= 15)

Ohter messages from cppcheck available on request.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/18474] New: src/opcodes/msp430-dis.c:69: bad test ?

2015-06-01 Thread dcb314 at hotmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=18474

Bug ID: 18474
   Summary: src/opcodes/msp430-dis.c:69: bad test ?
   Product: binutils
   Version: 2.26 (HEAD)
Status: NEW
  Severity: normal
  Priority: P2
 Component: binutils
  Assignee: unassigned at sourceware dot org
  Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

[src/opcodes/msp430-dis.c:69]: (style) Expression '(X & 0xf00) != 0x3' is
always true.
[src/opcodes/msp430-dis.c:69]: (style) Expression '(X & 0xf00) != 0x2' is
always true.

 if ((insn & 0x0f00) != 3 || (insn & 0x0f00) != 2)
return 0;

-- 
You are receiving this mail because:
You are on the CC list for the bug.

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gas/18574] New: gas/config/tc-msp430.c: 9 * Redundant condition

2015-06-22 Thread dcb314 at hotmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=18574

Bug ID: 18574
   Summary: gas/config/tc-msp430.c: 9 * Redundant condition
   Product: binutils
   Version: 2.26 (HEAD)
Status: NEW
  Severity: minor
  Priority: P2
 Component: gas
  Assignee: unassigned at sourceware dot org
  Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

1.

[binutils-gdb/gas/config/tc-msp430.c:2072]: (style) Redundant condition:
!op1.reg. 'A && (!A || B)' is equivalent to 'A || B'

Source code is

  else if (op1.reg || (op1.reg == 0 && op1.am == 3))/* Not PC relative.  */

Maybe better code

  else if (op1.reg || op1.am == 3)/* Not PC relative.  */

Same thing at lines 2158, 2204, 2274, 2802, 2848, 2950, 2981

Also

gas/config/tc-msp430.c:3326]: (style) Redundant condition: fixp.fx_addsy. 'A &&
(!A || B)' is equivalent to 'A || B'

Source code is

 if (!fixp->fx_addsy || (fixp->fx_addsy
  && S_GET_SEGMENT (fixp->fx_addsy) == absolute_section))

-- 
You are receiving this mail because:
You are on the CC list for the bug.

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gas/18677] New: gas/config/tc-mmix.c:1479]: possible bad if ?

2015-07-15 Thread dcb314 at hotmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=18677

Bug ID: 18677
   Summary: gas/config/tc-mmix.c:1479]: possible bad if ?
   Product: binutils
   Version: 2.26 (HEAD)
Status: NEW
  Severity: normal
  Priority: P2
 Component: gas
  Assignee: unassigned at sourceware dot org
  Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

gas/config/tc-mmix.c:1479]: (warning) Logical conjunction always evaluates to
false: EXPR < 0 && EXPR > 4.

   && exp[1].X_add_number < 0
&& exp[1].X_add_number > 4)

-- 
You are receiving this mail because:
You are on the CC list for the bug.

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gas/18678] New: config/tc-tic4x.c:2357: bad if ?

2015-07-15 Thread dcb314 at hotmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=18678

Bug ID: 18678
   Summary: config/tc-tic4x.c:2357: bad if ?
   Product: binutils
   Version: 2.26 (HEAD)
Status: NEW
  Severity: normal
  Priority: P2
 Component: gas
  Assignee: unassigned at sourceware dot org
  Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

config/tc-tic4x.c:2357]: (warning) Logical conjunction always evaluates to
false: EXPR < 4 && EXPR > 5.

Source code is

   if (tinsn->num_operands < 4 && tinsn->num_operands > 5 )

-- 
You are receiving this mail because:
You are on the CC list for the bug.

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gas/18679] New: config/xtensa-relax.c:872: bad if ?

2015-07-15 Thread dcb314 at hotmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=18679

Bug ID: 18679
   Summary: config/xtensa-relax.c:872: bad if ?
   Product: binutils
   Version: 2.26 (HEAD)
Status: NEW
  Severity: normal
  Priority: P2
 Component: gas
  Assignee: unassigned at sourceware dot org
  Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

config/xtensa-relax.c:872] -> [src/gas/config/xtensa-relax.c:872]: (style) Same
expression on both sides of '||'.

 if (m1->operand_name == NULL || m1->operand_name == NULL)

Maybe

 if (m1->operand_name == NULL || m2->operand_name == NULL)

-- 
You are receiving this mail because:
You are on the CC list for the bug.

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/18747] New: src/bfd/coff-sh.c:2330: possible bad expression ?

2015-07-31 Thread dcb314 at hotmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=18747

Bug ID: 18747
   Summary: src/bfd/coff-sh.c:2330: possible bad expression ?
   Product: binutils
   Version: 2.26 (HEAD)
Status: NEW
  Severity: normal
  Priority: P2
 Component: binutils
  Assignee: unassigned at sourceware dot org
  Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

[src/bfd/coff-sh.c:2330] -> [src/bfd/coff-sh.c:2330]: (style) Same expression
on both sides of '/'.

  sh_opcodes[0xf].count = sizeof sh_dsp_opcodef / sizeof sh_dsp_opcodef;

Maybe

  sh_opcodes[0xf].count = sizeof sh_dsp_opcodef / sizeof sh_dsp_opcodef[0];

-- 
You are receiving this mail because:
You are on the CC list for the bug.

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/18806] New: src/bfd/elf.c:1240: bad test ?

2015-08-11 Thread dcb314 at hotmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=18806

Bug ID: 18806
   Summary: src/bfd/elf.c:1240: bad test ?
   Product: binutils
   Version: 2.26 (HEAD)
Status: NEW
  Severity: normal
  Priority: P2
 Component: binutils
  Assignee: unassigned at sourceware dot org
  Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

../../src/bfd/elf.c:1240:26: warning: self-comparison always evaluates to true
[-Wtautological-compare]

Source code is

 || oheader->sh_type == oheader->sh_type)

Maybe

 || iheader->sh_type == oheader->sh_type)

-- 
You are receiving this mail because:
You are on the CC list for the bug.

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gold/18874] New: src/gold/gc.h:207: performance tweek ?

2015-08-26 Thread dcb314 at hotmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=18874

Bug ID: 18874
   Summary: src/gold/gc.h:207: performance tweek ?
   Product: binutils
   Version: 2.26 (HEAD)
Status: NEW
  Severity: minor
  Priority: P2
 Component: gold
  Assignee: ccoutant at gmail dot com
  Reporter: dcb314 at hotmail dot com
CC: ian at airs dot com
  Target Milestone: ---

[src/gold/gc.h:207]: (performance) Passing the result of c_str() to a function
that takes std::string as argument no. 1 is slow and redundant.

Source code is

 if (parameters->options().icf_enabled()
  && is_section_foldable_candidate(src_section_name.c_str()))

but

inline bool
is_section_foldable_candidate(const std::string& section_name)

-- 
You are receiving this mail because:
You are on the CC list for the bug.

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/19224] New: src/opcodes/h8300-dis.c:547: bad if test ?

2015-11-10 Thread dcb314 at hotmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=19224

Bug ID: 19224
   Summary: src/opcodes/h8300-dis.c:547: bad if test ?
   Product: binutils
   Version: 2.26 (HEAD)
Status: NEW
  Severity: normal
  Priority: P2
 Component: binutils
  Assignee: unassigned at sourceware dot org
  Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

[src/opcodes/h8300-dis.c:547]: (style) Expression is always false because 'else
if' condition matches previous condition at line 436.

  if (looking_for & IGNORE)


   else if (looking_for & IGNORE)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/19273] New: sim/common/sim-utils.c:336: missing call to va_end ?

2015-11-20 Thread dcb314 at hotmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=19273

Bug ID: 19273
   Summary: sim/common/sim-utils.c:336: missing call to va_end ?
   Product: binutils
   Version: unspecified
Status: NEW
  Severity: normal
  Priority: P2
 Component: binutils
  Assignee: unassigned at sourceware dot org
  Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

sim/common/sim-utils.c:336]: (error) va_list 'ap' was opened but not closed by
va_end().

Source code is

  va_start (ap, fmt);
  if (vasprintf (&buf, fmt, ap) < 0)
{
  sim_io_eprintf (sd, "%s: asprintf failed for `%s'\n",
  STATE_MY_NAME (sd), fmt);
  return;

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gold/19277] New: inutils-gdb/gold/arm.cc:4513: reading dead memory

2015-11-20 Thread dcb314 at hotmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=19277

Bug ID: 19277
   Summary: inutils-gdb/gold/arm.cc:4513: reading dead memory
   Product: binutils
   Version: unspecified
Status: NEW
  Severity: normal
  Priority: P2
 Component: gold
  Assignee: ccoutant at gmail dot com
  Reporter: dcb314 at hotmail dot com
CC: ian at airs dot com
  Target Milestone: ---

[binutils-gdb/gold/arm.cc:4513]: (error) Returning/dereferencing 'buffer' after
it is deallocated / released

  delete[] buffer;
  return std::string(buffer);

Suggest code rework.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/19310] New: src/binutils/dwarf.c:6459: code relies on undefined behaviour ?

2015-11-30 Thread dcb314 at hotmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=19310

Bug ID: 19310
   Summary: src/binutils/dwarf.c:6459: code relies on undefined
behaviour ?
   Product: binutils
   Version: unspecified
Status: NEW
  Severity: normal
  Priority: P2
 Component: binutils
  Assignee: unassigned at sourceware dot org
  Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

[src/binutils/dwarf.c:6459]: (warning) Invalid test for overflow
'start+ul= block_end || start + ul > block_end || start + ul < start)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/19310] src/binutils/dwarf.c:6459: code relies on undefined behaviour ?

2015-12-04 Thread dcb314 at hotmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=19310

--- Comment #2 from dcb  ---
>will this do the trick ?

It certainly seems to shut up cppcheck, the static analyser.

Not sure how to get gcc or clang to detect this problem.

$ cat dec4a.cc

extern void g( const char *);

void
f( const char * start, unsigned long ul)
{
if (start + ul < start)
g( start);
}

$ ~/gcc/results/bin/gcc -c -O2 -Wall -Wextra -Wtype-limits dec4a.cc
$ ~/llvm/results/bin/clang++ -c -O2 -Wall dec4a.cc
$

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/19647] New: src/binutils/readelf.c:3998: possible missing break ?

2016-02-16 Thread dcb314 at hotmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=19647

Bug ID: 19647
   Summary: src/binutils/readelf.c:3998: possible missing break ?
   Product: binutils
   Version: unspecified
Status: NEW
  Severity: normal
  Priority: P2
 Component: binutils
  Assignee: unassigned at sourceware dot org
  Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

[src/binutils/readelf.c:4000]: (warning) Variable 'result' is reassigned a
value before the old one has been used. 'break;' missing?

Source code is

case EM_CYGNUS_V850:
  result = get_v850_section_type_name (sh_type);
default:
  result = NULL;
  break;

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gold/19793] New: script-sections.cc:1475: possible redundant string copy ?

2016-03-09 Thread dcb314 at hotmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=19793

Bug ID: 19793
   Summary: script-sections.cc:1475: possible redundant string
copy ?
   Product: binutils
   Version: 2.27 (HEAD)
Status: NEW
  Severity: minor
  Priority: P2
 Component: gold
  Assignee: ccoutant at gmail dot com
  Reporter: dcb314 at hotmail dot com
CC: ian at airs dot com
  Target Milestone: ---

[src/gold/script-sections.cc:1475]: (performance) Function parameter 'name'
should be passed by reference.

Source code is

  void
  set_section_name(const std::string name)
  {

More usual would be

  void
  set_section_name(const std::string & name)
  {

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gold/19794] New: src/gold/archive.cc: 2 * pointless copy ?

2016-03-09 Thread dcb314 at hotmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=19794

Bug ID: 19794
   Summary: src/gold/archive.cc: 2 * pointless copy ?
   Product: binutils
   Version: 2.27 (HEAD)
Status: NEW
  Severity: minor
  Priority: P2
 Component: gold
  Assignee: ccoutant at gmail dot com
  Reporter: dcb314 at hotmail dot com
CC: ian at airs dot com
  Target Milestone: ---

1.

[src/gold/archive.cc:506]: (performance) Function parameter 'p' should be
passed by reference.

Source code is

  operator==(const const_iterator p) const

More usual would be

  operator==(const const_iterator & p) const

2.

[src/gold/archive.cc:510]: (performance) Function parameter 'p' should be
passed by reference.

Duplicate.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gold/19793] script-sections.cc:1475: possible redundant string copy ?

2016-03-12 Thread dcb314 at hotmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=19793

--- Comment #3 from dcb  ---
>There are a few other places in gold where we should also pass by const 
>>reference instead of value for std::string.

$ fgrep "src/gold" cppcheck.20160308.out | fgrep "(performance)"
[src/gold/archive.cc:506]: (performance) Function parameter 'p' should be
passed by reference.
[src/gold/archive.cc:510]: (performance) Function parameter 'p' should be
passed by reference.
[src/gold/gc.h:203]: (performance) Passing the result of c_str() to a function
that takes std::string as argument no. 1 is slow and redundant.
[src/gold/script-sections.cc:1475]: (performance) Function parameter 'name'
should be passed by reference.
$

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/20000] New: src/sim/rx/fpu.c:436: possible typo ?

2016-04-26 Thread dcb314 at hotmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=2

Bug ID: 2
   Summary: src/sim/rx/fpu.c:436: possible typo ?
   Product: binutils
   Version: 2.27 (HEAD)
Status: NEW
  Severity: normal
  Priority: P2
 Component: binutils
  Assignee: unassigned at sourceware dot org
  Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

[src/sim/rx/fpu.c:436]: (style) Expression is always false because 'else if'
condition matches previous condition at line 434.

Source code is

 if (a->type == FP_SNAN)
*c = a->orig_value | 0x0040;
  else if  (a->type == FP_SNAN)
*c = b->orig_value | 0x0040;
  else
*c = 0x7fc0;

Maybe better code

 if (a->type == FP_SNAN)
*c = a->orig_value | 0x0040;
  else if  (b->type == FP_SNAN)
*c = b->orig_value | 0x0040;
  else
*c = 0x7fc0;

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/20097] New: [src/ld/testplug4.c:611]: (warning) Calling 'sizeof' on 'sizeof'.

2016-05-14 Thread dcb314 at hotmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=20097

Bug ID: 20097
   Summary: [src/ld/testplug4.c:611]: (warning) Calling 'sizeof'
on 'sizeof'.
   Product: binutils
   Version: 2.27 (HEAD)
Status: NEW
  Severity: normal
  Priority: P2
 Component: ld
  Assignee: unassigned at sourceware dot org
      Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

Source code is

 || SIZE_OF_PR20070B_C < sizeof EXPECTED_VIEW_LENGTH

but

#define EXPECTED_VIEW_LENGTH (sizeof (EXPECTED_VIEW) - 1)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gold/19277] inutils-gdb/gold/arm.cc:4513: reading dead memory

2016-07-07 Thread dcb314 at hotmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=19277

--- Comment #1 from dcb  ---
Still broken some eight months later.

binutils-gdb/gold/arm.cc:4542]: (error) Returning/dereferencing 'buffer' after
it is deallocated / released

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gold/18874] src/gold/gc.h:207: performance tweek ?

2016-07-07 Thread dcb314 at hotmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=18874

--- Comment #1 from dcb  ---
Still broken, some eleven months later.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gold/20334] New: gold/aarch64.cc:8054]: (style) Redundant condition

2016-07-07 Thread dcb314 at hotmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=20334

Bug ID: 20334
   Summary: gold/aarch64.cc:8054]: (style) Redundant condition
   Product: binutils
   Version: 2.27 (HEAD)
Status: UNCONFIRMED
  Severity: minor
  Priority: P2
 Component: gold
  Assignee: ccoutant at gmail dot com
  Reporter: dcb314 at hotmail dot com
CC: ian at airs dot com
  Target Milestone: ---

gold/aarch64.cc:8054]: (style) Redundant condition: pair. '!pair || (pair &&
!load)' is equivalent to '!pair || !load'

Source code is

  if (Insn_utilities::aarch64_mem_op_p(insn2, &rt1, &rt2, &pair, &load)
  && (!pair || (pair && !load)))

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gold/22213] New: binutils-2.29.1/gold/sparc.cc:4168]: (style) Mismatching assignment and comparison

2017-09-26 Thread dcb314 at hotmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=22213

Bug ID: 22213
   Summary: binutils-2.29.1/gold/sparc.cc:4168]: (style)
Mismatching assignment and comparison
   Product: binutils
   Version: unspecified
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: gold
  Assignee: ccoutant at gmail dot com
  Reporter: dcb314 at hotmail dot com
CC: ian at airs dot com
  Target Milestone: ---

binutils-2.29.1/gold/sparc.cc:4167] -> [binutils-2.29.1/gold/sparc.cc:4168]:
(style) Mismatching assignment and comparison, comparison 'reg==15' is always
false.

Source code is

  reg = (delay_insn >> 14) & 0x15;
  if (reg == 15)
return;

0x15 is a strange mask. Perhaps 0x1F was intended ?

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/22662] New: elf32-nds32.c:10609: strange condition ?

2018-01-02 Thread dcb314 at hotmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=22662

Bug ID: 22662
   Summary: elf32-nds32.c:10609: strange condition ?
   Product: binutils
   Version: unspecified
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: binutils
  Assignee: unassigned at sourceware dot org
  Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

[src/bfd/elf32-nds32.c:10609]: (style) Same expression on both sides of '||'.

  if (range_type == NDS32_LOADSTORE_FLOAT_S
  || range_type == NDS32_LOADSTORE_FLOAT_S)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/22662] elf32-nds32.c:10609: strange condition ?

2018-01-02 Thread dcb314 at hotmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=22662

dcb  changed:

   What|Removed |Added

 CC||kuanlinchentw at gmail dot com

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/22663] New: sim/arm/maverick.c:882]: (error) printf format string requires 3 parameters but only 2 are given.

2018-01-02 Thread dcb314 at hotmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=22663

Bug ID: 22663
   Summary: sim/arm/maverick.c:882]: (error) printf format string
requires 3 parameters but only 2 are given.
   Product: binutils
   Version: unspecified
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: binutils
  Assignee: unassigned at sourceware dot org
  Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

Source code is

  printfdbg ("cfnegd mvd%d = -mvd%d = %g\n",
 DEST_REG,
 mv_getRegDouble (DEST_REG));

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/22663] sim/arm/maverick.c:882]: (error) printf format string requires 3 parameters but only 2 are given.

2018-01-02 Thread dcb314 at hotmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=22663

dcb  changed:

   What|Removed |Added

 CC||nickc at sourceware dot org

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/25198] New: trunk/binutils/prdbg.c:2140: use of out of date pointer

2019-11-16 Thread dcb314 at hotmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=25198

Bug ID: 25198
   Summary: trunk/binutils/prdbg.c:2140: use of out of date
pointer
   Product: binutils
   Version: unspecified
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: binutils
  Assignee: unassigned at sourceware dot org
  Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

trunk/binutils/prdbg.c:2140:26: error: Using pointer to local variable 'idbuf'
that is out of scope. [invalidLifetime]

Source code is

  else
{
  char idbuf[20];

  sprintf (idbuf, "%%anon%u", id);
  name = idbuf;
}

  if (! push_type (info, name))


Suggest rework to avoid out of date pointers.

-- 
You are receiving this mail because:
You are on the CC list for the bug.