aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2016-06-20 23:41:20 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2016-06-20 23:41:20 +0200
commit50aa64d58fd4cea25df2a9d9ddfc38e74dcdd94c (patch)
tree73e0044763a990884447efafc1f4b1bfa26a1407 /gcc/testsuite/gcc.dg
parent7a9df68ec6a8752f2e95e8ca1ca1fc53384c90c6 (diff)
downloadgcc-50aa64d58fd4cea25df2a9d9ddfc38e74dcdd94c.zip
gcc-50aa64d58fd4cea25df2a9d9ddfc38e74dcdd94c.tar.gz
gcc-50aa64d58fd4cea25df2a9d9ddfc38e74dcdd94c.tar.bz2
re PR middle-end/71581 (ICE on valid code on x86_64-linux-gnu with -Wuninitialized (Segmentation fault))
PR middle-end/71581 * tree-ssa-uninit.c (warn_uninit): If EXPR and VAR are NULL, see if T isn't anonymous SSA_NAME with COMPLEX_EXPR created for conversion of scalar user var to complex type and use the underlying SSA_NAME_VAR in that case. If EXPR is still NULL, punt. * gcc.dg/pr71581.c: New test. From-SVN: r237621
Diffstat (limited to 'gcc/testsuite/gcc.dg')
-rw-r--r--gcc/testsuite/gcc.dg/pr71581.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pr71581.c b/gcc/testsuite/gcc.dg/pr71581.c
new file mode 100644
index 0000000..d82eb1e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr71581.c
@@ -0,0 +1,24 @@
+/* PR middle-end/71581 */
+/* { dg-do compile } */
+/* { dg-options "-Wuninitialized" } */
+
+_Complex float
+f1 (void)
+{
+ float x;
+ return x; /* { dg-warning "is used uninitialized in this function" } */
+}
+
+_Complex double
+f2 (void)
+{
+ double x;
+ return x; /* { dg-warning "is used uninitialized in this function" } */
+}
+
+_Complex int
+f3 (void)
+{
+ int x;
+ return x; /* { dg-warning "is used uninitialized in this function" } */
+}