public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <jeffreyalaw@gmail.com>
To: SenthilKumar.Selvaraj@microchip.com, gcc-patches@gcc.gnu.org
Cc: chertykov@gmail.com, richard.guenther@gmail.com
Subject: Re: [Ping] Re: [PATCH] avr: Set param_min_pagesize to 0 [PR105523]
Date: Sat, 17 Jun 2023 10:56:28 -0600	[thread overview]
Message-ID: <bc555123-e830-0673-313c-61d962faa0be@gmail.com> (raw)
In-Reply-To: <499e8a6feacb26215db0547696642e75a17ffa2b.camel@microchip.com>



On 6/16/23 04:17, SenthilKumar.Selvaraj--- via Gcc-patches wrote:
> On Fri, 2023-06-02 at 12:32 +0530, Senthil Kumar Selvaraj wrote:
>> On Mon, 2023-05-22 at 14:05 +0200, Richard Biener wrote:
>>> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>>>
>>> On Fri, May 19, 2023 at 7:58 AM <SenthilKumar.Selvaraj@microchip.com> wrote:
>>>> On 26/04/23, 5:51 PM, "Richard Biener" <richard.guenther@gmail.com <mailto:richard.guenther@gmail.com>> wrote:
>>>>> On Wed, Apr 26, 2023 at 12:56 PM <SenthilKumar.Selvaraj@microchip.com <mailto:SenthilKumar.Selvaraj@microchip.com>> wrote:
>>>>>> On Wed, Apr 26, 2023 at 3:15 PM Richard Biener via Gcc-patches <gcc-patches@gcc.gnu.org <mailto:gcc-patches@gcc.gnu.org>> wrote:
>>>>>>> On Wed, Apr 26, 2023 at 11:42 AM Richard Biener
>>>>>>> <richard.guenther@gmail.com <mailto:richard.guenther@gmail.com>> wrote:
>>>>>>>> On Wed, Apr 26, 2023 at 11:01 AM SenthilKumar.Selvaraj--- via
>>>>>>>> Gcc-patches <gcc-patches@gcc.gnu.org <mailto:gcc-patches@gcc.gnu.org>> wrote:
>>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>> This patch fixes PR 105523 by setting param_min_pagesize to 0 for the
>>>>>>>>> avr target. For this target, zero and offsets from zero are perfectly
>>>>>>>>> valid addresses, and the default value of param_min_pagesize ends up
>>>>>>>>> triggering warnings on valid memory accesses.
>>>>>>>>
>>>>>>>> I think the proper configuration is to have
>>>>>>>> DEFAULT_ADDR_SPACE_ZERO_ADDRESS_VALID
>>>>>>>
>>>>>>> Err, TARGET_ADDR_SPACE_ZERO_ADDRESS_VALID
>>>>>>
>>>>>> That worked. Ok for trunk and backporting to 13 and 12 branches
>>>>>> (pending regression testing)?
>>>>>
>>>>> OK, but please let Denis time to comment.
>>>>
>>>> Didn't hear from Denis. When running regression tests with this patch,
>>>> I found that some tests with -fdelete-null-pointer-checks were
>>>> failing. Commit 19416210b37db0584cd0b3f3b3961324b8973d25 made
>>>> -fdelete-null-pointer-checks false by default, while still allowing it
>>>> to be overridden from the command line (it was previously
>>>> unconditionally false).
>>>>
>>>> To keep the same behavior, I modified the hook to report zero
>>>> addresses as valid only if -fdelete-null-pointer-checks is not set.
>>>> With this change, all regression tests pass.
>>>>
>>>> Ok for trunk and backporting to 13 and 12 branches?
>>>
>>> I think that's bit backwards - this hook conveys more precise information
>>> (it's address-space specific) and it is also more specific.  Instead I'd
>>> suggest to set the flag to zero in the target like nios2 or msp430 do.
>>> In fact we should probably initialize it using this hook (and using the
>>> default address space).
>>
>> Does the below patch work? The hook impl reports that zero address is
>> valid, and flag_delete_null_pointer_checks is set to zero if the
>> hook says zero is a valid address.
>>
>> As flag_delete_null_pointer_checks is now always disabled for avr, I
>> removed the resetting code in avr-common.cc that disables it for
>> OPT_LEVELS_ALL by default, and added avr as a target that always keeps
>> null pointer checks in testsuite/lib/target-supports.exp.
>>
>> I also removed ATTRIBUTE_UNUSED and the parameter name in the target
>> hook to address https://gcc.gnu.org/pipermail/gcc-patches/2023-May/619014.html.
>>
>> PR 105523
>>
>> gcc/ChangeLog:
>>
>> 	* common/config/avr/avr-common.cc: Remove setting
>> 	of OPT_fdelete_null_pointer_checks.
>> 	* config/avr/avr.cc (avr_option_override): Clear
>> 	flag_delete_null_pointer_checks if zero_address_valid.
>> 	(avr_addr_space_zero_address_valid): New function.
>> 	(TARGET_ADDR_SPACE_ZERO_ADDRESS_VALID): Provide target
>> 	hook.
>>
>> gcc/testsuite/ChangeLog:
>>
>> 	* lib/target-supports.exp
>> 	(check_effective_target_keeps_null_pointer_checks): Add
>> 	avr.
>> 	* gcc.target/avr/pr105523.c: New test.
OK for the trunk.

I don't think we're likely to hear from Denis.  I haven't heard from him 
in quite a while, nor has Georg.  So no need to wait.

jeff

      reply	other threads:[~2023-06-17 16:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-26  9:00 SenthilKumar.Selvaraj
2023-04-26  9:42 ` Richard Biener
2023-04-26  9:43   ` Richard Biener
2023-04-26 10:56     ` SenthilKumar.Selvaraj
2023-04-26 12:19       ` Richard Biener
2023-05-19  5:58         ` SenthilKumar.Selvaraj
2023-05-19 14:02           ` Bernhard Reutner-Fischer
2023-05-19 16:51             ` Jeff Law
2023-05-22 12:05           ` Richard Biener
2023-06-02  7:02             ` SenthilKumar.Selvaraj
2023-06-16 10:17               ` [Ping] " SenthilKumar.Selvaraj
2023-06-17 16:56                 ` Jeff Law [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=bc555123-e830-0673-313c-61d962faa0be@gmail.com \
    --to=jeffreyalaw@gmail.com \
    --cc=SenthilKumar.Selvaraj@microchip.com \
    --cc=chertykov@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=richard.guenther@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).