This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: question about -ffast-math implementation

Mike Izbicki <> writes:

> Right, but I've never taken a look at the gcc codebase.  Where would I
> start looking for the relevant files?  Is there a general introduction
> to the codebase anywhere that I should start with?

grep for all the flags set in the two functions below (from gcc/opts.c),
without the x_ to catch all:

/* The following routines are useful in setting all the flags that
   -ffast-math and -fno-fast-math imply.  */
static void
set_fast_math_flags (struct gcc_options *opts, int set)
  if (!opts->frontend_set_flag_unsafe_math_optimizations)
      opts->x_flag_unsafe_math_optimizations = set;
      set_unsafe_math_optimizations_flags (opts, set);
  if (!opts->frontend_set_flag_finite_math_only)
    opts->x_flag_finite_math_only = set;
  if (!opts->frontend_set_flag_errno_math)
    opts->x_flag_errno_math = !set;
  if (set)
      if (!opts->frontend_set_flag_signaling_nans)
        opts->x_flag_signaling_nans = 0;
      if (!opts->frontend_set_flag_rounding_math)
        opts->x_flag_rounding_math = 0;
      if (!opts->frontend_set_flag_cx_limited_range)
        opts->x_flag_cx_limited_range = 1;

/* When -funsafe-math-optimizations is set the following
   flags are set as well.  */
static void
set_unsafe_math_optimizations_flags (struct gcc_options *opts, int set)
  if (!opts->frontend_set_flag_trapping_math)
    opts->x_flag_trapping_math = !set;
  if (!opts->frontend_set_flag_signed_zeros)
    opts->x_flag_signed_zeros = !set;
  if (!opts->frontend_set_flag_associative_math)
    opts->x_flag_associative_math = set;
  if (!opts->frontend_set_flag_reciprocal_math)
    opts->x_flag_reciprocal_math = set;

-- -- Speaking for myself only

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]