From patchwork Sat Sep 24 18:29:39 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Carlini X-Patchwork-Id: 116242 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id E95D7B6F70 for ; Sun, 25 Sep 2011 04:31:46 +1000 (EST) Received: (qmail 24334 invoked by alias); 24 Sep 2011 18:31:43 -0000 Received: (qmail 24315 invoked by uid 22791); 24 Sep 2011 18:31:43 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from rcsinet15.oracle.com (HELO rcsinet15.oracle.com) (148.87.113.117) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 24 Sep 2011 18:31:29 +0000 Received: from rtcsinet21.oracle.com (rtcsinet21.oracle.com [66.248.204.29]) by rcsinet15.oracle.com (Switch-3.4.4/Switch-3.4.4) with ESMTP id p8OIVJeX018207 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 24 Sep 2011 18:31:28 GMT Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156]) by rtcsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id p8OIUo7L023193 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 24 Sep 2011 18:30:51 GMT Received: from abhmt109.oracle.com (abhmt109.oracle.com [141.146.116.61]) by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id p8OIUiQX023468; Sat, 24 Sep 2011 13:30:45 -0500 Received: from [192.168.1.4] (/79.43.235.125) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 24 Sep 2011 11:30:44 -0700 Message-ID: <4E7E2193.9000005@oracle.com> Date: Sat, 24 Sep 2011 20:29:39 +0200 From: Paolo Carlini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:6.0.2) Gecko/20110907 Thunderbird/6.0.2 MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" CC: libstdc++ Subject: [v3] libstdc++/50509 X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Hi, committed mainline and 4_6-branch. Paolo. ////////////////////// 2011-09-24 John Salmon PR libstdc++/50509 * include/bits/random.tcc (seed_seq::generate): Fix computation. Index: include/bits/random.tcc =================================================================== --- include/bits/random.tcc (revision 179143) +++ include/bits/random.tcc (working copy) @@ -2768,7 +2768,7 @@ _Type __arg = (__begin[__k % __n] ^ __begin[(__k + __p) % __n] ^ __begin[(__k - 1) % __n]); - _Type __r1 = __arg ^ (__arg << 27); + _Type __r1 = __arg ^ (__arg >> 27); __r1 = __detail::__mod<_Type, __detail::_Shift<_Type, 32>::__value, 1664525u, 0u>(__r1); _Type __r2 = __r1; @@ -2790,7 +2790,7 @@ _Type __arg = (__begin[__k % __n] + __begin[(__k + __p) % __n] + __begin[(__k - 1) % __n]); - _Type __r3 = __arg ^ (__arg << 27); + _Type __r3 = __arg ^ (__arg >> 27); __r3 = __detail::__mod<_Type, __detail::_Shift<_Type, 32>::__value, 1566083941u, 0u>(__r3); _Type __r4 = __r3 - __k % __n;