2014-12-16 Tobias Burnus <burnus@net-b.de>
+ PR fortran/54687
+ * gfortran.h (gfc_option_t): Remove flags which now
+ have a Var().
+ * lang.opt (flag-aggressive_function_elimination,
+ flag-align_commons, flag-all_intrinsics,
+ flag-allow_leading_underscore, flag-automatic, flag-backslash,
+ flag-backtrace, flag-blas_matmul_limit, flag-cray_pointer,
+ flag-dollar_ok, flag-dump_fortran_original,
+ flag-dump_fortran_optimized, flag-external_blas, flag-f2c,
+ flag-implicit_none, flag-max_array_constructor,
+ flag-module_private, flag-pack_derived, flag-range_check,
+ flag-recursive, flag-repack_arrays, flag-sign_zero,
+ flag-underscoring): Add Var() and, where applicable, Enum().
+ * options.c (gfc_init_options, gfc_post_options,
+ gfc_handle_option): Update for *.opt changes.
+ * arith.c: Update for flag-variable name changes.
+ * array.c: Ditto.
+ * cpp.c: Ditto.
+ * decl.c: Ditto.
+ * expr.c: Ditto.
+ * f95-lang.c: Ditto.
+ * frontend-passes.c: Ditto.
+ * intrinsic.c: Ditto.
+ * io.c: Ditto.
+ * match.c: Ditto.
+ * module.c: Ditto.
+ * parse.c: Ditto.
+ * primary.c: Ditto.
+ * resolve.c: Ditto.
+ * scanner.c: Ditto.
+ * simplify.c: Ditto.
+ * symbol.c: Ditto.
+ * trans-array.c: Ditto.
+ * trans-common.c: Ditto.
+ * trans-decl.c: Ditto.
+ * trans-expr.c: Ditto.
+ * trans-intrinsic.c: Ditto.
+ * trans-openmp.c: Ditto.
+ * trans-types.c: Ditto.
+
+2014-12-16 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/54687
* lang.opt (fsecond-underscore, frecord-marker=8, frecord-marker=4,
frealloc-lhs, freal-8-real-16, freal-8-real-10, freal-8-real-4,
freal-4-real-16, freal-4-real-10, freal-4-real-8, fprotect-parens,
}
- if (gfc_option.flag_range_check == 0)
+ if (flag_range_check == 0)
return result;
if (mpz_cmp (p, gfc_integer_kinds[i].min_int) < 0
if (mpfr_inf_p (p))
{
- if (gfc_option.flag_range_check != 0)
+ if (flag_range_check != 0)
retval = ARITH_OVERFLOW;
}
else if (mpfr_nan_p (p))
{
- if (gfc_option.flag_range_check != 0)
+ if (flag_range_check != 0)
retval = ARITH_NAN;
}
else if (mpfr_sgn (q) == 0)
}
else if (mpfr_cmp (q, gfc_real_kinds[i].huge) > 0)
{
- if (gfc_option.flag_range_check == 0)
+ if (flag_range_check == 0)
mpfr_set_inf (p, mpfr_sgn (p));
else
retval = ARITH_OVERFLOW;
}
else if (mpfr_cmp (q, gfc_real_kinds[i].subnormal) < 0)
{
- if (gfc_option.flag_range_check == 0)
+ if (flag_range_check == 0)
{
if (mpfr_sgn (p) < 0)
{
break;
case BT_REAL:
- if (mpfr_sgn (op2->value.real) == 0 && gfc_option.flag_range_check == 1)
+ if (mpfr_sgn (op2->value.real) == 0 && flag_range_check == 1)
{
rc = ARITH_DIV0;
break;
case BT_COMPLEX:
if (mpc_cmp_si_si (op2->value.complex, 0, 0) == 0
- && gfc_option.flag_range_check == 1)
+ && flag_range_check == 1)
{
rc = ARITH_DIV0;
break;
int i;
i = gfc_validate_kind (BT_INTEGER, result->ts.kind, false);
- if (gfc_option.flag_range_check)
+ if (flag_range_check)
rc = ARITH_OVERFLOW;
/* Still, we want to give the same value as the
/* If we do not trap numeric overflow, we need to convert the number to
signed, throwing away high-order bits if necessary. */
- if (gfc_option.flag_range_check == 0)
+ if (flag_range_check == 0)
{
int k;
#include "config.h"
#include "system.h"
#include "coretypes.h"
+#include "flags.h"
#include "gfortran.h"
#include "match.h"
#include "constructor.h"
/* If we can successfully get an array element at the max array size then
the array is too big to expand, so we just return. */
- f = gfc_get_array_element (e, gfc_option.flag_max_array_constructor);
+ f = gfc_get_array_element (e, flag_max_array_constructor);
if (f != NULL)
{
gfc_free_expr (f);
gfc_error ("The number of elements in the array constructor "
"at %L requires an increase of the allowed %d "
"upper limit. See %<-fmax-array-constructor%> "
- "option", &e->where,
- gfc_option.flag_max_array_constructor);
+ "option", &e->where, flag_max_array_constructor);
return false;
}
return true;
cpp_define (pfile, "__GFORTRAN__=1");
cpp_define (pfile, "_LANGUAGE_FORTRAN=1");
- if (gfc_option.gfc_flag_openmp)
+ if (flag_openmp)
cpp_define (pfile, "_OPENMP=201307");
/* The defines below are necessary for the TARGET_* macros.
cpp_option->cpp_pedantic = pedantic;
- cpp_option->dollars_in_ident = gfc_option.flag_dollar_ok;
+ cpp_option->dollars_in_ident = flag_dollar_ok;
cpp_option->discard_comments = gfc_cpp_option.discard_comments;
cpp_option->discard_comments_in_macro_exp = gfc_cpp_option.discard_comments_in_macro_exp;
cpp_option->print_include_names = gfc_cpp_option.print_include_names;
goto cleanup;
}
- if (gfc_option.flag_cray_pointer)
+ if (flag_cray_pointer)
cp_as = gfc_copy_array_spec (as);
/* At this point, we know for sure if the symbol is PARAMETER and can thus
/* If this symbol has already shown up in a Cray Pointer declaration,
and this is not a component declaration,
then we want to set the type & bail out. */
- if (gfc_option.flag_cray_pointer && gfc_current_state () != COMP_DERIVED)
+ if (flag_cray_pointer && gfc_current_state () != COMP_DERIVED)
{
gfc_find_symbol (name, gfc_current_ns, 1, &sym);
if (sym != NULL && sym->attr.cray_pointee)
gfc_gobble_whitespace ();
if (gfc_peek_ascii_char () == '(')
{
- if (!gfc_option.flag_cray_pointer)
+ if (!flag_cray_pointer)
{
gfc_error ("Cray pointer declaration at %C requires -fcray-pointer "
"flag");
}
limit = mpz_get_ui (ptr);
- if (limit >= gfc_option.flag_max_array_constructor)
+ if (limit >= flag_max_array_constructor)
{
gfc_error ("The number of elements in the array constructor "
"at %L requires an increase of the allowed %d "
"upper limit. See -fmax-array-constructor "
- "option", &expr->where,
- gfc_option.flag_max_array_constructor);
+ "option", &expr->where, flag_max_array_constructor);
return false;
}
#include "../sync-builtins.def"
#undef DEF_SYNC_BUILTIN
- if (gfc_option.gfc_flag_openmp
- || gfc_option.gfc_flag_openmp_simd
- || flag_tree_parallelize_loops)
+ if (flag_openmp || flag_openmp_simd || flag_tree_parallelize_loops)
{
#undef DEF_GOMP_BUILTIN
#define DEF_GOMP_BUILTIN(code, name, type, attr) \
{
optimize_namespace (ns);
optimize_reduction (ns);
- if (gfc_option.dump_fortran_optimized)
+ if (flag_dump_fortran_optimized)
gfc_dump_parse_tree (ns, stdout);
expr_array.release ();
/* Only eliminate potentially impure functions if the
user specifically requested it. */
- if (!gfc_option.flag_aggressive_function_elimination
+ if (!flag_aggressive_function_elimination
&& !(*e)->value.function.esym->attr.pure
&& !(*e)->value.function.esym->attr.implicit_pure)
return 0;
int max_continue_fixed;
int max_continue_free;
int max_identifier_length;
- int dump_fortran_original;
- int dump_fortran_optimized;
int max_errors;
- int flag_all_intrinsics;
- int flag_dollar_ok;
- int flag_underscoring;
- int flag_implicit_none;
- int flag_max_array_constructor;
- int flag_range_check;
- int flag_pack_derived;
- int flag_repack_arrays;
int flag_preprocessed;
- int flag_f2c;
- int flag_automatic;
- int flag_backslash;
- int flag_backtrace;
- int flag_allow_leading_underscore;
- int flag_external_blas;
- int blas_matmul_limit;
- int flag_cray_pointer;
int flag_d_lines;
- int gfc_flag_openmp;
- int gfc_flag_openmp_simd;
- int flag_sign_zero;
- int flag_module_private;
- int flag_recursive;
int flag_init_integer;
int flag_init_integer_value;
int flag_init_real;
int flag_init_logical;
int flag_init_character;
char flag_init_character_value;
- int flag_align_commons;
- int flag_aggressive_function_elimination;
int fpe;
int fpe_summary;
const char* symstd_msg;
/* For -fall-intrinsics, just succeed. */
- if (gfc_option.flag_all_intrinsics)
+ if (flag_all_intrinsics)
return true;
/* Find the symbol's standard message for later usage. */
}
else if (wflag)
{
- if (gfc_option.flag_range_check
- && expr->expr_type == EXPR_CONSTANT
+ if (flag_range_check && expr->expr_type == EXPR_CONSTANT
&& from_ts.type == ts->type)
{
/* Do nothing. Constants of the same type are range-checked
c = '\0';
}
- if (gfc_option.flag_backslash && c == '\\')
+ if (flag_backslash && c == '\\')
{
locus old_locus = gfc_current_locus;
; Documented in common.opt
faggressive-function-elimination
-Fortran
+Fortran Var(flag_aggressive_function_elimination)
Eliminate multiple function invokations also for impure functions
falign-commons
-Fortran
+Fortran Var(flag_align_commons) Init(1)
Enable alignment of COMMON blocks
fall-intrinsics
-Fortran RejectNegative
+Fortran RejectNegative Var(flag_all_intrinsics)
All intrinsics procedures are available regardless of selected standard
fallow-leading-underscore
-Fortran Undocumented
+Fortran Undocumented Var(flag_allow_leading_underscore)
; For internal use only: allow the first character of symbol names to be an underscore
fautomatic
-Fortran
+Fortran Var(flag_automatic) Init(1)
Do not treat local variables and COMMON blocks as if they were named in SAVE statements
fbackslash
-Fortran
+Fortran Var(flag_backslash)
Specify that backslash in string introduces an escape character
fbacktrace
-Fortran
+Fortran Var(flag_backtrace) Init(1)
Produce a backtrace when a runtime error is encountered
fblas-matmul-limit=
-Fortran RejectNegative Joined UInteger
+Fortran RejectNegative Joined UInteger Var(flag_blas_matmul_limit) Init(30)
-fblas-matmul-limit=<n> Size of the smallest matrix for which matmul will use BLAS
fcheck-array-temporaries
Swap endianness for unformatted files
fcray-pointer
-Fortran
+Fortran Var(flag_cray_pointer)
Use the Cray Pointer extension
fd-lines-as-code
Set the default real kind to an 8 byte wide type
fdollar-ok
-Fortran
+Fortran Var(flag_dollar_ok)
Allow dollar signs in entity names
fdump-core
Does nothing. Preserved for backward compatibility.
fdump-fortran-original
-Fortran
+Fortran Var(flag_dump_fortran_original)
Display the code tree after parsing
fdump-fortran-optimized
-Fortran
+Fortran Var(flag_dump_fortran_optimized)
Display the code tree after front end optimization
fdump-parse-tree
-Fortran
+Fortran Alias(fdump-fortran-original)
Display the code tree after parsing; deprecated option
fexternal-blas
-Fortran
+Fortran Var(flag_external_blas)
Specify that an external BLAS library should be used for matmul calls on large-size arrays
ff2c
-Fortran
+Fortran Var(flag_f2c)
Use f2c calling convention
ffixed-form
Enable front end optimization
fimplicit-none
-Fortran
+Fortran Var(flag_implicit_none)
Specify that no implicit typing is allowed, unless overridden by explicit IMPLICIT statements
finit-character=
-finit-real=<zero|nan|inf|-inf> Initialize local real variables
fmax-array-constructor=
-Fortran RejectNegative Joined UInteger
+Fortran RejectNegative Joined UInteger Var(flag_max_array_constructor) Init(65535)
-fmax-array-constructor=<n> Maximum number of objects in an array constructor
fmax-identifier-length=
Put all local arrays on stack.
fmodule-private
-Fortran
+Fortran Var(flag_module_private)
Set default accessibility of module entities to PRIVATE.
fopenmp
; Documented in C
fpack-derived
-Fortran
+Fortran Var(flag_pack_derived)
Try to lay out derived types as compactly as possible
fpreprocessed
Protect parentheses in expressions
frange-check
-Fortran
+Fortran Var(flag_range_check) Init(1)
Enable range checking during compilation
freal-4-real-8
Use an 8-byte record marker for unformatted files
frecursive
-Fortran
+Fortran Var(flag_recursive)
Allocate local variables on the stack to allow indirect recursion
frepack-arrays
-Fortran
+Fortran Var(flag_repack_arrays)
Copy array sections into a contiguous block on procedure entry
fcoarray=
; Documented in C
fsign-zero
-Fortran
+Fortran Var(flag_sign_zero) Init(1)
Apply negative sign to zero values
funderscoring
-Fortran
+Fortran Var(flag_underscoring) Init(1)
Append underscores to externally visible names
fwhole-file
gfc_gobble_whitespace ();
c = gfc_next_ascii_char ();
- if (!(ISALPHA (c) || (c == '_' && gfc_option.flag_allow_leading_underscore)))
+ if (!(ISALPHA (c) || (c == '_' && flag_allow_leading_underscore)))
{
if (!gfc_error_flag_test () && c != '(')
gfc_error ("Invalid character in name at %C");
old_loc = gfc_current_locus;
c = gfc_next_ascii_char ();
}
- while (ISALNUM (c) || c == '_' || (gfc_option.flag_dollar_ok && c == '$'));
+ while (ISALNUM (c) || c == '_' || (flag_dollar_ok && c == '$'));
- if (c == '$' && !gfc_option.flag_dollar_ok)
+ if (c == '$' && !flag_dollar_ok)
{
gfc_fatal_error ("Invalid character %<$%> at %L. Use %<-fdollar-ok%> to "
"allow it as an extension", &old_loc);
if (specific_access == ACCESS_PRIVATE)
return FALSE;
- if (gfc_option.flag_module_private)
+ if (flag_module_private)
return default_access == ACCESS_PUBLIC;
else
return default_access != ACCESS_PRIVATE;
gfc_option.max_continue_fixed = 255;
gfc_option.max_continue_free = 255;
gfc_option.max_identifier_length = GFC_MAX_SYMBOL_LEN;
- gfc_option.flag_max_array_constructor = 65535;
gfc_option.convert = GFC_CONVERT_NATIVE;
- gfc_option.dump_fortran_original = 0;
- gfc_option.dump_fortran_optimized = 0;
-
gfc_option.max_errors = 25;
- gfc_option.flag_all_intrinsics = 0;
- gfc_option.flag_dollar_ok = 0;
- gfc_option.flag_underscoring = 1;
- gfc_option.flag_f2c = 0;
- gfc_option.flag_implicit_none = 0;
-
- gfc_option.flag_range_check = 1;
- gfc_option.flag_pack_derived = 0;
- gfc_option.flag_repack_arrays = 0;
gfc_option.flag_preprocessed = 0;
- gfc_option.flag_automatic = 1;
- gfc_option.flag_backslash = 0;
- gfc_option.flag_module_private = 0;
- gfc_option.flag_backtrace = 1;
- gfc_option.flag_allow_leading_underscore = 0;
- gfc_option.flag_external_blas = 0;
- gfc_option.blas_matmul_limit = 30;
- gfc_option.flag_cray_pointer = 0;
gfc_option.flag_d_lines = -1;
- gfc_option.gfc_flag_openmp = 0;
- gfc_option.flag_sign_zero = 1;
- gfc_option.flag_recursive = 0;
gfc_option.flag_init_integer = GFC_INIT_INTEGER_OFF;
gfc_option.flag_init_integer_value = 0;
gfc_option.flag_init_real = GFC_INIT_REAL_OFF;
gfc_option.flag_init_logical = GFC_INIT_LOGICAL_OFF;
gfc_option.flag_init_character = GFC_INIT_CHARACTER_OFF;
gfc_option.flag_init_character_value = (char)0;
- gfc_option.flag_align_commons = 1;
- gfc_option.flag_aggressive_function_elimination = 0;
gfc_option.fpe = 0;
/* All except GFC_FPE_INEXACT. */
gfc_option.rtcheck |= GFC_RTCHECK_BOUNDS;
if (flag_compare_debug)
- gfc_option.dump_fortran_original = 0;
+ flag_dump_fortran_original = 0;
/* Make -fmax-errors visible to gfortran's diagnostic machinery. */
if (global_options_set.x_flag_max_errors)
use it if we're trying to be compatible with f2c, and not
otherwise. */
if (flag_second_underscore == -1)
- flag_second_underscore = gfc_option.flag_f2c;
+ flag_second_underscore = flag_f2c;
- if (!gfc_option.flag_automatic && flag_max_stack_var_size != -2
+ if (!flag_automatic && flag_max_stack_var_size != -2
&& flag_max_stack_var_size != 0)
gfc_warning_now ("Flag %<-fno-automatic%> overwrites %<-fmax-stack-var-size=%d%>",
flag_max_stack_var_size);
- else if (!gfc_option.flag_automatic && gfc_option.flag_recursive)
+ else if (!flag_automatic && flag_recursive)
gfc_warning_now ("Flag %<-fno-automatic%> overwrites %<-frecursive%>");
- else if (!gfc_option.flag_automatic && gfc_option.gfc_flag_openmp)
+ else if (!flag_automatic && flag_openmp)
gfc_warning_now ("Flag %<-fno-automatic%> overwrites %<-frecursive%> implied by "
"%<-fopenmp%>");
- else if (flag_max_stack_var_size != -2 && gfc_option.flag_recursive)
+ else if (flag_max_stack_var_size != -2 && flag_recursive)
gfc_warning_now ("Flag %<-frecursive%> overwrites %<-fmax-stack-var-size=%d%>",
flag_max_stack_var_size);
- else if (flag_max_stack_var_size != -2 && gfc_option.gfc_flag_openmp)
+ else if (flag_max_stack_var_size != -2 && flag_openmp)
gfc_warning_now ("Flag %<-fmax-stack-var-size=%d%> overwrites %<-frecursive%> "
"implied by %<-fopenmp%>", flag_max_stack_var_size);
/* Implement -frecursive as -fmax-stack-var-size=-1. */
- if (gfc_option.flag_recursive)
+ if (flag_recursive)
flag_max_stack_var_size = -1;
/* Implied -frecursive; implemented as -fmax-stack-var-size=-1. */
- if (flag_max_stack_var_size == -2 && gfc_option.gfc_flag_openmp
- && gfc_option.flag_automatic)
+ if (flag_max_stack_var_size == -2 && flag_openmp && flag_automatic)
{
- gfc_option.flag_recursive = 1;
+ flag_recursive = 1;
flag_max_stack_var_size = -1;
}
flag_max_stack_var_size = 32768;
/* Implement -fno-automatic as -fmax-stack-var-size=0. */
- if (!gfc_option.flag_automatic)
+ if (!flag_automatic)
flag_max_stack_var_size = 0;
/* Optimization implies front end optimization, unless the user
if (flag_frontend_optimize == -1)
flag_frontend_optimize = optimize;
+ if (flag_max_array_constructor < 65535)
+ flag_max_array_constructor = 65535;
+
if (flag_fixed_line_length != 0 && flag_fixed_line_length < 7)
gfc_fatal_error ("Fixed line length must be at least seven");
result = false;
break;
- case OPT_fall_intrinsics:
- gfc_option.flag_all_intrinsics = 1;
- break;
-
- case OPT_fautomatic:
- gfc_option.flag_automatic = value;
- break;
-
- case OPT_fallow_leading_underscore:
- gfc_option.flag_allow_leading_underscore = value;
- break;
-
- case OPT_fbackslash:
- gfc_option.flag_backslash = value;
- break;
-
- case OPT_fbacktrace:
- gfc_option.flag_backtrace = value;
- break;
-
case OPT_fcheck_array_temporaries:
gfc_option.rtcheck |= GFC_RTCHECK_ARRAY_TEMPS;
break;
- case OPT_fcray_pointer:
- gfc_option.flag_cray_pointer = value;
- break;
-
- case OPT_ff2c:
- gfc_option.flag_f2c = value;
- break;
-
- case OPT_fdollar_ok:
- gfc_option.flag_dollar_ok = value;
- break;
-
- case OPT_fexternal_blas:
- gfc_option.flag_external_blas = value;
- break;
-
- case OPT_fblas_matmul_limit_:
- gfc_option.blas_matmul_limit = value;
- break;
-
case OPT_fd_lines_as_code:
gfc_option.flag_d_lines = 1;
break;
gfc_option.flag_d_lines = 0;
break;
- case OPT_fdump_fortran_original:
- case OPT_fdump_parse_tree:
- gfc_option.dump_fortran_original = value;
- break;
-
- case OPT_fdump_fortran_optimized:
- gfc_option.dump_fortran_optimized = value;
- break;
-
case OPT_ffixed_form:
gfc_option.source_form = FORM_FIXED;
break;
gfc_option.source_form = FORM_FREE;
break;
- case OPT_fopenmp:
- gfc_option.gfc_flag_openmp = value;
- break;
-
- case OPT_fopenmp_simd:
- gfc_option.gfc_flag_openmp_simd = value;
- break;
-
- case OPT_funderscoring:
- gfc_option.flag_underscoring = value;
- break;
-
case OPT_static_libgfortran:
#ifndef HAVE_LD_STATIC_DYNAMIC
gfc_fatal_error ("%<-static-libgfortran%> is not supported in this "
#endif
break;
- case OPT_fimplicit_none:
- gfc_option.flag_implicit_none = value;
- break;
-
case OPT_fintrinsic_modules_path:
case OPT_fintrinsic_modules_path_:
gfc_add_intrinsic_modules_path (arg);
break;
- case OPT_fmax_array_constructor_:
- gfc_option.flag_max_array_constructor = value > 65535 ? value : 65535;
- break;
-
- case OPT_fmodule_private:
- gfc_option.flag_module_private = value;
- break;
-
- case OPT_frange_check:
- gfc_option.flag_range_check = value;
- break;
-
- case OPT_fpack_derived:
- gfc_option.flag_pack_derived = value;
- break;
-
- case OPT_frepack_arrays:
- gfc_option.flag_repack_arrays = value;
- break;
-
case OPT_fpreprocessed:
gfc_option.flag_preprocessed = value;
break;
gfc_handle_module_path_options (arg);
break;
- case OPT_fsign_zero:
- gfc_option.flag_sign_zero = value;
- break;
-
case OPT_ffpe_trap_:
gfc_handle_fpe_option (arg, true);
break;
gfc_option.convert = GFC_CONVERT_SWAP;
break;
- case OPT_frecursive:
- gfc_option.flag_recursive = value;
- break;
-
- case OPT_falign_commons:
- gfc_option.flag_align_commons = value;
- break;
-
- case OPT_faggressive_function_elimination:
- gfc_option.flag_aggressive_function_elimination = value;
- break;
-
case OPT_fcheck_:
gfc_handle_runtime_check_option (arg);
break;
#include "system.h"
#include <setjmp.h>
#include "coretypes.h"
+#include "flags.h"
#include "gfortran.h"
#include "match.h"
#include "parse.h"
/* Like match, but don't match anything if not -fopenmp. */
#define matcho(keyword, subr, st) \
do { \
- if (!gfc_option.gfc_flag_openmp) \
+ if (!flag_openmp) \
; \
else if (match_word (keyword, subr, &old_locus) \
== MATCH_YES) \
not -fopenmp and simd_matched is false, i.e. if a directive other
than one marked with match has been seen. */
- if (gfc_option.gfc_flag_openmp || simd_matched)
+ if (flag_openmp || simd_matched)
{
if (!gfc_error_check ())
gfc_error_now ("Unclassifiable OpenMP directive at %C");
return decode_gcc_attribute ();
}
- else if (c == '$'
- && (gfc_option.gfc_flag_openmp
- || gfc_option.gfc_flag_openmp_simd))
+ else if (c == '$' && (flag_openmp || flag_openmp_simd))
{
int i;
return decode_gcc_attribute ();
}
else if (c == '$'
- && (gfc_option.gfc_flag_openmp
- || gfc_option.gfc_flag_openmp_simd))
+ && (flag_openmp || flag_openmp_simd))
{
for (i = 0; i < 4; i++, c = gfc_next_char_literal (NONSTRING))
gcc_assert ((char) gfc_wide_tolower (c) == "$omp"[i]);
gfc_resolve (gfc_current_ns);
/* Dump the parse tree if requested. */
- if (gfc_option.dump_fortran_original)
+ if (flag_dump_fortran_original)
gfc_dump_parse_tree (gfc_current_ns, stdout);
gfc_get_errors (NULL, &errors);
/* Do the parse tree dump. */
gfc_current_ns
- = gfc_option.dump_fortran_original ? gfc_global_ns_list : NULL;
+ = flag_dump_fortran_original ? gfc_global_ns_list : NULL;
for (; gfc_current_ns; gfc_current_ns = gfc_current_ns->sibling)
if (!gfc_current_ns->proc_name
return 0;
}
- if (gfc_option.flag_backslash && c == '\\')
+ if (flag_backslash && c == '\\')
{
old_locus = gfc_current_locus;
if (!ISALNUM (c)
&& c != '_'
- && (c != '$' || !gfc_option.flag_dollar_ok))
+ && (c != '$' || !flag_dollar_ok))
break;
*name++ = c;
proc_sym = sym;
/* If sym is RECURSIVE, all is well of course. */
- if (proc_sym->attr.recursive || gfc_option.flag_recursive)
+ if (proc_sym->attr.recursive || flag_recursive)
return false;
/* Find the context procedure's "real" symbol if it has entries.
2) handle OpenMP conditional compilation, where
!$ should be treated as 2 spaces (for initial lines
only if followed by space). */
- if ((gfc_option.gfc_flag_openmp
- || gfc_option.gfc_flag_openmp_simd) && at_bol)
+ if ((flag_openmp || flag_openmp_simd) && at_bol)
{
locus old_loc = gfc_current_locus;
if (next_char () == '$')
&& continue_line < gfc_linebuf_linenum (gfc_current_locus.lb))
continue_line = gfc_linebuf_linenum (gfc_current_locus.lb);
- if (gfc_option.gfc_flag_openmp || gfc_option.gfc_flag_openmp_simd)
+ if (flag_openmp || flag_openmp_simd)
{
if (next_char () == '$')
{
c = line;
- if (gfc_option.gfc_flag_openmp || gfc_option.gfc_flag_openmp_simd)
+ if (flag_openmp || flag_openmp_simd)
{
if (gfc_current_form == FORM_FREE)
{
{
/* Confirm that no bits above the signed range are unset if we
are doing range checking. */
- if (gfc_option.flag_range_check != 0)
+ if (flag_range_check != 0)
gcc_assert (mpz_scan0 (x, bitsize-1) == ULONG_MAX);
mpz_init_set_ui (mask, 1);
/* Confirm that no bits above the unsigned range are set if we are
doing range checking. */
- if (gfc_option.flag_range_check != 0)
+ if (flag_range_check != 0)
gcc_assert (mpz_scan1 (x, bitsize) == ULONG_MAX);
if (mpz_tstbit (x, bitsize - 1) == 1)
if (mpfr_cmp_ui (x->value.real, 0.0) == 0)
{
- if (!jn && gfc_option.flag_range_check)
+ if (!jn && flag_range_check)
{
gfc_error ("Result of BESSEL_YN is -INF at %L", &result->where);
gfc_free_expr (result);
/* Special case: For YN, if the previous N gave -INF, set
also N+1 to -INF. */
- if (!jn && !gfc_option.flag_range_check && mpfr_inf_p (last2))
+ if (!jn && !flag_range_check && mpfr_inf_p (last2))
{
mpfr_set_inf (e->value.real, -1);
gfc_constructor_append_expr (&result->value.constructor, e,
/* Only NaN can occur. Do not use range check as it gives an
error for denormal numbers. */
- if (mpfr_nan_p (result->value.real) && gfc_option.flag_range_check)
+ if (mpfr_nan_p (result->value.real) && flag_range_check)
{
gfc_error ("Result of NEAREST is NaN at %L", &result->where);
gfc_free_expr (result);
break;
case BT_REAL:
- if (gfc_option.flag_sign_zero)
+ if (flag_sign_zero)
mpfr_copysign (result->value.real, x->value.real, y->value.real,
GFC_RND_MODE);
else
else
mpz_init_set_ui (size, 1);
- if (mpz_get_si (size)*ncopies > gfc_option.flag_max_array_constructor)
+ if (mpz_get_si (size)*ncopies > flag_max_array_constructor)
return NULL;
if (source->expr_type == EXPR_CONSTANT)
letter = name[0];
- if (gfc_option.flag_allow_leading_underscore && letter == '_')
+ if (flag_allow_leading_underscore && letter == '_')
gfc_fatal_error ("Option %<-fallow-leading-underscore%> is for use only by "
"gfortran developers, and should not be used for "
"implicitly typed variables");
continue;
}
- if (gfc_option.flag_implicit_none != 0)
+ if (flag_implicit_none != 0)
{
gfc_clear_ts (ts);
continue;
"constructor at %L requires an increase of "
"the allowed %d upper limit. See "
"%<-fmax-array-constructor%> option",
- &expr->where,
- gfc_option.flag_max_array_constructor);
+ &expr->where, flag_max_array_constructor);
return NULL_TREE;
}
if (mpz_cmp_si (c->offset, 0) != 0)
if (strcmp (name, BLANK_COMMON_NAME) == 0)
return get_identifier (name);
- if (gfc_option.flag_underscoring)
+ if (flag_underscoring)
{
has_underscore = strchr (name, '_') != 0;
if (flag_second_underscore && has_underscore)
"extension to COMMON %qs at %L", sym->name,
common->name, &common->where);
- if (gfc_option.flag_align_commons)
+ if (flag_align_commons)
offset = align_segment (&align);
if (offset)
if (sym->attr.proc == PROC_INTRINSIC)
return get_identifier (sym->name);
- if (gfc_option.flag_underscoring)
+ if (flag_underscoring)
{
has_underscore = strchr (sym->name, '_') != 0;
if (flag_second_underscore && has_underscore)
/* Even when -frepack-arrays is used, symbols with TARGET attribute
are not repacked. */
- if (!gfc_option.flag_repack_arrays || sym->attr.target)
+ if (!flag_repack_arrays || sym->attr.target)
{
if (as->type == AS_ASSUMED_SIZE)
packed = PACKED_FULL;
}
}
- if (gfc_option.flag_f2c
+ if (flag_f2c
&& ((e.ts.type == BT_REAL && e.ts.kind == gfc_default_real_kind)
|| e.ts.type == BT_COMPLEX))
{
if (sym->attr.access == ACCESS_UNKNOWN && sym->module
&& (sym->ns->default_access == ACCESS_PRIVATE
|| (sym->ns->default_access == ACCESS_UNKNOWN
- && gfc_option.flag_module_private)))
+ && flag_module_private)))
sym->attr.access = ACCESS_PRIVATE;
if (!current_function_decl
gfor_fndecl_sgemm = gfc_build_library_function_decl
(get_identifier
- (gfc_option.flag_underscoring ? "sgemm_"
- : "sgemm"),
+ (flag_underscoring ? "sgemm_" : "sgemm"),
void_type_node, 15, pchar_type_node,
pchar_type_node, pint, pint, pint, ps, ps, pint,
ps, pint, ps, ps, pint, integer_type_node,
integer_type_node);
gfor_fndecl_dgemm = gfc_build_library_function_decl
(get_identifier
- (gfc_option.flag_underscoring ? "dgemm_"
- : "dgemm"),
+ (flag_underscoring ? "dgemm_" : "dgemm"),
void_type_node, 15, pchar_type_node,
pchar_type_node, pint, pint, pint, pd, pd, pint,
pd, pint, pd, pd, pint, integer_type_node,
integer_type_node);
gfor_fndecl_cgemm = gfc_build_library_function_decl
(get_identifier
- (gfc_option.flag_underscoring ? "cgemm_"
- : "cgemm"),
+ (flag_underscoring ? "cgemm_" : "cgemm"),
void_type_node, 15, pchar_type_node,
pchar_type_node, pint, pint, pint, pc, pc, pint,
pc, pint, pc, pc, pint, integer_type_node,
integer_type_node);
gfor_fndecl_zgemm = gfc_build_library_function_decl
(get_identifier
- (gfc_option.flag_underscoring ? "zgemm_"
- : "zgemm"),
+ (flag_underscoring ? "zgemm_" : "zgemm"),
void_type_node, 15, pchar_type_node,
pchar_type_node, pint, pint, pint, pz, pz, pint,
pz, pint, pz, pz, pint, integer_type_node,
gfc_trans_dummy_character (proc_sym, proc_sym->ts.u.cl, block);
}
else
- gcc_assert (gfc_option.flag_f2c
- && proc_sym->ts.type == BT_COMPLEX);
+ gcc_assert (flag_f2c && proc_sym->ts.type == BT_COMPLEX);
}
/* Initialize the INTENT(OUT) derived type dummy arguments. This
&& (sym->attr.access == ACCESS_UNKNOWN
&& (sym->ns->default_access == ACCESS_PRIVATE
|| (sym->ns->default_access == ACCESS_UNKNOWN
- && gfc_option.flag_module_private))))
+ && flag_module_private))))
sym->attr.access = ACCESS_PRIVATE;
if (warn_unused_variable && !sym->attr.referenced
build_int_cst (integer_type_node,
0));
CONSTRUCTOR_APPEND_ELT (v, NULL_TREE,
- build_int_cst (integer_type_node,
- gfc_option.flag_backtrace));
+ build_int_cst (integer_type_node, flag_backtrace));
CONSTRUCTOR_APPEND_ELT (v, NULL_TREE,
- build_int_cst (integer_type_node,
- gfc_option.flag_sign_zero));
+ build_int_cst (integer_type_node, flag_sign_zero));
CONSTRUCTOR_APPEND_ELT (v, NULL_TREE,
build_int_cst (integer_type_node,
(gfc_option.rtcheck
|| (sym->attr.entry_master
&& sym->ns->entries->sym->attr.recursive);
if ((gfc_option.rtcheck & GFC_RTCHECK_RECURSION)
- && !is_recursive
- && !gfc_option.flag_recursive)
+ && !is_recursive && !flag_recursive)
{
char * msg;
/* Reset recursion-check variable. */
if ((gfc_option.rtcheck & GFC_RTCHECK_RECURSION)
- && !is_recursive
- && !gfc_option.gfc_flag_openmp
- && recurcheckvar != NULL_TREE)
+ && !is_recursive && !flag_openmp && recurcheckvar != NULL_TREE)
{
gfc_add_modify (&cleanup, recurcheckvar, boolean_false_node);
recurcheckvar = NULL;
se->expr);
/* Dereference scalar hidden result. */
- if (gfc_option.flag_f2c && sym->ts.type == BT_COMPLEX
+ if (flag_f2c && sym->ts.type == BT_COMPLEX
&& (sym->attr.function || sym->attr.result)
&& !sym->attr.dimension && !sym->attr.pointer
&& !sym->attr.always_explicit)
}
else
{
- gcc_assert (gfc_option.flag_f2c && ts.type == BT_COMPLEX);
+ gcc_assert (flag_f2c && ts.type == BT_COMPLEX);
type = gfc_get_complex_type (ts.kind);
var = gfc_build_addr_expr (NULL_TREE, gfc_create_var (type, "cmplx"));
return a double precision result. Convert this back to default
real. We only care about the cases that can happen in Fortran 77.
*/
- if (gfc_option.flag_f2c && sym->ts.type == BT_REAL
+ if (flag_f2c && sym->ts.type == BT_REAL
&& sym->ts.kind == gfc_default_real_kind
&& !sym->attr.always_explicit)
se->expr = fold_convert (gfc_get_real_type (sym->ts.kind), se->expr);
}
else
{
- gcc_assert (ts.type == BT_COMPLEX && gfc_option.flag_f2c);
+ gcc_assert (ts.type == BT_COMPLEX && flag_f2c);
se->expr = build_fold_indirect_ref_loc (input_location, var);
}
}
/* We explicitly have to ignore the minus sign. We do so by using
result = (arg1 == 0) ? abs(arg0) : copysign(arg0, arg1). */
- if (!gfc_option.flag_sign_zero
+ if (!flag_sign_zero
&& MODE_HAS_SIGNED_ZEROS (TYPE_MODE (TREE_TYPE (args[1]))))
{
tree cond, zero;
{
tree cint = gfc_get_int_type (gfc_c_int_kind);
- if (gfc_option.flag_external_blas
+ if (flag_external_blas
&& (sym->ts.type == BT_REAL || sym->ts.type == BT_COMPLEX)
&& (sym->ts.kind == 4 || sym->ts.kind == 8))
{
vec_alloc (append_args, 3);
append_args->quick_push (build_int_cst (cint, 1));
append_args->quick_push (build_int_cst (cint,
- gfc_option.blas_matmul_limit));
+ flag_blas_matmul_limit));
append_args->quick_push (gfc_build_addr_expr (NULL_TREE,
gemm_fndecl));
}
clausesa = clausesa_buf;
gfc_split_omp_clauses (code, clausesa);
}
- if (gfc_option.gfc_flag_openmp)
+ if (flag_openmp)
omp_do_clauses
= gfc_trans_omp_clauses (&block, &clausesa[GFC_OMP_SPLIT_DO], code->loc);
body = gfc_trans_omp_do (code, EXEC_OMP_SIMD, pblock ? pblock : &block,
}
else if (TREE_CODE (body) != BIND_EXPR)
body = build3_v (BIND_EXPR, NULL, body, NULL_TREE);
- if (gfc_option.gfc_flag_openmp)
+ if (flag_openmp)
{
stmt = make_node (OMP_FOR);
TREE_TYPE (stmt) = void_type_node;
clausesa = clausesa_buf;
gfc_split_omp_clauses (code, clausesa);
}
- if (gfc_option.gfc_flag_openmp)
+ if (flag_openmp)
omp_clauses
= gfc_trans_omp_clauses (&block, &clausesa[GFC_OMP_SPLIT_PARALLEL],
code->loc);
}
else if (TREE_CODE (stmt) != BIND_EXPR)
stmt = build3_v (BIND_EXPR, NULL, stmt, NULL_TREE);
- if (gfc_option.gfc_flag_openmp)
+ if (flag_openmp)
{
stmt = build2_loc (input_location, OMP_PARALLEL, void_type_node, stmt,
omp_clauses);
clausesa = clausesa_buf;
gfc_split_omp_clauses (code, clausesa);
}
- if (gfc_option.gfc_flag_openmp)
+ if (flag_openmp)
omp_clauses
= gfc_trans_omp_clauses (&block, &clausesa[GFC_OMP_SPLIT_DISTRIBUTE],
code->loc);
default:
gcc_unreachable ();
}
- if (gfc_option.gfc_flag_openmp)
+ if (flag_openmp)
{
tree distribute = make_node (OMP_DISTRIBUTE);
TREE_TYPE (distribute) = void_type_node;
clausesa = clausesa_buf;
gfc_split_omp_clauses (code, clausesa);
}
- if (gfc_option.gfc_flag_openmp)
+ if (flag_openmp)
omp_clauses
= gfc_trans_omp_clauses (&block, &clausesa[GFC_OMP_SPLIT_TEAMS],
code->loc);
gfc_start_block (&block);
gfc_split_omp_clauses (code, clausesa);
- if (gfc_option.gfc_flag_openmp)
+ if (flag_openmp)
omp_clauses
= gfc_trans_omp_clauses (&block, &clausesa[GFC_OMP_SPLIT_TARGET],
code->loc);
stmt = gfc_trans_omp_teams (code, clausesa);
if (TREE_CODE (stmt) != BIND_EXPR)
stmt = build3_v (BIND_EXPR, NULL, stmt, NULL_TREE);
- if (gfc_option.gfc_flag_openmp)
+ if (flag_openmp)
stmt = build2_loc (input_location, OMP_TARGET, void_type_node, stmt,
omp_clauses);
gfc_add_expr_to_block (&block, stmt);
/* We see this derived type first time, so build the type node. */
typenode = make_node (RECORD_TYPE);
TYPE_NAME (typenode) = get_identifier (derived->name);
- TYPE_PACKED (typenode) = gfc_option.flag_pack_derived;
+ TYPE_PACKED (typenode) = flag_pack_derived;
derived->backend_decl = typenode;
}
-fno-f2c calling convention), nor for calls to functions which always
require an explicit interface, as no compatibility problems can
arise there. */
- if (gfc_option.flag_f2c
- && sym->ts.type == BT_COMPLEX
+ if (flag_f2c && sym->ts.type == BT_COMPLEX
&& !sym->attr.intrinsic && !sym->attr.always_explicit)
return 1;
type = void_type_node;
else if (sym->attr.mixed_entry_master)
type = gfc_get_mixed_entry_union (sym->ns);
- else if (gfc_option.flag_f2c
- && sym->ts.type == BT_REAL
+ else if (flag_f2c && sym->ts.type == BT_REAL
&& sym->ts.kind == gfc_default_real_kind
&& !sym->attr.always_explicit)
{