public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r10-7250] analyzer: add test coverage for fixed ICE [PR94047]
@ 2020-03-18 13:59 David Malcolm
  0 siblings, 0 replies; only message in thread
From: David Malcolm @ 2020-03-18 13:59 UTC (permalink / raw)
  To: gcc-cvs

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

commit r10-7250-gf665beeba625490bd96a593d23e00726d969cf98
Author: David Malcolm <dmalcolm@redhat.com>
Date:   Tue Mar 10 18:50:03 2020 -0400

    analyzer: add test coverage for fixed ICE [PR94047]
    
    PR analyzer/94047 reports an ICE, which turned out to be caused
    by the erroneous use of TREE_TYPE on the view region's type
    in region_model::get_representative_path_var that I introduced
    in r10-7024-ge516294a1acb28aaaad44cfd583cc6a80354044e and
    fixed in g:787477a226033e36be3f6d16b71be13dd917e982.
    
    This patch adds a regression test for the ICE.
    
    gcc/testsuite/ChangeLog:
            PR analyzer/94047
            * gcc.dg/analyzer/pr94047.c: New test.

Diff:
---
 gcc/testsuite/ChangeLog                 |  5 +++++
 gcc/testsuite/gcc.dg/analyzer/pr94047.c | 23 +++++++++++++++++++++++
 2 files changed, 28 insertions(+)

diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 4aa798f8a48..a91d7377888 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2020-03-18  David Malcolm  <dmalcolm@redhat.com>
+
+	PR analyzer/94047
+	* gcc.dg/analyzer/pr94047.c: New test.
+
 2020-03-18   Richard Biener  <rguenther@suse.de>
 
 	PR middle-end/94206
diff --git a/gcc/testsuite/gcc.dg/analyzer/pr94047.c b/gcc/testsuite/gcc.dg/analyzer/pr94047.c
new file mode 100644
index 00000000000..d989a254c9e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/pr94047.c
@@ -0,0 +1,23 @@
+/* { dg-additional-options "-Wno-analyzer-too-complex" } */
+/* TODO: the above ought not to be necessary, but currently is due to a
+   state explosion within the for loop.  */
+
+typedef struct list
+{
+  struct list *next;
+} tlist;
+
+void
+bar (struct list *l)
+{
+  l->next = l->next->next;
+}
+
+void
+foo (void)
+{
+  struct list l;
+  tlist t = l;
+  for (;;)
+    bar (&t);
+}


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-03-18 13:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-18 13:59 [gcc r10-7250] analyzer: add test coverage for fixed ICE [PR94047] David Malcolm

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).