https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122325

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot 
gnu.org
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2025-10-20
     Ever confirmed|0                           |1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed.  So with -O -ffast-math we first handle

(gdb) p *decoded
$3 = {opt_index = 1317, warn_message = 0x0, arg = 0x0, 
  orig_option_with_args_text = 0x4ee4410 "-fno-fast-math", canonical_option = {
    0x4ee4410 "-fno-fast-math", 0x0, 0x0, 0x0}, 
  canonical_option_num_elements = 1, value = 0, mask = 0, errors = 4}

then

(gdb) p *decoded
$4 = {opt_index = 1317, warn_message = 0x0, arg = 0x0, 
  orig_option_with_args_text = 0x4ee3da0 "-ffast-math", canonical_option = {
    0x467bb42 "-ffast-math", 0x0, 0x0, 0x0}, 
  canonical_option_num_elements = 1, value = 1, mask = 0, errors = 0}

which correctly sets opts->x_flag_complex_method = 0;

But then finish_options comes along:

  /* Use a frontend provided default for the complex eval method.  */
  if (!opts_set->x_flag_complex_method)
    opts->x_flag_complex_method = opts->x_flag_default_complex_method;

Previously we had at this point

  /* 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;

IMO flag_default_complex_method should go away.

Reply via email to