This is the mail archive of the gcc-bugs@gcc.gnu.org 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]

[Bug tree-optimization/57245] New: Floating-point constant truncation ignores -frounding-math


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57245

            Bug ID: 57245
           Summary: Floating-point constant truncation ignores
                    -frounding-math
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jsm28 at gcc dot gnu.org
            Blocks: 16989

When a floating-point constant is converted to a narrower floating-point type,
this conversion is meant to respect the current rounding direction, but GCC
does the conversion at compile time even with -frounding-math.  Example (tested
x86_64 and ARM):

float f;
void func (void) { f = 1.3L; }

fold_convert_const_real_from_real or its caller should avoid such conversions
if -frounding-math, unless the conversion is exact.


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