Bug 78779 - libgcc/soft-fp/op-common.h:900: possible missing break ?
Summary: libgcc/soft-fp/op-common.h:900: possible missing break ?
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: libgcc (show other bugs)
Version: 7.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-12-12 18:03 UTC by David Binderman
Modified: 2017-07-26 10:11 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Binderman 2016-12-12 18:03:16 UTC
../../../trunk/libgcc/soft-fp/op-common.h:900:10: warning: this statement may fall through [-Wimplicit-fallthrough=]

Source code is

    case _FP_CLS_COMBINE (FP_CLS_NAN, FP_CLS_NORMAL):   \
    case _FP_CLS_COMBINE (FP_CLS_NAN, FP_CLS_INF):      \
    case _FP_CLS_COMBINE (FP_CLS_NAN, FP_CLS_ZERO):     \
      R##_s = X##_s;                    \
                                \
    case _FP_CLS_COMBINE (FP_CLS_INF, FP_CLS_INF):      \
    case _FP_CLS_COMBINE (FP_CLS_INF, FP_CLS_NORMAL):   \

Suggest either add the missing break or document the fallthrough.
Comment 1 David Binderman 2016-12-13 11:41:17 UTC
Same thing a few lines further down in the same file:

trunk/libgcc/soft-fp/op-common.h:913:10: warning: this statement may fall through [-Wimplicit-fallthrough=]

Source code is

    case _FP_CLS_COMBINE (FP_CLS_INF, FP_CLS_NAN):      \
    case _FP_CLS_COMBINE (FP_CLS_ZERO, FP_CLS_NAN):     \
      R##_s = Y##_s;                    \
                                \
    case _FP_CLS_COMBINE (FP_CLS_NORMAL, FP_CLS_INF):   \
    case _FP_CLS_COMBINE (FP_CLS_NORMAL, FP_CLS_ZERO):  \

And a third case in the same file, line 1200:

    case _FP_CLS_COMBINE (FP_CLS_NORMAL, FP_CLS_ZERO):  \
      FP_SET_EXCEPTION (FP_EX_DIVZERO);         \
    case _FP_CLS_COMBINE (FP_CLS_INF, FP_CLS_ZERO):     \
Comment 2 Marek Polacek 2016-12-13 11:57:36 UTC
soft-fp is part of the GNU C Library so should be fixed there.
Comment 3 jsm-csl@polyomino.org.uk 2016-12-13 23:36:40 UTC
The fallthroughs are intentional.
Comment 4 David Binderman 2017-07-26 09:03:40 UTC
As per Joseph's comment.
Comment 5 Jakub Jelinek 2017-07-26 10:11:43 UTC
Well, WONTFIX is weird, because this has been actually fixed in r244884 in GCC
and in af1a265da09829f9042619c885c64eb8567a59ce in glibc.