diff options
author | Thomas Koenig <Thomas.Koenig@online.de> | 2005-08-24 20:04:20 +0000 |
---|---|---|
committer | Thomas Koenig <tkoenig@gcc.gnu.org> | 2005-08-24 20:04:20 +0000 |
commit | fe58e07668767de1adc8cab509649a485607d127 (patch) | |
tree | ee3f72b0e9a25230193623fc852517df5c61a9e2 /gcc/fortran/trans-decl.c | |
parent | 1a1e6a9d4a1c8cfb8aef4d7f18fe4c68444f9317 (diff) | |
download | gcc-fe58e07668767de1adc8cab509649a485607d127.zip gcc-fe58e07668767de1adc8cab509649a485607d127.tar.gz gcc-fe58e07668767de1adc8cab509649a485607d127.tar.bz2 |
re PR fortran/17758 (gfortran_abort and some others should be marked as noreturn)
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.
From-SVN: r103449
Diffstat (limited to 'gcc/fortran/trans-decl.c')
-rw-r--r-- | gcc/fortran/trans-decl.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c index 3488cde..aaa4006 100644 --- a/gcc/fortran/trans-decl.c +++ b/gcc/fortran/trans-decl.c @@ -1001,6 +1001,10 @@ gfc_get_extern_function_decl (gfc_symbol * sym) TREE_SIDE_EFFECTS (fndecl) = 0; } + /* Mark non-returning functions. */ + if (sym->attr.noreturn) + TREE_THIS_VOLATILE(fndecl) = 1; + sym->backend_decl = fndecl; if (DECL_CONTEXT (fndecl) == NULL_TREE) |