Bug 17758 - gfortran_abort and some others should be marked as noreturn
Summary: gfortran_abort and some others should be marked as noreturn
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.0.0
: P2 enhancement
Target Milestone: 4.1.0
Assignee: Not yet assigned to anyone
URL: http://gcc.gnu.org/ml/gcc-patches/200...
Keywords: missed-optimization, patch
: 21027 (view as bug list)
Depends on:
Reported: 2004-09-30 20:54 UTC by Andrew Pinski
Modified: 2005-08-25 11:27 UTC (History)
2 users (show)

See Also:
Known to work:
Known to fail:
Last reconfirmed: 2005-06-13 04:14:32


Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Pinski 2004-09-30 20:54:45 UTC
While looking into PR 17757, I noticed that gfortran_abort was not being marked as noreturn when it 
should be as it does not return.
Comment 1 Tobias Schlüter 2004-09-30 21:10:16 UTC
same goes for stop_numeric and stop_string.
Comment 2 Andrew Pinski 2005-04-08 17:25:26 UTC
I am going to fix this.
Is there any other known functions that don't return in fortran?
Comment 3 Andrew Pinski 2005-04-11 23:52:05 UTC
_gfortran_runtime_error is another one which shows up for -fbounds-checking.
Comment 4 Andrew Pinski 2005-04-14 19:22:13 UTC
*** Bug 21027 has been marked as a duplicate of this bug. ***
Comment 5 Thomas Koenig 2005-08-09 20:00:47 UTC
stop_numeric, stop_string and runtime_error have been fixed.

abort requires some more work.
Comment 6 Andrew Pinski 2005-08-10 00:39:12 UTC
Note working on this any more as other people are fixing this.
Comment 7 CVS Commits 2005-08-24 20:04:27 UTC
Subject: Bug 17758

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	tkoenig@gcc.gnu.org	2005-08-24 20:04:21

Modified files:
	gcc/testsuite  : ChangeLog 
	gcc/fortran    : ChangeLog gfortran.h intrinsic.c trans-decl.c 
Added files:
	gcc/testsuite/gfortran.dg: nonreturning_statements.f90 

Log message:
	2005-08-24  Thomas Koenig  <Thomas.Koenig@online.de>
	PR fortran/17758
	* gfortran.h (symbol_attribute):  Add noreturn to the structure.
	(gfc_intrinsic_sym):  Add noreturn to the structure.
	* intrinsic.c (make_noreturn):  New function.
	(add_subroutines):  Mark subroutines abort and exit as noreturn.
	(gfc_intrinsic_sub_interface):  Copy noreturn attribute from
	isym to the resolved symbol.
	* trans-decl.c (gfc_get_extern_function_decl): Set function
	as VOLATILE (== noreturn) if the noreturn attribute is set.
	2005-08-24  Thomas Koenig  <Thomas.Koenig@online.de>
	PR fortran/17758
	gfortran.dg/nonreturning_statements.f90: New test.


Comment 8 Andrew Pinski 2005-08-25 11:27:20 UTC