public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Peter Bergner <bergner@linux.ibm.com>
To: Jakub Jelinek <jakub@redhat.com>, Richard Biener <rguenther@suse.de>
Cc: Jason Merrill <jason@redhat.com>, Martin Jambor <mjambor@suse.cz>,
	GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] SRA: Force gimple operand in an additional corner case (PR 112822)
Date: Wed, 13 Dec 2023 08:21:37 -0600	[thread overview]
Message-ID: <22161c26-6889-41b3-af07-2aad88bf84bf@linux.ibm.com> (raw)
In-Reply-To: <ZXllscs6Ovx0diIC@tucnak>

On 12/13/23 2:05 AM, Jakub Jelinek wrote:
> On Wed, Dec 13, 2023 at 08:51:16AM +0100, Richard Biener wrote:
>> On Tue, 12 Dec 2023, Peter Bergner wrote:
>>
>>> On 12/12/23 8:36 PM, Jason Merrill wrote:
>>>> This test is failing for me below C++17, I think you need
>>>>
>>>> // { dg-do compile { target c++17 } }
>>>> or
>>>> // { dg-require-effective-target c++17 }
>>>
>>> Sorry about that.  Should we do the above or should we just add
>>> -std=c++17 to dg-options?  ...or do we need to do both?
>>
>> Just do the above, the C++ testsuite iterates over all standards,
>> adding -std=c++17 would just run that 5 times.  But the above
>> properly skips unsupported cases.
> 
> I believe if one uses explicit -std=gnu++17 or -std=c++17 in dg-options
> then it will not iterate:
>         # If the testcase specifies a standard, use that one.
>         # If not, run it under several standards, allowing GNU extensions
>         # if there's a dg-options line.
>         if ![search_for $test "-std=*++"] {
> and otherwise how many times exactly it iterates depends on what the user
> asked for or what effective target is there (normally the default is
> to iterate 4 times (98,14,17,20), one can use e.g.
> GXX_TESTSUITE_STDS=98,11,14,17,20,23,26 to iterate 7 times, or the
> default also changes if c++23, c++26 or c++11_only effective targets
> are present somewhere in the test.
> 
> But sure, if the test is valid in C++17, 20, 23, 26, then
> // { dg-do compile { target c++17 } }
> is best (unless the test is mostly language version independent and
> very expensive to compile or run).

I confirmed the test case builds with C++17, 20, 23, 26 and errors out
with C++11, so I went with your solution.  Thanks for the input and
sorry for the breakage.  Pushed.

Peter


testsuite: Add dg-do compile target c++17 directive for testcase [PR112822]
    
Add dg-do compile target directive that limits the test case to being built
on c++17 compiles or greater.
    
2023-12-13  Peter Bergner  <bergner@linux.ibm.com>
    
gcc/testsuite/
	PR tree-optimization/112822
	* g++.dg/pr112822.C: Add dg-do compile target c++17 directive.

diff --git a/gcc/testsuite/g++.dg/pr112822.C b/gcc/testsuite/g++.dg/pr112822.C
index d1490405493..a8557522467 100644
--- a/gcc/testsuite/g++.dg/pr112822.C
+++ b/gcc/testsuite/g++.dg/pr112822.C
@@ -1,4 +1,5 @@
 /* PR tree-optimization/112822 */
+/* { dg-do compile { target c++17 } } */
 /* { dg-options "-w -O2" } */
 
 /* Verify we do not ICE on the following noisy creduced test case.  */



  reply	other threads:[~2023-12-13 14:21 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-12 16:50 Martin Jambor
2023-12-12 17:17 ` Richard Biener
2023-12-12 18:45 ` Peter Bergner
2023-12-12 18:51   ` Peter Bergner
2023-12-12 19:26     ` Richard Biener
2023-12-12 22:50       ` Peter Bergner
2023-12-13  2:36         ` Jason Merrill
2023-12-13  5:26           ` Peter Bergner
2023-12-13  7:51             ` Richard Biener
2023-12-13  8:05               ` Jakub Jelinek
2023-12-13 14:21                 ` Peter Bergner [this message]
2023-12-13 16:24           ` Jason Merrill
2023-12-13 16:26             ` Jakub Jelinek
2023-12-13 19:23               ` Jason Merrill

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=22161c26-6889-41b3-af07-2aad88bf84bf@linux.ibm.com \
    --to=bergner@linux.ibm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=jason@redhat.com \
    --cc=mjambor@suse.cz \
    --cc=rguenther@suse.de \
    /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).