Bug 17758 - gfortran_abort and some others should be marked as noreturn
Summary: gfortran_abort and some others should be marked as noreturn
Status: RESOLVED FIXED
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:
Blocks:
 
Reported: 2004-09-30 20:54 UTC by Andrew Pinski
Modified: 2005-08-25 11:27 UTC (History)
2 users (show)

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


Attachments

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.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.5956&r2=1.5957
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/nonreturning_statements.f90.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/ChangeLog.diff?cvsroot=gcc&r1=1.531&r2=1.532
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/gfortran.h.diff?cvsroot=gcc&r1=1.82&r2=1.83
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/intrinsic.c.diff?cvsroot=gcc&r1=1.53&r2=1.54
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/trans-decl.c.diff?cvsroot=gcc&r1=1.66&r2=1.67

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