Bug 40123

Summary: [4.5 Regression] Revision 147395 failed libstc++ tests
Product: gcc Reporter: H.J. Lu <hjl.tools>
Component: libstdc++Assignee: Paolo Carlini <paolo.carlini>
Status: RESOLVED FIXED    
Severity: normal CC: gcc-bugs, paolo.carlini
Priority: P3    
Version: 4.5.0   
Target Milestone: 4.5.0   
Host: Target:
Build: Known to work:
Known to fail: Last reconfirmed: 2009-05-14 17:12:11

Description H.J. Lu 2009-05-12 15:01:43 UTC
On Linux/x86-64, with checking enabled, revision 147395

http://gcc.gnu.org/ml/gcc-cvs/2009-05/msg00369.html

caused

FAIL: 26_numerics/random/independent_bits_engine/operators/equal.cc execution test
FAIL: 26_numerics/random/independent_bits_engine/operators/serialize.cc execution test

with -m32.
Comment 1 Paolo Carlini 2009-05-14 08:21:46 UTC
Assigning to Honza basing on a comment on the mailing list...
Comment 2 Paolo Carlini 2009-05-14 08:54:59 UTC
I tried to reproduce the equal.cc fail, for example, and it happens only at -O1 or above, as a "Floating point exception"...
Comment 3 Paolo Carlini 2009-05-14 09:07:05 UTC
Before dealing with this a middle-end, let me double check the implementation, because I'm seeing something fishy...
Comment 4 Paolo Carlini 2009-05-14 17:12:02 UTC
Indeed, very fishy: 1UL << 48. Patch forthcoming.
Comment 5 paolo@gcc.gnu.org 2009-05-14 17:56:34 UTC
Subject: Bug 40123

Author: paolo
Date: Thu May 14 17:56:17 2009
New Revision: 147538

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=147538
Log:
2009-05-14  Paolo Carlini  <paolo.carlini@oracle.com>

	PR libstdc++/40123
	* random.tcc (independent_bits_engine<>::operator()()): Use
	result_type(1), not 1UL.

	* random.tcc (independent_bits_engine<>::operator()()): Use _M_b.max()
	and _M_b.min(), instead of this->max() and this->min().

	* random.h (_ShiftMin1): Remove, adjust everywhere.

	* random.tcc: Minor cosmetic changes.

Modified:
    trunk/libstdc++-v3/ChangeLog
    trunk/libstdc++-v3/include/bits/random.h
    trunk/libstdc++-v3/include/bits/random.tcc

Comment 6 Paolo Carlini 2009-05-14 17:59:02 UTC
Fixed.