This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/57245] New: Floating-point constant truncation ignores -frounding-math
- From: "jsm28 at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 10 May 2013 20:35:07 +0000
- Subject: [Bug tree-optimization/57245] New: Floating-point constant truncation ignores -frounding-math
- Auto-submitted: auto-generated
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.