public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <jeffreyalaw@gmail.com>
To: Alexandre Oliva <oliva@adacore.com>, gcc-patches@gcc.gnu.org
Cc: cnsun@uwaterloo.ca
Subject: Re: [PR100843] store by mult pieces: punt on max_len < min_len
Date: Fri, 10 Dec 2021 15:33:27 -0700	[thread overview]
Message-ID: <00e83976-f1f2-9080-6d97-2703ed1dc7a4@gmail.com> (raw)
In-Reply-To: <orh7bh77ao.fsf@lxoliva.fsfla.org>



On 12/9/2021 3:16 PM, Alexandre Oliva via Gcc-patches wrote:
> The testcase confuses the code that detects min and max len for the
> memset, so max_len ends up less than min_len.  That shouldn't be
> possible, but the testcase requires us to handle this case.
>
> The store-by-mult-pieces algorithm actually relies on min and max
> lengths, so if we find them to be inconsistent, the best we can do is
> punting.
>
> Regstrapped on x86_64-linux-gnu.  Ok to install?
>
>
> for  gcc/ChangeLog
>
> 	PR middle-end/100843
> 	* builtins.c (try_store_by_multiple_pieces): Fail if min_len
> 	is greater than max_len.
>
> for  gcc/testsuite/ChangeLog
>
> 	PR middle-end/100843
> 	* gcc.dg/pr100843.c: New.
The patch is clearly safe.  My question is should we have caught this 
earlier in the call chain?  If so, I'd prefer to fix it there and leave 
the gcc_unreachable in place to catch other bogus cases that may get 
into try_store_by_multiple_pieces.


Jeff

  reply	other threads:[~2021-12-10 22:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-09 22:16 Alexandre Oliva
2021-12-10 22:33 ` Jeff Law [this message]
2021-12-11  5:18   ` Alexandre Oliva
2021-12-14 21:58     ` Jeff Law

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=00e83976-f1f2-9080-6d97-2703ed1dc7a4@gmail.com \
    --to=jeffreyalaw@gmail.com \
    --cc=cnsun@uwaterloo.ca \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=oliva@adacore.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).