public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Martin Jambor <jamborm@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r14-8997] testsuite: Fix guality/ipa-sra-1.c to work with return IPA-VRP
Date: Thu, 15 Feb 2024 10:51:27 +0000 (GMT)	[thread overview]
Message-ID: <20240215105127.F053638618BA@sourceware.org> (raw)

https://gcc.gnu.org/g:f0e2714f241b1dcf867c2cfc5586bdea63dbf891

commit r14-8997-gf0e2714f241b1dcf867c2cfc5586bdea63dbf891
Author: Martin Jambor <mjambor@suse.cz>
Date:   Thu Feb 15 11:50:34 2024 +0100

    testsuite: Fix guality/ipa-sra-1.c to work with return IPA-VRP
    
    The test guality/ipa-sra-1.c stopped working after
    r14-5628-g53ba8d669550d3 because the variable from which the values of
    removed parameters could be calculated is also removed with it.  Fixed
    with this patch which stops a function from returning a constant.
    
    I have also noticed that the XFAILed test passes at -O0 -O1 and -Og on
    all (three) targets I have tried, not just aarch64, so I extended the
    xfail exception accordingly.
    
    gcc/testsuite/ChangeLog:
    
    2024-02-14  Martin Jambor  <mjambor@suse.cz>
    
            * gcc.dg/guality/ipa-sra-1.c (get_val1): Move up in the file.
            (get_val2): Likewise.
            (bar): Do not return a constant.  Extend xfail exception for all
            targets.

Diff:
---
 gcc/testsuite/gcc.dg/guality/ipa-sra-1.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/gcc/testsuite/gcc.dg/guality/ipa-sra-1.c b/gcc/testsuite/gcc.dg/guality/ipa-sra-1.c
index 9ef4eac93a7f..55267c6f8380 100644
--- a/gcc/testsuite/gcc.dg/guality/ipa-sra-1.c
+++ b/gcc/testsuite/gcc.dg/guality/ipa-sra-1.c
@@ -1,6 +1,10 @@
 /* { dg-do run } */
 /* { dg-options "-g -fno-ipa-icf" } */
 
+int __attribute__((noipa))
+get_val1 (void)  {return 20;}
+int __attribute__((noipa))
+get_val2 (void)  {return 7;}
 
 void __attribute__((noipa))
 use (int x)
@@ -12,8 +16,8 @@ static int __attribute__((noinline))
 bar (int i, int k)
 {
   asm ("" : "+r" (i));
-  use (i);		/* { dg-final { gdb-test . "k" "3" { xfail { ! { aarch64*-*-* && { any-opts "-O0" "-O1" "-Og" } } } } } } */
-  return 6;
+  use (i);		/* { dg-final { gdb-test . "k" "3" { xfail { ! { *-*-*-* && { any-opts "-O0" "-O1" "-Og" } } } } } } */
+  return 6 + get_val1();
 }
 
 volatile int v;
@@ -30,11 +34,6 @@ foo (int i, int k)
 
 volatile int v;
 
-int __attribute__((noipa))
-get_val1 (void)  {return 20;}
-int __attribute__((noipa))
-get_val2 (void)  {return 7;}
-
 int
 main (void)
 {

                 reply	other threads:[~2024-02-15 10:51 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20240215105127.F053638618BA@sourceware.org \
    --to=jamborm@gcc.gnu.org \
    --cc=gcc-cvs@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).