public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug math/16296] New: fegetround is pure?
@ 2013-12-05 23:18 marc.glisse at normalesup dot org
  2013-12-06  0:04 ` [Bug math/16296] " bugdal at aerifal dot cx
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: marc.glisse at normalesup dot org @ 2013-12-05 23:18 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=16296

            Bug ID: 16296
           Summary: fegetround is pure?
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: math
          Assignee: unassigned at sourceware dot org
          Reporter: marc.glisse at normalesup dot org

I could be wrong, but it seems that the function fegetround could get
__attribute_pure__, since it only reads a global state, and in particular the
usual optimizations (remove it if the result is unused, reuse the result from
the first call when there are two calls in a row) should be fine.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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

* [Bug math/16296] fegetround is pure?
  2013-12-05 23:18 [Bug math/16296] New: fegetround is pure? marc.glisse at normalesup dot org
@ 2013-12-06  0:04 ` bugdal at aerifal dot cx
  2013-12-06  6:26 ` marc.glisse at normalesup dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: bugdal at aerifal dot cx @ 2013-12-06  0:04 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=16296

Rich Felker <bugdal at aerifal dot cx> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugdal at aerifal dot cx

--- Comment #1 from Rich Felker <bugdal at aerifal dot cx> ---
How do you expect the compiler to know it can't cache the result of fegetround
across calls to fesetround, fesetenv, etc.?

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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

* [Bug math/16296] fegetround is pure?
  2013-12-05 23:18 [Bug math/16296] New: fegetround is pure? marc.glisse at normalesup dot org
  2013-12-06  0:04 ` [Bug math/16296] " bugdal at aerifal dot cx
@ 2013-12-06  6:26 ` marc.glisse at normalesup dot org
  2013-12-06  6:58 ` bugdal at aerifal dot cx
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: marc.glisse at normalesup dot org @ 2013-12-06  6:26 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=16296

--- Comment #2 from Marc Glisse <marc.glisse at normalesup dot org> ---
(In reply to Rich Felker from comment #1)
> How do you expect the compiler to know it can't cache the result of
> fegetround across calls to fesetround, fesetenv, etc.?

Uh, the same as for any pure function? The definition of pure is that it only
depends on the arguments and global memory (as opposed to const, which only
depends on the arguments). Any non-pure function call like fesetround clobbers
global memory and the compiler knows that caching becomes invalid then.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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

* [Bug math/16296] fegetround is pure?
  2013-12-05 23:18 [Bug math/16296] New: fegetround is pure? marc.glisse at normalesup dot org
  2013-12-06  0:04 ` [Bug math/16296] " bugdal at aerifal dot cx
  2013-12-06  6:26 ` marc.glisse at normalesup dot org
@ 2013-12-06  6:58 ` bugdal at aerifal dot cx
  2014-06-13 11:29 ` fweimer at redhat dot com
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: bugdal at aerifal dot cx @ 2013-12-06  6:58 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=16296

--- Comment #3 from Rich Felker <bugdal at aerifal dot cx> ---
I was probably confusing it with attribute const...

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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

* [Bug math/16296] fegetround is pure?
  2013-12-05 23:18 [Bug math/16296] New: fegetround is pure? marc.glisse at normalesup dot org
                   ` (2 preceding siblings ...)
  2013-12-06  6:58 ` bugdal at aerifal dot cx
@ 2014-06-13 11:29 ` fweimer at redhat dot com
  2015-09-15 20:38 ` jsm28 at gcc dot gnu.org
  2015-09-15 20:38 ` cvs-commit at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: fweimer at redhat dot com @ 2014-06-13 11:29 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=16296

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
              Flags|                            |security-

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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

* [Bug math/16296] fegetround is pure?
  2013-12-05 23:18 [Bug math/16296] New: fegetround is pure? marc.glisse at normalesup dot org
                   ` (3 preceding siblings ...)
  2014-06-13 11:29 ` fweimer at redhat dot com
@ 2015-09-15 20:38 ` jsm28 at gcc dot gnu.org
  2015-09-15 20:38 ` cvs-commit at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2015-09-15 20:38 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=16296

Joseph Myers <jsm28 at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |2.23

--- Comment #5 from Joseph Myers <jsm28 at gcc dot gnu.org> ---
Fixed for 2.23.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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

* [Bug math/16296] fegetround is pure?
  2013-12-05 23:18 [Bug math/16296] New: fegetround is pure? marc.glisse at normalesup dot org
                   ` (4 preceding siblings ...)
  2015-09-15 20:38 ` jsm28 at gcc dot gnu.org
@ 2015-09-15 20:38 ` cvs-commit at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2015-09-15 20:38 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=16296

--- Comment #4 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  223d1cacc5dafe8af53e84608c2d130721c4edcd (commit)
      from  0b87419b690d1711697ed95808527400910ff997 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=223d1cacc5dafe8af53e84608c2d130721c4edcd

commit 223d1cacc5dafe8af53e84608c2d130721c4edcd
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Tue Sep 15 20:36:50 2015 +0000

    Mark fegetround pure (bug 16296).

    Bug 16296 notes that fegetround is a pure function and should be
    marked as such in fenv.h.  This patch implements that.

    Tested for x86_64 and x86 (testsuite, and that installed stripped
    shared libraries are unchanged by this patch).

        [BZ #16296]
        * math/fenv.h (fegetround): Use __attribute_pure__.
        * include/fenv.h (__fegetround): Likewise.

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog      |    4 ++++
 NEWS           |   12 ++++++------
 include/fenv.h |    2 +-
 math/fenv.h    |    2 +-
 4 files changed, 12 insertions(+), 8 deletions(-)

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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

end of thread, other threads:[~2015-09-15 20:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-05 23:18 [Bug math/16296] New: fegetround is pure? marc.glisse at normalesup dot org
2013-12-06  0:04 ` [Bug math/16296] " bugdal at aerifal dot cx
2013-12-06  6:26 ` marc.glisse at normalesup dot org
2013-12-06  6:58 ` bugdal at aerifal dot cx
2014-06-13 11:29 ` fweimer at redhat dot com
2015-09-15 20:38 ` jsm28 at gcc dot gnu.org
2015-09-15 20:38 ` cvs-commit at gcc dot gnu.org

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).