public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/57245] New: Floating-point constant truncation ignores -frounding-math
@ 2013-05-10 20:35 jsm28 at gcc dot gnu.org
  2013-05-13  8:44 ` [Bug tree-optimization/57245] " rguenth at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2013-05-10 20:35 UTC (permalink / raw)
  To: gcc-bugs

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.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug tree-optimization/57245] Floating-point constant truncation ignores -frounding-math
  2013-05-10 20:35 [Bug tree-optimization/57245] New: Floating-point constant truncation ignores -frounding-math jsm28 at gcc dot gnu.org
@ 2013-05-13  8:44 ` rguenth at gcc dot gnu.org
  2021-10-27 12:31 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-05-13  8:44 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-05-13
     Ever confirmed|0                           |1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed.  Note that some callers may expect a constant result anyway
(see the TREE_OVERFLOW setting which seems to be overflow indicating...).
So fixing this may not be easy without fallout.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug tree-optimization/57245] Floating-point constant truncation ignores -frounding-math
  2013-05-10 20:35 [Bug tree-optimization/57245] New: Floating-point constant truncation ignores -frounding-math jsm28 at gcc dot gnu.org
  2013-05-13  8:44 ` [Bug tree-optimization/57245] " rguenth at gcc dot gnu.org
@ 2021-10-27 12:31 ` rguenth at gcc dot gnu.org
  2021-10-28  9:29 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-10-27 12:31 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot gnu.org

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
I have a patch fixing fold_convert_const_real_from_real

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug tree-optimization/57245] Floating-point constant truncation ignores -frounding-math
  2013-05-10 20:35 [Bug tree-optimization/57245] New: Floating-point constant truncation ignores -frounding-math jsm28 at gcc dot gnu.org
  2013-05-13  8:44 ` [Bug tree-optimization/57245] " rguenth at gcc dot gnu.org
  2021-10-27 12:31 ` rguenth at gcc dot gnu.org
@ 2021-10-28  9:29 ` cvs-commit at gcc dot gnu.org
  2021-10-28  9:29 ` rguenth at gcc dot gnu.org
  2021-12-27 13:40 ` hjl.tools at gmail dot com
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-10-28  9:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>:

https://gcc.gnu.org/g:a84b9d5373c7e67fd0ab2a412c22162cdf969c91

commit r12-4764-ga84b9d5373c7e67fd0ab2a412c22162cdf969c91
Author: Richard Biener <rguenther@suse.de>
Date:   Wed Oct 27 14:27:40 2021 +0200

    middle-end/57245 - honor -frounding-math in real truncation

    The following honors -frounding-math when converting a FP constant
    to another FP type.

    2021-10-27  Richard Biener  <rguenther@suse.de>

            PR middle-end/57245
            * fold-const.c (fold_convert_const_real_from_real): Honor
            -frounding-math if the conversion is not exact.
            * simplify-rtx.c (simplify_const_unary_operation): Do not
            simplify FLOAT_TRUNCATE with sign dependent rounding.

            * gcc.dg/torture/fp-double-convert-float-1.c: New testcase.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug tree-optimization/57245] Floating-point constant truncation ignores -frounding-math
  2013-05-10 20:35 [Bug tree-optimization/57245] New: Floating-point constant truncation ignores -frounding-math jsm28 at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2021-10-28  9:29 ` cvs-commit at gcc dot gnu.org
@ 2021-10-28  9:29 ` rguenth at gcc dot gnu.org
  2021-12-27 13:40 ` hjl.tools at gmail dot com
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-10-28  9:29 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
This aspect is fixed.  For fp<->int converts see PR84407.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug tree-optimization/57245] Floating-point constant truncation ignores -frounding-math
  2013-05-10 20:35 [Bug tree-optimization/57245] New: Floating-point constant truncation ignores -frounding-math jsm28 at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2021-10-28  9:29 ` rguenth at gcc dot gnu.org
@ 2021-12-27 13:40 ` hjl.tools at gmail dot com
  4 siblings, 0 replies; 6+ messages in thread
From: hjl.tools at gmail dot com @ 2021-12-27 13:40 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57245
Bug 57245 depends on bug 103735, which changed state.

Bug 103735 Summary: [12 Regression] Extra glibc "make check" failures by r12-4764
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103735

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |MOVED

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-12-27 13:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-10 20:35 [Bug tree-optimization/57245] New: Floating-point constant truncation ignores -frounding-math jsm28 at gcc dot gnu.org
2013-05-13  8:44 ` [Bug tree-optimization/57245] " rguenth at gcc dot gnu.org
2021-10-27 12:31 ` rguenth at gcc dot gnu.org
2021-10-28  9:29 ` cvs-commit at gcc dot gnu.org
2021-10-28  9:29 ` rguenth at gcc dot gnu.org
2021-12-27 13:40 ` hjl.tools at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).