On Tue, Jun 06, 2006 at 08:16:54AM +0200, FX Coudert wrote:
> 
> >>Something is marking random_seed as noreturn.
> >
> >As far as I understand, symbols are marked as noreturn by use of  
> >TREE_THIS_VOLATILE, which is done on a few selected trees and is  
> >also done whenever a symbol has the noreturn attribute. This  
> >noreturn attribute can be set to 1 by make_noreturn, but nothing  
> >ever sets it to 0, which is probably why we're experiencing this  
> >problem.
> >
> >I have to go and not enough time to check it in detail, but perhaps  
> >we should change that here:
> 
> Index: intrinsic.c
> ===================================================================
> --- intrinsic.c (revision 114340)
> +++ intrinsic.c (working copy)
> @@ -254,6 +254,7 @@
>        next_sym->resolve = resolve;
>        next_sym->specific = 0;
>        next_sym->generic = 0;
> +      next_sym->noreturn = 0;
>        break;
>      default:

This patch is incorrect.  The problem is that the make_noreturn()
calls in add_subroutine are attached to the immediately preceding
symbol name that is stuck in the list of intrinsics.  In the case
of -std=f95 and random_seed(), the three intervening routine are
GFC_STD_GNU, so the make_noreturn() is applied to the wrong name.
Andrew and FX thanks for pointing me in the right direction.

If no one objects, I'll apply the enclosed patch later today.

2006-06-06  Steven G. Kargl  <[EMAIL PROTECTED]>

        * intrinsic.c (add_subroutine):  Make make_noreturn() conditional on
        the appropriate symbol name.

-- 
Steve


Index: intrinsic.c
===================================================================
--- intrinsic.c (revision 114435)
+++ intrinsic.c (working copy)
@@ -2232,7 +2232,8 @@ add_subroutines (void)
 
   add_sym_0s ("abort", 1, GFC_STD_GNU, NULL);
 
-  make_noreturn();
+  if ((gfc_option.allow_std & GFC_STD_GNU) || gfc_option.flag_all_intrinsics)
+    make_noreturn();
 
   add_sym_1s ("cpu_time", 0, 1, BT_UNKNOWN, 0, GFC_STD_F95,
              gfc_check_cpu_time, NULL, gfc_resolve_cpu_time,
@@ -2338,7 +2339,8 @@ add_subroutines (void)
              gfc_check_exit, NULL, gfc_resolve_exit,
              c, BT_INTEGER, di, OPTIONAL);
 
-  make_noreturn();
+  if ((gfc_option.allow_std & GFC_STD_GNU) || gfc_option.flag_all_intrinsics)
+    make_noreturn();
 
   add_sym_3s ("fgetc", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU,
              gfc_check_fgetputc_sub, NULL, gfc_resolve_fgetc_sub,

Reply via email to