public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/c++-coroutines] analyzer: add test coverage for gfortran ICE fix [PR 93779]
@ 2020-02-18 20:44 Iain D Sandoe
  0 siblings, 0 replies; only message in thread
From: Iain D Sandoe @ 2020-02-18 20:44 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:68f9c41d54a7839e90d10e1400c8726c8ccde88d

commit 68f9c41d54a7839e90d10e1400c8726c8ccde88d
Author: David Malcolm <dmalcolm@redhat.com>
Date:   Mon Feb 17 03:28:08 2020 -0500

    analyzer: add test coverage for gfortran ICE fix [PR 93779]
    
    PR analyzer/93779 reports an ICE in gfortran with -fanalyzer
    that was fixed for GCC 10 by a workaround in
    f76a88ebf089871dcce215aa0cb1956ccc060895; the tree code in
    question is a FUNCTION_DECL.
    
    Given that I want to rework the above patch at some point, it seems
    prudent to add test coverage to ensure the ICE doesn't come back,
    which this patch does.
    
    gcc/testsuite/ChangeLog:
    	PR analyzer/93779
    	* gfortran.dg/analyzer/pr88304-2.f90: New test, adapted from
    	gfortran.fortran-torture/compile/pr88304-2.f90

Diff:
---
 gcc/testsuite/ChangeLog                          |  6 +++++
 gcc/testsuite/gfortran.dg/analyzer/pr88304-2.f90 | 29 ++++++++++++++++++++++++
 2 files changed, 35 insertions(+)

diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index f9a545e..c6b76df 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2020-02-18  David Malcolm  <dmalcolm@redhat.com>
+
+	PR analyzer/93779
+	* gfortran.dg/analyzer/pr88304-2.f90: New test, adapted from
+	gfortran.fortran-torture/compile/pr88304-2.f90
+
 2020-02-18  Mark Eggleston  <mark.eggleston@codethink.com>
 
 	PR fortran/93603
diff --git a/gcc/testsuite/gfortran.dg/analyzer/pr88304-2.f90 b/gcc/testsuite/gfortran.dg/analyzer/pr88304-2.f90
new file mode 100644
index 0000000..6b3ab89
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/analyzer/pr88304-2.f90
@@ -0,0 +1,29 @@
+! Copy of gfortran.fortran-torture/compile/pr88304-2.f90
+! as a regression test for ICE with -fanalyzer (PR analyzer/93779)
+
+module pr88304
+  implicit none
+  integer :: p
+contains
+  function foo (x, y, z, w)
+    integer, intent(in) :: x, y
+    character(*), optional, intent(out) :: z
+    integer, optional, intent(out) :: w
+    integer :: foo
+    foo = 1
+  end function foo
+  subroutine bar ()
+    integer :: s
+    s = baz (1)
+  contains
+    function baz (u)
+      integer, intent(in) :: u
+      integer :: baz
+      integer :: q
+      integer :: r (10)
+      r = 0
+      baz = 1
+      q = foo (p, r(u), w = baz)
+    end function baz
+  end subroutine bar
+end module pr88304


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

only message in thread, other threads:[~2020-02-18 20:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-18 20:44 [gcc/devel/c++-coroutines] analyzer: add test coverage for gfortran ICE fix [PR 93779] Iain D Sandoe

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