http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50356

             Bug #: 50356
           Summary: Poor if condition in h8300 config code
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: target
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: dcb...@hotmail.com


I just tried the cppcheck tool over the source code of
gcc 4.7 snapshot 20110910.

The tool said

[gcc/config/h8300/h8300.c:1209]: (warning) Mutual exclusion over || always
evaluates to true. Did you intend to use && instead?

The source code is

   if (-4 <= n || n <= 4)

Maybe better code might be

   if (-4 <= n && n <= 4)

Reply via email to