public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: Martin Sebor <msebor@gmail.com>
Cc: Ian Lance Taylor <iant@golang.org>,
	gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: disable -Warray-bounds in libgo (PR 101374)
Date: Fri, 9 Jul 2021 08:16:24 +0200	[thread overview]
Message-ID: <CAFiYyc3Z9=DzOw4vA4YYZ+oUSSDFP2SUnyoqO63c4F3izzZ_Vw@mail.gmail.com> (raw)
In-Reply-To: <fb2ac973-7da9-0431-736f-893debfefd8d@gmail.com>

On Thu, Jul 8, 2021 at 8:02 PM Martin Sebor via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> Hi Ian,
>
> Yesterday's enhancement to -Warray-bounds has exposed a couple of
> issues in libgo where the code writes into an invalid constant
> address that the warning is designed to flag.
>
> On the assumption that those invalid addresses are deliberate,
> the attached patch suppresses these instances by using #pragma
> GCC diagnostic but I don't think I'm supposed to commit it (at
> least Git won't let me).  To avoid Go bootstrap failures please
> either apply the patch or otherwise suppress the warning (e.g.,
> by using a volatile pointer temporary).

Btw, I don't think we should diagnose things like

                *(int*)0x21 = 0x21;

when somebody literally writes that he'll be just annoyed by diagnostics.

Of course the above might be able to use __builtin_trap (); - it looks
like it is placed where control flow should never end, kind of a
__builtin_unreachable (), which means abort () might do as well.

Richard.

> Thanks
> Martin

  parent reply	other threads:[~2021-07-09  6:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-08 18:02 Martin Sebor
2021-07-08 21:07 ` Rainer Orth
2021-07-09 13:26   ` Rainer Orth
2021-07-12 16:34     ` Martin Sebor
2021-07-13  7:40       ` Rainer Orth
2021-07-09  6:16 ` Richard Biener [this message]
2021-07-09 13:19   ` Maxim Kuvyrkov
2021-07-09 19:46     ` Martin Sebor
2021-07-09 16:37   ` Martin Sebor
2021-07-10  2:49   ` Ian Lance Taylor
2021-07-13 18:30   ` Dimitar Dimitrov

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='CAFiYyc3Z9=DzOw4vA4YYZ+oUSSDFP2SUnyoqO63c4F3izzZ_Vw@mail.gmail.com' \
    --to=richard.guenther@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=iant@golang.org \
    --cc=msebor@gmail.com \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).