public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r11-8161] PR middle-end/86058 - TARGET_MEM_REF causing incorrect message for -Wmaybe-uninitialized warning
@ 2021-04-13 19:48 Martin Sebor
0 siblings, 0 replies; only message in thread
From: Martin Sebor @ 2021-04-13 19:48 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:8084ab15a3e300e3b2c537e56e0f3a1b00778aec
commit r11-8161-g8084ab15a3e300e3b2c537e56e0f3a1b00778aec
Author: Martin Sebor <msebor@redhat.com>
Date: Tue Apr 13 13:46:21 2021 -0600
PR middle-end/86058 - TARGET_MEM_REF causing incorrect message for -Wmaybe-uninitialized warning
gcc/testsuite/ChangeLog:
PR middle-end/86058
* gcc.dg/pr86058.c: New test.
Diff:
---
gcc/testsuite/gcc.dg/pr86058.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/gcc/testsuite/gcc.dg/pr86058.c b/gcc/testsuite/gcc.dg/pr86058.c
new file mode 100644
index 00000000000..0b030b04acf
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr86058.c
@@ -0,0 +1,18 @@
+/* PR middle-end/86058 - TARGET_MEM_REF causing incorrect message for
+ -Wmaybe-uninitialized warning
+ { dg-do compile }
+ { dg-options "-O2 -Wuninitialized -Wmaybe-uninitialized" } */
+
+extern void foo (int *);
+
+void zip (int *out, int indx)
+{
+ int arr[10];
+
+ for (int i = 0; i < indx; ++i)
+ out[i] = arr[i] + 1; // { dg-warning "'arr\\\[i]' may be used uninitialized" "pr?????" { xfail *-*-* } }
+ // { dg-warning "'arr' may be used uninitialized" "actual" { target *-*-* } .-1 }
+
+ foo (arr);
+ foo (out);
+}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-04-13 19:48 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-13 19:48 [gcc r11-8161] PR middle-end/86058 - TARGET_MEM_REF causing incorrect message for -Wmaybe-uninitialized warning Martin Sebor
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).