[Bug server/18295] New: binutils-gdb/gdb/rs6000-tdep.c:1787: bad if expression ?

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug server/18295] New: binutils-gdb/gdb/rs6000-tdep.c:1787: bad if expression ?

macro@linux-mips.org
https://sourceware.org/bugzilla/show_bug.cgi?id=18295

            Bug ID: 18295
           Summary: binutils-gdb/gdb/rs6000-tdep.c:1787: bad if expression
                    ?
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: server
          Assignee: unassigned at sourceware dot org
          Reporter: dcb314 at hotmail dot com

[binutils-gdb/gdb/rs6000-tdep.c:1787]: (style) Expression '(X & 0xfc1f016a) ==
0x7c01016e' is always false.

      else if ((op & 0xfc1f016a) == 0x7c01016e)
    {           /* stwux rX,r1,rY */

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug server/18295] binutils-gdb/gdb/rs6000-tdep.c:1787: bad if expression ?

macro@linux-mips.org
https://sourceware.org/bugzilla/show_bug.cgi?id=18295

dcb <dcb314 at hotmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kevinb at redhat dot com

--- Comment #1 from dcb <dcb314 at hotmail dot com> ---
Still broken a few years later.

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug server/18295] binutils-gdb/gdb/rs6000-tdep.c:1787: bad if expression ?

macro@linux-mips.org
In reply to this post by macro@linux-mips.org
https://sourceware.org/bugzilla/show_bug.cgi?id=18295

Simon Marchi <simon.marchi at ericsson dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |simon.marchi at ericsson dot com

--- Comment #2 from Simon Marchi <simon.marchi at ericsson dot com> ---
If we assume the comment is right (we want to check for "stwux rX,r1,rY", where
rX and rY are any register, then I think we should be looking for this
instruction:

0111 11xx xxx0 0001 xxxx x001 0110 111x

where x is bits we don't care about.

The mask should therefore be

1111 1100 0001 1111 0000 0111 1111 1110

or 0xfc1f07fe.  The resulting value we should be looking for would be

0111 1100 0000 0001 0000 0001 0110 1110

or 0x7c01016e

The test should then be

(op & 0xfc1f07fe) == 0x7c01016e

I believe other masks are wrong too and should be reviewed.  For example, the
one for stdux is 0xfc1f016a, or

1111 1100 0001 1111 0000 0001 0110 1010

According to the ISA manual, bits 21-30 should contain the value 181.  The mask
should contain all 1's at these positions, not the value 181.  The expected
value, on the right of the ==, should contain the value 181 though.


(For reference I found the instruction set here [1], and just searched for
"stwux").

[1] https://www.ibm.com/developerworks/systems/library/es-archguide-v2.html

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug server/18295] binutils-gdb/gdb/rs6000-tdep.c:1787: bad if expression ?

macro@linux-mips.org
In reply to this post by macro@linux-mips.org
https://sourceware.org/bugzilla/show_bug.cgi?id=18295

Simon Marchi <simon.marchi at ericsson dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ulrich.weigand at de dot ibm.com

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug server/18295] binutils-gdb/gdb/rs6000-tdep.c:1787: bad if expression ?

macro@linux-mips.org
In reply to this post by macro@linux-mips.org
https://sourceware.org/bugzilla/show_bug.cgi?id=18295

--- Comment #3 from Simon Marchi <simon.marchi at ericsson dot com> ---
Ulrich, would you be able to look into this (first deciding if it's worth
fixing, and who should do it)?

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug server/18295] binutils-gdb/gdb/rs6000-tdep.c:1787: bad if expression ?

macro@linux-mips.org
In reply to this post by macro@linux-mips.org
https://sourceware.org/bugzilla/show_bug.cgi?id=18295

--- Comment #4 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Pedro Franco de Carvalho
<[hidden email]>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=7a8f494c7b171f6cbad20a14ef03a5d7acaa6ccb

commit 7a8f494c7b171f6cbad20a14ef03a5d7acaa6ccb
Author: Pedro Franco de Carvalho <[hidden email]>
Date:   Thu Mar 22 10:22:45 2018 -0300

    ppc: Fix stwux and stdux masks in skip_prologue

    This patch merges the masks for matching the stwux and stdux
    instructions in rs6000-tdep.c:skip_prologue into a single mask that
    only matches these two instructions.

    Commit 72dd273062 fixed the warning described in PR tdep/18295, this
    patch addresses the comment in the same PR indicating that the mask
    was too permissive.

    gdb/Changelog:

        PR tdep/18295
        * rs6000-tdep.c (skip_prologue): Match both stwux and stdux
        a single mask.

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug tdep/18295] binutils-gdb/gdb/rs6000-tdep.c:1787: bad if expression ?

macro@linux-mips.org
In reply to this post by macro@linux-mips.org
https://sourceware.org/bugzilla/show_bug.cgi?id=18295

Ulrich Weigand <uweigand at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |uweigand at gcc dot gnu.org
          Component|server                      |tdep
         Resolution|---                         |FIXED

--- Comment #5 from Ulrich Weigand <uweigand at gcc dot gnu.org> ---
Fixed.

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug tdep/18295] binutils-gdb/gdb/rs6000-tdep.c:1787: bad if expression ?

macro@linux-mips.org
In reply to this post by macro@linux-mips.org
https://sourceware.org/bugzilla/show_bug.cgi?id=18295

Jeremi <jeremip11 at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jeremip11 at gmail dot com

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