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

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

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

maiku.fabian at gmail dot com
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 ?

maiku.fabian at gmail dot com
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 ?

maiku.fabian at gmail dot com
In reply to this post by maiku.fabian at gmail dot com
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 ?

maiku.fabian at gmail dot com
In reply to this post by maiku.fabian at gmail dot com
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 ?

maiku.fabian at gmail dot com
In reply to this post by maiku.fabian at gmail dot com
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.