This is the mail archive of the gcc-cvs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

r263096 - in /trunk/gcc: ada/ChangeLog ada/exp_...


Author: pmderodat
Date: Tue Jul 31 09:55:53 2018
New Revision: 263096

URL: https://gcc.gnu.org/viewcvs?rev=263096&root=gcc&view=rev
Log:
[Ada] Compiler failure on an extended_return_statement in a block

When compiling with an assertion-enabled compiler, Assert_Failure can be
raised when expanded an extended_return_statement whose enclosing scope
is not a function (such as when it's a block_statement). The simple fix
is to change the Assert to test Current_Subprogram rather than Current_Scope.
Three such Assert pragmas are corrected in this way.

2018-07-31  Gary Dismukes  <dismukes@adacore.com>

gcc/ada/

	* exp_ch6.adb (Expand_N_Extended_Return_Statement): Replace
	calls to Current_Scope in three assertions with calls to
	Current_Subprogram.

gcc/testsuite/

	* gnat.dg/block_ext_return_assert_failure.adb: New testcase.

Added:
    trunk/gcc/testsuite/gnat.dg/block_ext_return_assert_failure.adb
Modified:
    trunk/gcc/ada/ChangeLog
    trunk/gcc/ada/exp_ch6.adb
    trunk/gcc/testsuite/ChangeLog


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]