public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/57110] New: is the use of "uint_fast32_t" in <random> intentional?
@ 2013-04-29 10:20 vincenzo.innocente at cern dot ch
  2013-04-29 10:44 ` [Bug libstdc++/57110] " paolo.carlini at oracle dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: vincenzo.innocente at cern dot ch @ 2013-04-29 10:20 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 57110
           Summary: is the use of "uint_fast32_t" in <random> intentional?
    Classification: Unclassified
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: vincenzo.innocente@cern.ch


Trying to understand differences for the mersenne_twister_engine between Linux
and MacOS (both x86_64) I discovered that on Linux uint_fast32_t is 64 bits
while on Mac is 32

this makes
typedef mersenne_twister_engine<
   uint_fast32_t,
   32, 624, 397, 31,
   0x9908b0dfUL, 11,
   0xffffffffUL, 7,
   0x9d2c5680UL, 15,
   0xefc60000UL, 18, 1812433253UL> mt19937;

different on the two systems.
in particular
_UIntType   _M_x[state_size];
is a vector of ULL on linux and of UI on Mac

is this really intentional?

btw bits/random.h is the only place where uint_fast32_t is actually used in the
whole libstdc++


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

* [Bug libstdc++/57110] is the use of "uint_fast32_t" in <random> intentional?
  2013-04-29 10:20 [Bug libstdc++/57110] New: is the use of "uint_fast32_t" in <random> intentional? vincenzo.innocente at cern dot ch
@ 2013-04-29 10:44 ` paolo.carlini at oracle dot com
  2013-04-29 11:47 ` vincenzo.innocente at cern dot ch
  2013-04-29 11:50 ` paolo.carlini at oracle dot com
  2 siblings, 0 replies; 4+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-04-29 10:44 UTC (permalink / raw)
  To: gcc-bugs


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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID

--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> 2013-04-29 10:44:18 UTC ---
Obviously, whatever the size of the type on the various targets, it has nothing
to do with <random> per se (or even v3, because <cstdint> just wraps
<stdint.h>), because, per the Standard, mt19937 *must* use uint_fast32_t
(26.5.5, there are *many* uses of the _fast_ variants)


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

* [Bug libstdc++/57110] is the use of "uint_fast32_t" in <random> intentional?
  2013-04-29 10:20 [Bug libstdc++/57110] New: is the use of "uint_fast32_t" in <random> intentional? vincenzo.innocente at cern dot ch
  2013-04-29 10:44 ` [Bug libstdc++/57110] " paolo.carlini at oracle dot com
@ 2013-04-29 11:47 ` vincenzo.innocente at cern dot ch
  2013-04-29 11:50 ` paolo.carlini at oracle dot com
  2 siblings, 0 replies; 4+ messages in thread
From: vincenzo.innocente at cern dot ch @ 2013-04-29 11:47 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #2 from vincenzo Innocente <vincenzo.innocente at cern dot ch> 2013-04-29 11:47:54 UTC ---
Understood.
The question should than be escalated to the c++ standard committee

In my opinion the use of a 32-bit unsigned int as storage and return type for a
mersenne_twister_engine
with word_size=32 is wrong (besides being unnecessary and inefficient)

in any case std::mt19937 is just a type alias: users can define their own using
uint32_t in case they care of computational efficiency.


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

* [Bug libstdc++/57110] is the use of "uint_fast32_t" in <random> intentional?
  2013-04-29 10:20 [Bug libstdc++/57110] New: is the use of "uint_fast32_t" in <random> intentional? vincenzo.innocente at cern dot ch
  2013-04-29 10:44 ` [Bug libstdc++/57110] " paolo.carlini at oracle dot com
  2013-04-29 11:47 ` vincenzo.innocente at cern dot ch
@ 2013-04-29 11:50 ` paolo.carlini at oracle dot com
  2 siblings, 0 replies; 4+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-04-29 11:50 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #3 from Paolo Carlini <paolo.carlini at oracle dot com> 2013-04-29 11:50:40 UTC ---
Send an email to your colleague Walter Brown @ FNAL, I'm sure he is interested.


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

end of thread, other threads:[~2013-04-29 11:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-29 10:20 [Bug libstdc++/57110] New: is the use of "uint_fast32_t" in <random> intentional? vincenzo.innocente at cern dot ch
2013-04-29 10:44 ` [Bug libstdc++/57110] " paolo.carlini at oracle dot com
2013-04-29 11:47 ` vincenzo.innocente at cern dot ch
2013-04-29 11:50 ` paolo.carlini at oracle 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).