public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Martin Sebor <msebor@gmail.com>
To: Kyrylo Tkachov <Kyrylo.Tkachov@arm.com>,
	Christophe Lyon <christophe.lyon@linaro.org>
Cc: gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH libatomic/arm] avoid warning on constant addresses (PR 101379)
Date: Wed, 21 Jul 2021 10:54:25 -0600	[thread overview]
Message-ID: <c3d2efea-5190-0402-7024-166bff66f924@gmail.com> (raw)
In-Reply-To: <PAXPR08MB692693A0FAFA06B83D1E509293E39@PAXPR08MB6926.eurprd08.prod.outlook.com>

On 7/21/21 10:41 AM, Kyrylo Tkachov wrote:
> 
> 
>> -----Original Message-----
>> From: Gcc-patches <gcc-patches-
>> bounces+kyrylo.tkachov=arm.com@gcc.gnu.org> On Behalf Of Martin Sebor
>> via Gcc-patches
>> Sent: 10 July 2021 00:11
>> To: gcc-patches <gcc-patches@gcc.gnu.org>; Christophe Lyon
>> <christophe.lyon@linaro.org>
>> Subject: [PATCH libatomic/arm] avoid warning on constant addresses (PR
>> 101379)
>>
>> The attached tweak avoids the new -Warray-bounds instances when
>> building libatomic for arm. Christophe confirms it resolves
>> the problem (thank you!)
>>
>> As we have discussed, the main goal of this class of warnings
>> is to detect accesses at addresses derived from null pointers
>> (e.g., to struct members or array elements at a nonzero offset).
>> Diagnosing accesses at hardcoded addresses is incidental because
>> at the stage they are detected the two are not distinguishable
>> from each another.
>>
>> I'm planning (hoping) to implement detection of invalid pointer
>> arithmetic involving null for GCC 12, so this patch is a stopgap
>> solution to unblock the arm libatomic build without compromising
>> the warning.  Once the new detection is in place these workarounds
>> can be removed or replaced with something more appropriate (e.g.,
>> declaring the objects at the hardwired addresses with an attribute
>> like AVR's address or io; that would enable bounds checking at
>> those addresses as well).
> 
> Let's get this patch in to unbreak bootstrap while the discussion on how to avoid these workarounds continues...
> So ok.

I just pushed it in r12-2438.

Martin

> Thanks,
> Kyrill
> 
>>
>> Martin


      reply	other threads:[~2021-07-21 16:54 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-09 23:11 Martin Sebor
2021-07-15  8:33 ` Christophe Lyon
2021-07-16 17:42 ` Thomas Schwinge
2021-07-16 21:11   ` Martin Sebor
2021-07-19  8:49     ` Thomas Schwinge
2021-07-17 22:28   ` Andrew Stubbs
2021-07-19  8:46     ` [gcn] Work-around libgomp 'error: array subscript 0 is outside array bounds of ‘__lds struct gomp_thread * __lds[0]’ [-Werror=array-bounds]' (was: [PATCH libatomic/arm] avoid warning on constant addresses (PR 101379)) Thomas Schwinge
2021-07-19  8:56       ` Jakub Jelinek
2021-07-19 11:10       ` Andrew Stubbs
2021-07-20  7:23       ` [gcn] Work-around libgomp 'error: array subscript 0 is outside array bounds of ‘__lds struct gomp_thread * __lds[0]’ [-Werror=array-bounds]' Thomas Schwinge
2021-07-20  8:40         ` '#pragma GCC diagnostic' (mis-)use in 'statement' of 'if' (was: [gcn] Work-around libgomp 'error: array subscript 0 is outside array bounds of ‘__lds struct gomp_thread * __lds[0]’ [-Werror=array-bounds]') Thomas Schwinge
2021-07-20 19:47           ` '#pragma GCC diagnostic' (mis-)use in 'statement' of 'if' Martin Sebor
2021-07-20 20:16             ` Jakub Jelinek
2021-07-21 16:41 ` [PATCH libatomic/arm] avoid warning on constant addresses (PR 101379) Kyrylo Tkachov
2021-07-21 16:54   ` Martin Sebor [this message]

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=c3d2efea-5190-0402-7024-166bff66f924@gmail.com \
    --to=msebor@gmail.com \
    --cc=Kyrylo.Tkachov@arm.com \
    --cc=christophe.lyon@linaro.org \
    --cc=gcc-patches@gcc.gnu.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).