qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>,
	Richard Henderson <richard.henderson@linaro.org>
Cc: "Igor Mammedov" <imammedo@redhat.com>,
	"Richard Henderson" <rth@twiddle.net>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"Yoshinori Sato" <ysato@users.sourceforge.jp>,
	"QEMU Developers" <qemu-devel@nongnu.org>
Subject: Re: [PULL v2 05/13] target/rx: CPU definitions
Date: Fri, 20 Mar 2020 17:32:38 +0100	[thread overview]
Message-ID: <70930618-a369-cb26-1b9b-aa7864deefc9@redhat.com> (raw)
In-Reply-To: <CAFEAcA8RM6U1hKX1Wn5YmR71y=VrGimt46z_OR=+O1i9neahiw@mail.gmail.com>

On 3/20/20 5:21 PM, Peter Maydell wrote:
> On Fri, 20 Mar 2020 at 16:19, Richard Henderson
> <richard.henderson@linaro.org> 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.

> 
> thanks
> -- PMM
> 



  reply	other threads:[~2020-03-20 16:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-20 10:35 [PULL v2 00/13] target: Add the Renesas RX architecture Philippe Mathieu-Daudé
2020-03-20 10:35 ` [PULL v2 05/13] target/rx: CPU definitions Philippe Mathieu-Daudé
2020-03-20 16:04   ` Philippe Mathieu-Daudé
2020-03-20 16:18     ` Richard Henderson
2020-03-20 16:21       ` Peter Maydell
2020-03-20 16:32         ` Philippe Mathieu-Daudé [this message]
2020-03-20 16:37           ` Peter Maydell
2020-03-21 11:05             ` Philippe Mathieu-Daudé
2020-03-21 11:17               ` Philippe Mathieu-Daudé
2020-03-20 13:53 ` [PULL v2 00/13] target: Add the Renesas RX architecture Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=70930618-a369-cb26-1b9b-aa7864deefc9@redhat.com \
    --to=philmd@redhat.com \
    --cc=f4bug@amsat.org \
    --cc=imammedo@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=rth@twiddle.net \
    --cc=ysato@users.sourceforge.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).