[patch, fortran] Fix PR 89496, error with alternate return

Thomas König tk@tkoenig.net
Mon Feb 25 22:28:00 GMT 2019


Hello world,

the attached patch fixes a regression introduced by my recent patch for
PR 87689, where the alternate return arguments were not handled
correctly.

Some experimentation resulted in a test case which actually segfaulted
on a normal compiler, instead of just being visible on an instrumened
one.  The test case also checks that the alternate return runs
correctly (and uses the "dg-do  run" hack :-)

I also checked this with -flto and by inspecting the output of
-fdump-fortran-original.

Thanks to Martin Liska for the bug report.

Regression-tested.  OK for trunk?

Regards

	Thomas

2019-02-25  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/89496
	* trans-types.c (get_formal_from_actual_arglist): If
	the actual arglist has no expression, the corresponding
	formal arglist is an alternate return.

2019-02-25  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/89496
	* gfortran.dg/altreturn_9_0.f90: New file.
	* gfortran.dg/altreturn_9_1.f90: New file.



More information about the Fortran mailing list