[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PULL v2 05/13] target/rx: CPU definitions

From: Philippe Mathieu-Daudé
Subject: Re: [PULL v2 05/13] target/rx: CPU definitions
Date: Fri, 20 Mar 2020 17:32:38 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0

On 3/20/20 5:21 PM, Peter Maydell wrote:
On Fri, 20 Mar 2020 at 16:19, Richard Henderson
<address@hidden> wrote:

On 3/20/20 9:04 AM, Philippe Mathieu-Daudé wrote:
Not related to this patch, but this line generates a warning with Clang:

   CC      rx-softmmu/target/rx/cpu.o
target/rx/cpu.c:158:33: warning: The result of the left shift is undefined
because the left operand is negative
     address = physical = addr & TARGET_PAGE_MASK;
include/exec/cpu-all.h:234:45: note: expanded from macro 'TARGET_PAGE_MASK'
#define TARGET_PAGE_MASK   ((target_long)-1 << TARGET_PAGE_BITS)
                             ~~~~~~~~~~~~~~~ ^
1 warning generated.

>From configure:

# We use -fwrapv to tell the compiler that we require a C dialect where
# left shift of signed integers is well defined and has the expected
# 2s-complement style results. (Both clang and gcc agree that it
# provides these semantics.)

Clang is *supposed* to be not generating those warnings.

I do have clang in my build tests, so at least some versions of
clang do indeed correctly handle -fwrapv. What version are
you using, Philippe ?

-fwrapv is here indeed.

I use --extra-cflags=-fsanitize=address,alignment,array-bounds,bool,builtin,enum,float-cast-overflow,float-divide-by-zero,function,integer-divide-by-zero,nonnull-attribute,null,pointer-overflow,return,returns-nonnull-attribute,shift-base,shift-exponent,signed-integer-overflow,unreachable,vla-bound,vptr

Apparently -fwrapv is ignored. Probably one of shift-base/shift-exponent sanitizer plugins.

-- PMM

reply via email to

[Prev in Thread] Current Thread [Next in Thread]