* [PATCH, fortran] PR71085 - ICE with some intrinsic functions specifying array function result dimension
@ 2018-03-02 20:52 Harald Anlauf
2018-03-04 5:14 ` Steve Kargl
0 siblings, 1 reply; 2+ messages in thread
From: Harald Anlauf @ 2018-03-02 20:52 UTC (permalink / raw)
To: fortran, gcc-patches
[-- Attachment #1: Type: text/plain, Size: 460 bytes --]
The fix to the PR probably counts as obvious, but here it is, along
with a testcase. Changelogs below.
Regtested on i686-pc-linux-gnu.
Whoever reviews this, please feel free to commit.
Thanks,
Harald
2018-03-02 Harald Anlauf <anlauf@gmx.de>
PR fortran/71085
* trans-expr.c (gfc_apply_interface_mapping_to_expr): Do not
dereference NULL pointer.
2018-03-02 Harald Anlauf <anlauf@gmx.de>
PR fortran/71085
* gfortran.dg/pr71085.f90: New test.
[-- Attachment #2: patch-pr71085 --]
[-- Type: text/plain, Size: 497 bytes --]
Index: gcc/fortran/trans-expr.c
===================================================================
--- gcc/fortran/trans-expr.c (revision 258112)
+++ gcc/fortran/trans-expr.c (working copy)
@@ -4349,6 +4349,8 @@
if (expr->value.function.esym == NULL
&& expr->value.function.isym != NULL
+ && expr->value.function.actual
+ && expr->value.function.actual->expr
&& expr->value.function.actual->expr->symtree
&& gfc_map_intrinsic_function (expr, mapping))
break;
[-- Attachment #3: patch-pr71085-testcase --]
[-- Type: text/plain, Size: 443 bytes --]
Index: gcc/testsuite/gfortran.dg/pr71085.f90
===================================================================
--- gcc/testsuite/gfortran.dg/pr71085.f90 (revision 0)
+++ gcc/testsuite/gfortran.dg/pr71085.f90 (revision 0)
@@ -0,0 +1,12 @@
+! { dg-do compile }
+! PR 71085
+!
+! Testcase from PR by Vladimir Fuka <vladimir.fuka@gmail.com>
+!
+program pr71085
+ print *, f()
+contains
+ function f()
+ integer :: f(iargc()*10)
+ end
+end
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH, fortran] PR71085 - ICE with some intrinsic functions specifying array function result dimension
2018-03-02 20:52 [PATCH, fortran] PR71085 - ICE with some intrinsic functions specifying array function result dimension Harald Anlauf
@ 2018-03-04 5:14 ` Steve Kargl
0 siblings, 0 replies; 2+ messages in thread
From: Steve Kargl @ 2018-03-04 5:14 UTC (permalink / raw)
To: Harald Anlauf; +Cc: fortran, gcc-patches
On Fri, Mar 02, 2018 at 09:52:17PM +0100, Harald Anlauf wrote:
> The fix to the PR probably counts as obvious, but here it is, along
> with a testcase. Changelogs below.
>
> Regtested on i686-pc-linux-gnu.
>
> Whoever reviews this, please feel free to commit.
>
Commit on 6-branch, 7-branch, and trunk.
--
Steve
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-03-04 5:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-02 20:52 [PATCH, fortran] PR71085 - ICE with some intrinsic functions specifying array function result dimension Harald Anlauf
2018-03-04 5:14 ` Steve Kargl
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).