Bug 20000 - src/sim/rx/fpu.c:436: possible typo ?
Summary: src/sim/rx/fpu.c:436: possible typo ?
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: sim (show other bugs)
Version: HEAD
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-26 18:02 UTC by dcb
Modified: 2016-04-27 11:39 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dcb 2016-04-26 18:02:37 UTC
[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 | 0x00400000;
      else if  (a->type == FP_SNAN)
        *c = b->orig_value | 0x00400000;
      else
        *c = 0x7fc00000;

Maybe better code

     if (a->type == FP_SNAN)
        *c = a->orig_value | 0x00400000;
      else if  (b->type == FP_SNAN)
        *c = b->orig_value | 0x00400000;
      else
        *c = 0x7fc00000;
Comment 1 Sourceware Commits 2016-04-27 11:38:26 UTC
The master branch has been updated by Nick Clifton <nickc@sourceware.org>:

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

commit 7881f69ee902b06433f071fd8cbdee1b401c9b76
Author: Nick Clifton <nickc@redhat.com>
Date:   Wed Apr 27 12:37:11 2016 +0100

    Fix a typo in the check for SNANs in the RX simulator.
    
    	PR target/20000
    	* fpu.c (check_exceptions): Fix typo checking for signalling
    	NANs.
Comment 2 Nick Clifton 2016-04-27 11:39:16 UTC
Thanks for reporting this bug!

Obvious patch applied as indicated.