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

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