* [patch, fortran, committed] Fix regression caused by clobber for INTENT(OUT) patch
@ 2018-09-23 11:40 Thomas Koenig
0 siblings, 0 replies; only message in thread
From: Thomas Koenig @ 2018-09-23 11:40 UTC (permalink / raw)
To: fortran, gcc-patches
[-- Attachment #1: Type: text/plain, Size: 534 bytes --]
Hello world,
the attached patch, committed as obvious, fixes a regression
introduced by yesterday's patch. Apparently, clobber statements
are even more finicky that I thought and do not work for saved
variables either.
Regards
Thomas
2018-09-23 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/87395
* gfc_conv_procedure_call: Reformat comments slightly. Do not add
clobber on INTENT(OUT) for saved variables.
2018-09-23 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/87395
* gfortran.dg/intent_out_10.f90: New test.
[-- Attachment #2: p6.diff --]
[-- Type: text/x-patch, Size: 719 bytes --]
Index: trans-expr.c
===================================================================
--- trans-expr.c (Revision 264506)
+++ trans-expr.c (Arbeitskopie)
@@ -5281,7 +5281,10 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol *
add_clobber = fsym && fsym->attr.intent == INTENT_OUT
&& !fsym->attr.allocatable && !fsym->attr.pointer
&& !e->symtree->n.sym->attr.pointer
- && !e->symtree->n.sym->attr.dummy /* See PR 41453. */
+ /* See PR 41453. */
+ && !e->symtree->n.sym->attr.dummy
+ /* FIXME - PR 87395 and PR 41453 */
+ && e->symtree->n.sym->attr.save == SAVE_NONE
&& e->ts.type != BT_CHARACTER && e->ts.type != BT_DERIVED
&& e->ts.type != BT_CLASS && !sym->attr.elemental;
[-- Attachment #3: intent_out_10.f90 --]
[-- Type: text/x-fortran, Size: 257 bytes --]
! { dg-do compile }
! PR 87395 - this used to ICE
module mo
integer, save :: x
contains
subroutine foo
x = 42
call bar(x)
contains
subroutine bar(y)
integer, intent(out) :: y
end subroutine bar
end subroutine foo
end module mo
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2018-09-23 10:55 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-23 11:40 [patch, fortran, committed] Fix regression caused by clobber for INTENT(OUT) patch Thomas Koenig
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).