/* By default, C99-like requirements for complex multiply and divide. */
opts->x_flag_complex_method = 2;
+ opts->x_flag_default_complex_method = opts->x_flag_complex_method;
}
/* Common initialization before calling option handlers. */
Variable
int flag_complex_method = 1
+Variable
+int flag_default_complex_method = 1
+
; Language specific warning pass for unused results.
Variable
bool flag_warn_unused_result = false
/* Default to avoiding range issues for complex multiply and
divide. */
opts->x_flag_complex_method = 2;
+ opts->x_flag_default_complex_method = opts->x_flag_complex_method;
/* The builtin math functions should not set errno. */
opts->x_flag_errno_math = 0;
safe choice. This will pessimize Fortran code with LTO unless
people specify a complex method manually or use -ffast-math. */
opts->x_flag_complex_method = 2;
+ opts->x_flag_default_complex_method = opts->x_flag_complex_method;
}
/* Handle command-line option SCODE. If the option takes an argument, it is
= (opts->x_flag_unroll_loops
|| opts->x_flag_peel_loops
|| opts->x_optimize >= 3);
+
+ /* With -fcx-limited-range, we do cheap and quick complex arithmetic. */
+ if (opts->x_flag_cx_limited_range)
+ opts->x_flag_complex_method = 0;
+ else if (opts_set->x_flag_cx_limited_range)
+ opts->x_flag_complex_method = opts->x_flag_default_complex_method;
+
+ /* With -fcx-fortran-rules, we do something in-between cheap and C99. */
+ if (opts->x_flag_cx_fortran_rules)
+ opts->x_flag_complex_method = 1;
+ else if (opts_set->x_flag_cx_fortran_rules)
+ opts->x_flag_complex_method = opts->x_flag_default_complex_method;
}
#define LEFT_COLUMN 27
--- /dev/null
+/* { dg-additional-options "-fcx-limited-range -fdump-tree-optimized" } */
+
+#pragma GCC optimize "-fno-cx-limited-range"
+
+void do_div (_Complex double *a, _Complex double *b)
+{
+ *a = *b / (4.0 - 5.0fi);
+}
+
+/* { dg-final { scan-tree-dump "__divdc3" "optimized" } } */
--- /dev/null
+/* { dg-additional-options "-fdump-tree-optimized" } */
+
+#pragma GCC optimize "-fcx-limited-range"
+
+void do_div (_Complex double *a, _Complex double *b)
+{
+ *a = *b / (4.0 - 5.0fi);
+}
+
+/* { dg-final { scan-tree-dump-not "__divdc3" "optimized" } } */
flag_stack_check = NO_STACK_CHECK;
}
- /* With -fcx-limited-range, we do cheap and quick complex arithmetic. */
- if (flag_cx_limited_range)
- flag_complex_method = 0;
-
- /* With -fcx-fortran-rules, we do something in-between cheap and C99. */
- if (flag_cx_fortran_rules)
- flag_complex_method = 1;
-
/* Targets must be able to place spill slots at lower addresses. If the
target already uses a soft frame pointer, the transition is trivial. */
if (!FRAME_GROWS_DOWNWARD && flag_stack_protect)