Blame SOURCES/gcc8-fortran-pr87919-2.patch

93e26d
2018-12-03  Fritz Reese  <fritzoreese@gmail.com>
93e26d
	    Mark Eggleston  <mark.eggleston@codethink.co.uk>
93e26d
 
93e26d
 	PR fortran/87919
93e26d
 	* options.c (SET_FLAG, SET_BITFLAG, SET_BITFLAG2): New macros.
93e26d
 	(set_dec_flags): Set/unset DEC and std flags according to value.
93e26d
	(post_dec_flags, set_init_local_zero): New functions.
93e26d
	(gfc_init_options): Use set_init_local_zero and post_dec_flags.
93e26d
	(gfc_handle_options) <case OPT_fcheck_array_temporaries>: Use
93e26d
	SET_BITFLAG.
93e26d
	<case OPT_finit_local_zero>: Use set_init_local_zero.
93e26d
	<case OPT_fdec>: Pass value to set_dec_flags.
93e26d
	<case OPT_fdec_structure>: Remove.
93e26d
 
93e26d
diff --git a/gcc/fortran/options.c b/gcc/fortran/options.c
93e26d
index b35bed32974..48e35e3524d 100644
93e26d
--- a/gcc/fortran/options.c
93e26d
+++ b/gcc/fortran/options.c
93e26d
@@ -147,11 +147,7 @@ gfc_init_options (unsigned int decoded_options_count,
93e26d
 
93e26d
   gfc_option.flag_preprocessed = 0;
93e26d
   gfc_option.flag_d_lines = -1;
93e26d
-  gfc_option.flag_init_integer = GFC_INIT_INTEGER_OFF;
93e26d
-  gfc_option.flag_init_integer_value = 0;
93e26d
-  gfc_option.flag_init_logical = GFC_INIT_LOGICAL_OFF;
93e26d
-  gfc_option.flag_init_character = GFC_INIT_CHARACTER_OFF;
93e26d
-  gfc_option.flag_init_character_value = (char)0;
93e26d
+  set_init_local_zero (0);
93e26d
   
93e26d
   gfc_option.fpe = 0;
93e26d
   /* All except GFC_FPE_INEXACT.  */
93e26d
@@ -261,6 +257,9 @@ gfc_post_options (const char **pfilename)
93e26d
   char *source_path;
93e26d
   int i;
93e26d
 
93e26d
+  /* Finalize DEC flags.  */
93e26d
+  post_dec_flags (flag_dec);
93e26d
+
93e26d
   /* Excess precision other than "fast" requires front-end
93e26d
      support.  */
93e26d
   if (flag_excess_precision_cmdline == EXCESS_PRECISION_STANDARD)
93e26d
@@ -644,7 +643,7 @@ gfc_handle_option (size_t scode, const char *arg, HOST_WIDE_INT value,
93e26d
       break;
93e26d
 
93e26d
     case OPT_fcheck_array_temporaries:
93e26d
-      gfc_option.rtcheck |= GFC_RTCHECK_ARRAY_TEMPS;
93e26d
+      SET_BITFLAG (gfc_option.rtcheck, value, GFC_RTCHECK_ARRAY_TEMPS);
93e26d
       break;
93e26d
       
93e26d
     case OPT_fd_lines_as_code:
93e26d
@@ -694,12 +693,7 @@ gfc_handle_option (size_t scode, const char *arg, HOST_WIDE_INT value,
93e26d
       break;
93e26d
 
93e26d
     case OPT_finit_local_zero:
93e26d
-      gfc_option.flag_init_integer = GFC_INIT_INTEGER_ON;
93e26d
-      gfc_option.flag_init_integer_value = 0;
93e26d
-      flag_init_real = GFC_INIT_REAL_ZERO;
93e26d
-      gfc_option.flag_init_logical = GFC_INIT_LOGICAL_FALSE;
93e26d
-      gfc_option.flag_init_character = GFC_INIT_CHARACTER_ON;
93e26d
-      gfc_option.flag_init_character_value = (char)0;
93e26d
+      set_init_local_zero (value);
93e26d
       break;
93e26d
 
93e26d
     case OPT_finit_logical_:
93e26d
@@ -798,12 +792,8 @@ gfc_handle_option (size_t scode, const char *arg, HOST_WIDE_INT value,
93e26d
       break;
93e26d
 
93e26d
     case OPT_fdec:
93e26d
-      /* Enable all DEC extensions.  */
93e26d
-      set_dec_flags (1);
93e26d
-      break;
93e26d
-
93e26d
-    case OPT_fdec_structure:
93e26d
-      flag_dec_structure = 1;
93e26d
+      /* Set (or unset) the DEC extension flags.  */
93e26d
+      set_dec_flags (value);
93e26d
       break;
93e26d
     }
93e26d
 
93e26d
@@ -895,3 +885,7 @@ gfc_get_option_string (void)
93e26d
   result[--pos] = '\0';
93e26d
   return result;
93e26d
 }
93e26d
+
93e26d
+#undef SET_BITFLAG
93e26d
+#undef SET_BITFLAG2
93e26d
+#undef SET_FLAG