Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Luis Machado via Gdb-patches <gdb-patches@sourceware.org>
To: gdb-patches@sourceware.org
Subject: Re: [PATCH 1/6] sim: sh: rework register layout with anonymous unions & structs
Date: Fri, 12 Nov 2021 10:12:58 -0300	[thread overview]
Message-ID: <2285394c-b1fc-6a3a-6651-5475256fbabe@linaro.org> (raw)
In-Reply-To: <YY2dE6MatjSLmzWY@vapier>

On 11/11/21 7:45 PM, Mike Frysinger wrote:
> On 11 Nov 2021 19:32, Luis Machado via Gdb-patches wrote:
>> On 11/11/21 7:25 PM, Mike Frysinger wrote:
>>> On 11 Nov 2021 09:41, Luis Machado wrote:
>>>> I can't pinpoint the exact SH patch, but builds are broken for
>>>> --enable-targets=all in Ubuntu 18.04 with GCC 7.5:
>>>
>>> pretty sure the warnings have always been there for you, we just turned
>>> -Werror in more cases recently
>>
>> That's fine and I'm all for more -Werror. But builds should be able to
>> complete regardless, right?
> 
> they do build for me in a huge variety of configurations.  but i don't test
> every random distro version that people might have.  plus for release, we
> turn off automatic -Werror, so the issue you highlight only affects the
> live development tree.  it's not going to break releases that distros use.
> 

None of us test every possible combination. It is not easy to have high 
coverage without some sort of CI in place.

>>>> binutils-gdb/sim/sh/interp.c: In function ‘ppi_insn’:
>>>> ./ppi.c:875:21: error: assuming signed overflow does not occur when
>>>> assuming that (X + c) < X is always false [-Werror=strict-overflow]
>>>>             carry = res < Sy;
>>>>                     ~~~~^~~~
>>>> ./ppi.c:849:21: error: assuming signed overflow does not occur when
>>>> assuming that (X - c) > X is always false [-Werror=strict-overflow]
>>>>             carry = res > Sy;
>>>>                     ~~~~^~~~
>>>> ./ppi.c:823:21: error: assuming signed overflow does not occur when
>>>> assuming that (X + c) < X is always false [-Werror=strict-overflow]
>>>>             carry = res < Sx;
>>>>                     ~~~~^~~~
>>>> ./ppi.c:797:21: error: assuming signed overflow does not occur when
>>>> assuming that (X - c) > X is always false [-Werror=strict-overflow]
>>>>             carry = res > Sx;
>>>>                     ~~~~^~~~
>>>> binutils-gdb-arm64-bionic/sim/../../../repos/binutils-gdb/sim/sh/interp.c:
>>>> In function ‘sim_resume’:
>>>> ./ppi.c:1178:28: warning: ‘res’ may be used uninitialized in this
>>>> function [-Wmaybe-uninitialized]
>>>>               MACL = DSP_R (z) = res;
>>>> ./ppi.c:44:7: note: ‘res’ was declared here
>>>>       int res, res_grd;
>>>>           ^~~
>>>
>>> how exactly are you building things ?  we don't enable -Wstrict-overflow.
>>
>> No special way. I just ./configure with --enable-targets=all and let it
>> run. I can bisect it or gather a bit more information if you think it
>> would be useful.
> 
> bisect would't really help.  as i said, the warnings have probably long been
> there.  what changed is using -Werror in more places, and that commit is easy
> to pick out.
> 
>> Worth mentioning that it doesn't run into such warnings/failures on
>> Ubuntu 20.04 with gcc 9.3.
> 
> it looks like gcc changed behavior starting in gcc-8.  in older versions,
> -fstrict-overflow was enabled at -O2.

Since I have it handy here, let me go through it and try to come up with 
a fix for the ones I'm seeing.

  reply	other threads:[~2021-11-12 13:14 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-07  0:32 Mike Frysinger via Gdb-patches
2021-11-07  0:32 ` [PATCH 2/6] sim: sh: fix unused-value warnings Mike Frysinger via Gdb-patches
2021-11-07  0:32 ` [PATCH 3/6] sim: sh: fix various parentheses warnings Mike Frysinger via Gdb-patches
2021-11-07  0:32 ` [PATCH 4/6] sim: sh: constify a few read-only lookup tables Mike Frysinger via Gdb-patches
2021-11-07  0:32 ` [PATCH 5/6] sim: sh: fix uninitialized variable usage with pdmsb Mike Frysinger via Gdb-patches
2021-11-07  0:32 ` [PATCH 6/6] sim: sh: enable -Werror everywhere Mike Frysinger via Gdb-patches
2021-11-11 12:41 ` [PATCH 1/6] sim: sh: rework register layout with anonymous unions & structs Luis Machado via Gdb-patches
2021-11-11 22:25   ` Mike Frysinger via Gdb-patches
2021-11-11 22:32     ` Luis Machado via Gdb-patches
2021-11-11 22:38       ` Luis Machado via Gdb-patches
2021-11-11 22:45       ` Mike Frysinger via Gdb-patches
2021-11-12 13:12         ` Luis Machado via Gdb-patches [this message]
2021-11-12  0:39   ` [PATCH 1/2] sim: sh: rework carry checks to not rely on integer overflows Mike Frysinger via Gdb-patches
2021-11-12  0:39     ` [PATCH 2/2] sim: sh: fix switch-bool warnings Mike Frysinger via Gdb-patches

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=2285394c-b1fc-6a3a-6651-5475256fbabe@linaro.org \
    --to=gdb-patches@sourceware.org \
    --cc=luis.machado@linaro.org \
    /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