From: Thomas Schwinge <thomas@codesourcery.com>
To: Jan Hubicka <hubicka@ucw.cz>, <gcc-patches@gcc.gnu.org>
Subject: Fix 'gcc.dg/tree-ssa/return-value-range-1.c' for 'char' defaulting to 'unsigned' (was: Propagate value ranges of return values)
Date: Tue, 21 Nov 2023 22:24:00 +0100 [thread overview]
Message-ID: <87r0kiu7f3.fsf@euler.schwinge.homeip.net> (raw)
In-Reply-To: <ZVokRs1zL7NY5cVe@kam.mff.cuni.cz>
[-- Attachment #1: Type: text/plain, Size: 1303 bytes --]
Hi!
On 2023-11-19T16:05:42+0100, Jan Hubicka <hubicka@ucw.cz> wrote:
> --- /dev/null
> +++ b/gcc/testsuite/gcc.dg/tree-ssa/return-value-range-1.c
Pushed to master branch commit a0240662b22312ffb3e3fefb85f258ab0e7010f4
"Fix 'gcc.dg/tree-ssa/return-value-range-1.c' for 'char' defaulting to
'unsigned'", see attached. On powerpc64le-linux-gnu ('char' defaulting
to 'unsigned') I still saw:
/tmp/ccd1xwD7.o: In function `test':
return-value-range-1.c:(.text+0x50): undefined reference to `link_error'
Grüße
Thomas
> @@ -0,0 +1,22 @@
> +/* { dg-do ling } */
> +/* { dg-options "-O1 -dump-tree-evrp-details" } */
> +__attribute__ ((__noinline__))
> +int a(char c)
> +{
> + return c;
> +}
> +void link_error ();
> +
> +void
> +test(int d)
> +{
> + if (a(d) > 200)
> + link_error ();
> +}
> +int
> +main(int argc, char **argv)
> +{
> + test(argc);
> + return 0;
> +}
> +/* { dg-final { scan-tree-dump-times "Recording return range" 2 "evrp"} } */
-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-gcc.dg-tree-ssa-return-value-range-1.c-for-char-.patch --]
[-- Type: text/x-diff, Size: 1119 bytes --]
From a0240662b22312ffb3e3fefb85f258ab0e7010f4 Mon Sep 17 00:00:00 2001
From: Thomas Schwinge <thomas@codesourcery.com>
Date: Tue, 21 Nov 2023 22:07:13 +0100
Subject: [PATCH] Fix 'gcc.dg/tree-ssa/return-value-range-1.c' for 'char'
defaulting to 'unsigned'
... added in recent commit 53ba8d669550d3a1f809048428b97ca607f95cf5
"inter-procedural value range propagation", fixed in
commit 878a860cae78146d98d7a21612f0bcec0930a9c2
"Fix 'gcc.dg/tree-ssa/return-value-range-1.c'".
gcc/testsuite/
* gcc.dg/tree-ssa/return-value-range-1.c: Fix.
---
gcc/testsuite/gcc.dg/tree-ssa/return-value-range-1.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/return-value-range-1.c b/gcc/testsuite/gcc.dg/tree-ssa/return-value-range-1.c
index 74f1a5080bb..97294482c05 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/return-value-range-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/return-value-range-1.c
@@ -1,7 +1,7 @@
/* { dg-do link } */
/* { dg-options "-O2 -fdump-tree-evrp-details" } */
__attribute__ ((__noinline__))
-int a(char c)
+int a(signed char c)
{
return c;
}
--
2.34.1
next prev parent reply other threads:[~2023-11-21 21:24 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-19 1:21 Propagate value ranges of return values Jan Hubicka
2023-11-19 11:30 ` Sam James
2023-11-19 14:31 ` Jan Hubicka
2023-11-19 15:05 ` Jan Hubicka
2023-11-20 16:28 ` Martin Jambor
2023-11-21 11:09 ` Fix 'gcc.dg/tree-ssa/return-value-range-1.c' (was: Propagate value ranges of return values) Thomas Schwinge
2023-11-21 12:18 ` Jan Hubicka
2023-11-21 13:58 ` Propagate value ranges of return values Christophe Lyon
2023-11-21 14:06 ` Jan Hubicka
2023-11-21 21:35 ` Thomas Schwinge
2023-11-23 7:24 ` Andrew Pinski
2023-11-21 21:24 ` Thomas Schwinge [this message]
2023-11-22 10:51 ` Fix 'gcc.dg/tree-ssa/return-value-range-1.c' for 'char' defaulting to 'unsigned' (was: Propagate value ranges of return values) Christophe Lyon
2023-11-22 11:05 ` Thomas Schwinge
2023-11-22 17:16 ` Adjust 'libgomp.c/declare-variant-{3,4}-[...]' for inter-procedural value range propagation " Thomas Schwinge
2023-11-20 14:50 ` Propagate value ranges of return values Andrew MacLeod
2023-11-20 15:34 ` Jan Hubicka
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=87r0kiu7f3.fsf@euler.schwinge.homeip.net \
--to=thomas@codesourcery.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=hubicka@ucw.cz \
/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).