{"id":2223149,"url":"http://patchwork.ozlabs.org/api/patches/2223149/?format=json","web_url":"http://patchwork.ozlabs.org/project/gcc/patch/DM4PR11MB82266EB089C712C94377C906EF252@DM4PR11MB8226.namprd11.prod.outlook.com/","project":{"id":17,"url":"http://patchwork.ozlabs.org/api/projects/17/?format=json","name":"GNU Compiler Collection","link_name":"gcc","list_id":"gcc-patches.gcc.gnu.org","list_email":"gcc-patches@gcc.gnu.org","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<DM4PR11MB82266EB089C712C94377C906EF252@DM4PR11MB8226.namprd11.prod.outlook.com>","list_archive_url":null,"date":"2026-04-14T15:04:40","name":"libstdc++: Fix philox_engine counter increment carry","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"012f07431322b95911a8ddaac02a16b980cabd44","submitter":{"id":93146,"url":"http://patchwork.ozlabs.org/api/people/93146/?format=json","name":"Tyuleneva, Elena","email":"elena.tyuleneva@intel.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/gcc/patch/DM4PR11MB82266EB089C712C94377C906EF252@DM4PR11MB8226.namprd11.prod.outlook.com/mbox/","series":[{"id":499859,"url":"http://patchwork.ozlabs.org/api/series/499859/?format=json","web_url":"http://patchwork.ozlabs.org/project/gcc/list/?series=499859","date":"2026-04-14T15:04:40","name":"libstdc++: Fix philox_engine counter increment carry","version":1,"mbox":"http://patchwork.ozlabs.org/series/499859/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2223149/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2223149/checks/","tags":{},"related":[],"headers":{"Return-Path":"<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":["incoming@patchwork.ozlabs.org","gcc-patches@gcc.gnu.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","gcc-patches@gcc.gnu.org"],"Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256\n header.s=Intel header.b=ROsp2H3+;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=2620:52:6:3111::32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)","sourceware.org;\n\tdkim=pass (2048-bit key,\n unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256\n header.s=Intel header.b=ROsp2H3+","sourceware.org;\n dmarc=pass (p=none dis=none) header.from=intel.com","sourceware.org; spf=pass smtp.mailfrom=intel.com","server2.sourceware.org;\n arc=fail smtp.remote-ip=192.198.163.19","dkim=none (message not signed)\n header.d=none;dmarc=none action=none header.from=intel.com;"],"Received":["from vm01.sourceware.org (vm01.sourceware.org\n [IPv6:2620:52:6:3111::32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fw6z0231Rz1y2d\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 15 Apr 2026 01:05:30 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 856294BA23D9\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 14 Apr 2026 15:05:28 +0000 (GMT)","from mgamail.intel.com (mgamail.intel.com [192.198.163.19])\n by sourceware.org (Postfix) with ESMTPS id A97A34BA2E07\n for <gcc-patches@gcc.gnu.org>; Tue, 14 Apr 2026 15:04:52 +0000 (GMT)","from orviesa006.jf.intel.com ([10.64.159.146])\n by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 14 Apr 2026 08:04:51 -0700","from orsmsx901.amr.corp.intel.com ([10.22.229.23])\n by orviesa006.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 14 Apr 2026 08:04:51 -0700","from ORSMSX901.amr.corp.intel.com (10.22.229.23) by\n ORSMSX901.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server\n (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n 15.2.2562.37; Tue, 14 Apr 2026 08:04:50 -0700","from ORSEDG901.ED.cps.intel.com (10.7.248.11) by\n ORSMSX901.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server\n (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n 15.2.2562.37 via Frontend Transport; Tue, 14 Apr 2026 08:04:50 -0700","from SJ2PR03CU001.outbound.protection.outlook.com (52.101.43.49) by\n edgegateway.intel.com (134.134.137.111) with Microsoft SMTP Server\n (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n 15.2.2562.37; Tue, 14 Apr 2026 08:04:48 -0700","from DM4PR11MB8226.namprd11.prod.outlook.com (2603:10b6:8:182::12)\n by DS4PPF93A1BBECD.namprd11.prod.outlook.com (2603:10b6:f:fc02::3c) with\n Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9745.42; Tue, 14 Apr\n 2026 15:04:40 +0000","from DM4PR11MB8226.namprd11.prod.outlook.com\n ([fe80::f6d1:8120:5e38:4dcc]) by DM4PR11MB8226.namprd11.prod.outlook.com\n ([fe80::f6d1:8120:5e38:4dcc%3]) with mapi id 15.20.9818.017; Tue, 14 Apr 2026\n 15:04:40 +0000"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org 856294BA23D9","OpenDKIM Filter v2.11.0 sourceware.org A97A34BA2E07"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org A97A34BA2E07","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org A97A34BA2E07","ARC-Seal":["i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1776179093; cv=fail;\n b=SqCtfvzZpyDuOMA1UYJZkY4t0EwX2evM5ymRgy3Q7HwcynA56L/lO1897hqK1iOozdMWowlkp7cEGPvmuC1u3XNJ+L2Rg/VnN0xF9b01mu6/0zsL2Vi2Z79OYFV9Jq59sUEAl21vgFlZXaun/ER+846oq6dgOuwsmkrAr1jVUds=","i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;\n b=OXA51/2aRCX17BgY1IBW7MGdQGiFRNDgv7jqRBir0GwrBJcJ9aql6pfaeofvAVw3ZmgsuckfmBhnmyd+Ipb4X/nFfkWb4heHYRSCkEbyLKF17iqwT6c9ZflsvJBxUiB9IfKJk4PCRSCKm5HWXw51E+pNucw6Z3e3mpdUq+mXUm4etq5kaThv91FD7wkMWUpkOpZ1hZP469q+gAdbv8W/1x7X2MFL/iqCiOg2yhs6uouTR4FmcbqFXidj/3RFtMrScWDZkD4HdW9O4k7x031kHqwhbU/K+RgBPO4oMo47zE9kEjEHT5SqlqP0rS5557EvHzVw0Zcx15KnfrBoMyaIIA=="],"ARC-Message-Signature":["i=2; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776179093; c=relaxed/simple;\n bh=Tu48biIY3h01zSoFiXALFkn9FnFuIxUNp08lxsQw97g=;\n h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version;\n b=JNDqpZ04v5OGrwwXpbU3hdiLnmgACquCMprfEgIqDOR28zOV79x797WlidXUSgvbnBmVYltx7wOq8qVjnKMsW8ILFB3DB2wYTxWVtz0WslzxYkwUjRIK1N7VBa/ivRX27YeWEsJkOkSdhyfJI0z4QsN7ZmdiGCyE7BAPYiOZF1w=","i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;\n s=arcselector10001;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;\n bh=8rbJmp/CNjeqpmgm03eyZZQyU9g1S7vKv8IYtn49mG0=;\n b=e6pivdxwTlzxpF7zSgY6HQTxk9qSTGvvUY5dfh2B+Djm4RLUXKyPf0ZUlAxmtmbEaJBuFdeZXU7SQg6K9LobNjnSqS++aUSR0e5PmQKuQt4zC8ipMEc54kMZf6HwIcd+e6wmv4FFrkyu+3BYvltlt295rOBbf4uG1XqYTQJ8cODsBLJbx6RNX/e+oebUjUxe2SO7ZuWQMZyJPdk6hX6QKR7ncKihN1ayvSgLoM63zL8f7TRT6bZgSDfVydF/eeTAFwNdtZsyPixIcPevxS1ZWGLMgSS/5lPj03I5sPmWKOe3muMZr+dBgeNQCasmmfLdc41+qIeaD8GIvbw8zTmurw=="],"ARC-Authentication-Results":["i=2; server2.sourceware.org","i=1; mx.microsoft.com 1; spf=pass\n smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com;\n dkim=pass header.d=intel.com; arc=none"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1776179093; x=1807715093;\n h=from:to:cc:subject:date:message-id:mime-version;\n bh=Tu48biIY3h01zSoFiXALFkn9FnFuIxUNp08lxsQw97g=;\n b=ROsp2H3+MVBgtOl2JvpZUVYmEQmIXrhXiQ0F/Jb+yQa4ThU6c6hPCN+u\n xh+dIQ/RXPRdtaM3hhvw/h109ESQ5uQuM73bNL8qGJK9Clwufilve/Myy\n PGhf01FT/2J7PXUgc659IcR7vh7ICS3uy3mqO3jHVoVqIaHa4UPpV+HQ4\n tlYTWw+ZX0cHqRUAETa9NgSer1PFg43U52D2ajRBcO2UcOLkvGLlZL8Ie\n yau0vudzf8CC5P4dgAEMsGoIaxRUDAYifZfnu3u/tYuS95Q8Vs3+4WZ8W\n hoqX+O9ZvAjVwB5oRon/FZEWtc2/UxGzlWzC8mZlThwDomxMN+9h0+cDS Q==;","X-CSE-ConnectionGUID":["skf+ELX/QnG3TIzCtBWgIw==","Z7Wo0alURni2RVcW1SlHSw=="],"X-CSE-MsgGUID":["9RDfgKuHSVOoft1j+ucynA==","FlesPFW4Qz6Z9FBnLxOE/A=="],"X-IronPort-AV":["E=McAfee;i=\"6800,10657,11759\"; a=\"76170912\"","E=Sophos;i=\"6.23,179,1770624000\"; d=\"scan'208,217\";a=\"76170912\"","E=Sophos;i=\"6.23,179,1770624000\";\n d=\"scan'208,217\";a=\"229090667\""],"X-ExtLoop1":"1","From":"\"Tyuleneva, Elena\" <elena.tyuleneva@intel.com>","To":"\"gcc-patches@gcc.gnu.org\" <gcc-patches@gcc.gnu.org>","CC":"\"Arutyunyan, Ruslan\" <ruslan.arutyunyan@intel.com>, \"jwakely@redhat.com\"\n <jwakely@redhat.com>, \"Dyakov, Pavel\" <pavel.dyakov@intel.com>","Subject":"[PATCH] libstdc++: Fix philox_engine counter increment carry","Thread-Topic":"[PATCH] libstdc++: Fix philox_engine counter increment carry","Thread-Index":"AdzMBRGnroNiwS6GSyyE+JMkbLHwFg==","Date":"Tue, 14 Apr 2026 15:04:40 +0000","Message-ID":"\n <DM4PR11MB82266EB089C712C94377C906EF252@DM4PR11MB8226.namprd11.prod.outlook.com>","Accept-Language":"en-US","Content-Language":"en-US","X-MS-Has-Attach":"","X-MS-TNEF-Correlator":"","authentication-results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256\n header.s=Intel header.b=ROsp2H3+;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=2620:52:6:3111::32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)","sourceware.org;\n\tdkim=pass (2048-bit key,\n unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256\n header.s=Intel header.b=ROsp2H3+","sourceware.org;\n dmarc=pass (p=none dis=none) header.from=intel.com","sourceware.org; spf=pass smtp.mailfrom=intel.com","server2.sourceware.org;\n arc=fail smtp.remote-ip=192.198.163.19","dkim=none (message not signed)\n header.d=none;dmarc=none action=none header.from=intel.com;"],"x-ms-publictraffictype":"Email","x-ms-traffictypediagnostic":"DM4PR11MB8226:EE_|DS4PPF93A1BBECD:EE_","x-ms-office365-filtering-correlation-id":"1992df9c-f4db-479b-a15d-08de9a372707","x-ms-exchange-senderadcheck":"1","x-ms-exchange-antispam-relay":"0","x-microsoft-antispam":"BCL:0;\n ARA:13230040|1800799024|376014|366016|38070700021|8096899003|56012099003|18002099003;","x-microsoft-antispam-message-info":"\n HRRJ4pCN36S9seRxN0IUY2J/rjGpkYLl3oW9haUnFFXyEudlNaUeyKVJrFQ64kFZMsIVUw+l8TyyTb+vBo+IrOcDgbkCHloYEsFDjytFOw5pHT4lM9cbikzftDXELP0oGYHaRTzWnVdtiJVD27GEwCYPAElW7H92FaeGw2COd1M1LN2a6xcgPYuzzAaX2VQXdeb1HjNXr/JWY0tEyUdhSzYG6b+Zxcab9w/PziUi+uwKImDbnaAKWd5t4yfth+mcW3z/H3WbWwyxol/PIrow5up4XwwzjjHWgJhJMC07ZMA4qg5zRtsHBpUFuYoqL5+EJTyNxnyou+FxQmXxBYXZwHAtEiT/fYVcPUzSmi3EGu6Db7VxoiWioP/n26XTUyPb08Lq9Wsm3W7Ssu9YaXRVx2pHWpP8p2bl+r56gZ/uR8PxPGweowmqNZJY2oN6PQOWvKne5ahr/yexDGBhrN5icqQgGsQzV2M/SmO1/eKQg72PTv9yuLgElx50hajWLlMIyaWZ80a7qQrT+pmU1Lqz3v85hzUDcJ4tABLAEqpGGR0ikJfov9B9nI3VKtr9+KUwniwhTGKyPUNMa48odK5k1czQiKbodHe5VERvy0jW5WjgMxtMGfHktWywNm/4Vzcsow3j0Y+CSrJW6G9FNgc2PPiVzeqnFrqgwnDZb7G2rY0skkLF+0wCIeiKSWOkggng6tQ8eQULjhxMFBsZfhhG/6RQ5+d/z2NN88YU6zTWETCGSS0BU5oa0sP+lFR2pw1LsKqzooKq9eP0U/cXIX+EU6fYphmSxj8wrNOGE2QOWYA=","x-forefront-antispam-report":"CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:;\n IPV:NLI; SFV:NSPM; H:DM4PR11MB8226.namprd11.prod.outlook.com; PTR:; CAT:NONE;\n SFS:(13230040)(1800799024)(376014)(366016)(38070700021)(8096899003)(56012099003)(18002099003);\n DIR:OUT; SFP:1101;","x-ms-exchange-antispam-messagedata-chunkcount":"1","x-ms-exchange-antispam-messagedata-0":"=?utf-8?q?V2ky9eQdsrqXqyPyG/Bb/Kvzn81R?=\n\t=?utf-8?q?j4KQxaXnQ8BAke1e6bWOKg6wSlZy0qO9I+vr4C6LT4M/+TtgiMoyp+DIzhGKPZrMh?=\n\t=?utf-8?q?WefWVu0eB6QGxNl3UQmFc2+HpXbaQVSSK12noR02CdJzqdDiLMPN7gQwBuv4226GW?=\n\t=?utf-8?q?P67PjCmIRTKp2DAklwdiZZkPtKMPZueruXFQ1ffJ3XzJBnNQPR/g3Ixh3+H1OZkfK?=\n\t=?utf-8?q?tAU10TZOJLGMM05pOuVYETeiSyy3VvTQKwblL18SabMWlWk2TLTZ3sSqGQp0WvRz+?=\n\t=?utf-8?q?XGQWnryLH29N3N/tTO0/snngI4zzWaPURoWUxEOfTW7GASP/yA5QFM1Xj1imlTI3q?=\n\t=?utf-8?q?rAUi8DdFZNg0rwhJ4CL9ekeQYWq13iq6aGvOhXyaNAPLfOl/gjJUdekjUMzfROOXt?=\n\t=?utf-8?q?ZEXQzxbiwgGrdFjMetkLAdnbgCOCt7UrRWzSSMr1tFBKhG10Bj4Wti5OkFjuTOaq9?=\n\t=?utf-8?q?7i2Xuwr4w6gqU8dJUEww+OtYUzSPrVXMWQh+WVIUSCfaWh5q5SIPezyX1gyK4mtcn?=\n\t=?utf-8?q?qgZRJ9DN0nU34/RTuq2RCiXT2tDDaVEk3vXoaXD1Cpe2RBi+/P/JgR1BmDwq3srGb?=\n\t=?utf-8?q?y21vclDzjk348j50D9X9A/5YnW2YqrcmqZMOGYxzjjLRAlnZUIx5aE6WuUlguhzvu?=\n\t=?utf-8?q?kn6q8N9rmpBzhP5F7wW3af9brE4dDoGRzTep8B3SjNbwlEjpKBcC/iiZRHedMDy1D?=\n\t=?utf-8?q?b8OHm73XpkTZ6GM+zBbdeeqCKJUwos7nV77PvoQqYcH7kV8XdYiy9KlBFnJkZ9grX?=\n\t=?utf-8?q?B/fTksnho+dS7Yq/82F8q4ziLIdbOPerhuhRdT584jPv81IMFa5b89jjRft/VL+f6?=\n\t=?utf-8?q?cF0N5dYbxeCQVY6jshvxrCzLCxyGlXCa7J8aBbIWUCZfL4lHOnmz7H1VmMloWqrXD?=\n\t=?utf-8?q?alRECDHLXqR5wSRYf60DjHD6utJCMvdyI/RasZWTm67XHBdj0o4fmanIt7IwTatt8?=\n\t=?utf-8?q?30iQgbj5LNWMSsLeJRv8izeEUbrCWZG6M6zRr5tETtHdrDrdui/awoxxXo3VXROJL?=\n\t=?utf-8?q?JvhklBKEAW02d6Pfc44Jsm6CLLmfu8uHsYYr3H5VOohyaHwi+ldNclMwPy5hSaZBN?=\n\t=?utf-8?q?vREFZKyB21Whh3EaPH7rVQkNfKzSWuXAx4k4eGR7tHbkcZlFQDBsIgO+WJFEISqx2?=\n\t=?utf-8?q?k07Tj+d5S1yXDIFoTMvyjgsShVSSTzzhsTJC7UuONoi66a4mS75dwWI+FUTgpUHbG?=\n\t=?utf-8?q?UyEqjWSHVZ+1VkT0JqKC8yAj2OCdI3djSGkV6Qllf8I57+bkBigCI5dlBZG5s/9nw?=\n\t=?utf-8?q?NpK+tExsf1RdcRXQCCWcOGypgLTivfRdIxRvpItW/7hoFP8pF6X66kOnfpN1saTOH?=\n\t=?utf-8?q?Bo4hdtn1ZSczw6tVbxtZOdEBLzqXvesVEv5fRAN/Uti7x6kb6YBuAC7KzvYqI2ncc?=\n\t=?utf-8?q?KncCjfz1zqOqbwf9OWU8xcjrj7+ThrrZEtAGK2IqYV9H56qdaR+sBXASa7OKJ+yT+?=\n\t=?utf-8?q?KiU6TkahQkLYRQwHmtS9OmILGiuiOcpm22FdvmrcZwKmwZ8QbU5bz+FsKao25ttQI?=\n\t=?utf-8?q?meSaaWc8xJ0bSiQEj9fKmWeMoOrmBDywUEnY9/P+Uo+0/NLuikPV08Uy/Zognq+iK?=\n\t=?utf-8?q?zom0K0kSLLaBBMz137WCkcdoMKUXsVht0lVAPQ+7+EsgslSiGTAU+JMie1IiYpW1+?=\n\t=?utf-8?q?oUCkekpWp5Hgohyo+hMSZ22708tWfHcA=3D=3D?=","Content-Type":"multipart/alternative;\n boundary=\"_000_DM4PR11MB82266EB089C712C94377C906EF252DM4PR11MB8226namp_\"","MIME-Version":"1.0","X-Exchange-RoutingPolicyChecked":"\n IugDB5Ewa4mfNFJT1EhX81nTBFTMva4ChoMaqtfoPNSp3nE9Fn309IsXjs7bYwUbL5JSpntnaie3hakbVRR7oTKyF8+HUg8yiFyoMWMovKmSf5r14pzsiFplr+wl4yb6+Z4GpFCHF0NNmkDms7xgaH5tA1N9v7cDnzDdIY8A659p0pXBZM3jU6uU//Oowl2g+W1zzZ/CBFfKB7a2VEWv1IFzqhUiUpqWnUuKeDl/ruS8FGko97kh1JQtIXlDVVNQaSfIL6Ylvu1dYDu6z/S93FG/RToebiXfI0XyEteoTE+yuiBYP5CWyUEbV6igD9rjWew9OIwpjLZTsU82GpufQQ==","X-MS-Exchange-CrossTenant-AuthAs":"Internal","X-MS-Exchange-CrossTenant-AuthSource":"DM4PR11MB8226.namprd11.prod.outlook.com","X-MS-Exchange-CrossTenant-Network-Message-Id":"\n 1992df9c-f4db-479b-a15d-08de9a372707","X-MS-Exchange-CrossTenant-originalarrivaltime":"14 Apr 2026 15:04:40.1663 (UTC)","X-MS-Exchange-CrossTenant-fromentityheader":"Hosted","X-MS-Exchange-CrossTenant-id":"46c98d88-e344-4ed4-8496-4ed7712e255d","X-MS-Exchange-CrossTenant-mailboxtype":"HOSTED","X-MS-Exchange-CrossTenant-userprincipalname":"\n OwHsZ4NAYJnRsQuHEPwK/2fR5zAxCCWIvdhUWEOZUUvsY0gzp0c+4xVn+xehMqlhSt9AZ23FVcBp+xsoP7CzbJMJXy5phsdZLBTzrp3dePA=","X-MS-Exchange-Transport-CrossTenantHeadersStamped":"DS4PPF93A1BBECD","X-OriginatorOrg":"intel.com","X-BeenThere":"gcc-patches@gcc.gnu.org","X-Mailman-Version":"2.1.30","Precedence":"list","List-Id":"Gcc-patches mailing list <gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>","List-Archive":"<https://gcc.gnu.org/pipermail/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-request@gcc.gnu.org?subject=help>","List-Subscribe":"<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>","Errors-To":"gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"},"content":"Hello!\n\nThe philox counter increment that happens in philox_engine::_M_transition(),\napplies +1 to _M_x[0] before the bitwise OR with (_M_x[1] << __w), so the carry\nfrom _M_x[0] is merged into the _M_x[1] portion rather\nthan being added to it. This causes the counter to cycle prematurely\nand never advance past {0, 0, 1, 2^w - 1}.\n\nFix by changing operations order, which results in forming the full-width value\nfrom _M_x[1]:_M_x[0] and then adding 1 on both the n == 4 and n == 2 paths.\n\nlibstdc++-v3/ChangeLog:\n\n    * include/bits/random.tcc (philox_engine::operator()): Fix counter\n   increment to propagate carry correctly.\n    * testsuite/26_numerics/random/philox_engine/operators/counter_carry.cc:\n    New test.\n\nSigned-off-by: ElenaTyuleneva elena.tyuleneva@intel.com<mailto:elena.tyuleneva@intel.com>\n---\nlibstdc++-v3/include/bits/random.tcc          |  8 +-\n.../philox_engine/operators/counter_carry.cc  | 83 +++++++++++++++++++\n2 files changed, 87 insertions(+), 4 deletions(-)\ncreate mode 100644 libstdc++-v3/testsuite/26_numerics/random/philox_engine/operators/counter_carry.cc\n\n--\n2.40.1\n\nThe changes were tested on x86_64-pc-linux-gnu.\n\nBest regards,\nElena\nIntel Deutschland GmbH\nRegistered Address: Dornacher Strasse 1, 85622 Feldkirchen, Germany\nTel: +49 89 991 430, www.intel.de\nManaging Directors: Harry Demas, Jeffrey Schneiderman, Yin Chong Sorrell\nChairperson of the Supervisory Board: Nicole Lau\nRegistered Seat: Munich\nCommercial Register: Amtsgericht Muenchen HRB 186928","diff":"diff --git a/libstdc++-v3/include/bits/random.tcc b/libstdc++-v3/include/bits/random.tcc\r\nindex 7a63e868a89..3380b63f355 100644\r\n--- a/libstdc++-v3/include/bits/random.tcc\r\n+++ b/libstdc++-v3/include/bits/random.tcc\r\n@@ -944,8 +944,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION\r\n       if constexpr (__n == 4)\r\n              {\r\n                __type __uh\r\n-                 = (static_cast<__type>(_M_x[1]) << __w)\r\n-                            | (static_cast<__type>(_M_x[0]) + 1);\r\n+                = ((static_cast<__type>(_M_x[1]) << __w)\r\n+                           | static_cast<__type>(_M_x[0])) + 1;\r\n                __type __lh\r\n                  = (static_cast<__type>(_M_x[3]) << __w)\r\n                             | static_cast<__type>(_M_x[2]);\r\n@@ -964,8 +964,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION\r\n       else\r\n              {\r\n                __type __num =\r\n-                              (static_cast<__type>(_M_x[1]) << __w)\r\n-                              | (static_cast<__type>(_M_x[0]) + 1);\r\n+                             ((static_cast<__type>(_M_x[1]) << __w)\r\n+                             | static_cast<__type>(_M_x[0])) + 1;\r\n                _M_x[0] = __num & max();\r\n                _M_x[1] = (__num >> __w) & max();\r\n              }\r\ndiff --git a/libstdc++-v3/testsuite/26_numerics/random/philox_engine/operators/counter_carry.cc b/libstdc++-v3/testsuite/26_numerics/random/philox_engine/operators/counter_carry.cc\r\nnew file mode 100644\r\nindex 00000000000..b1527f6a67b\r\n--- /dev/null\r\n+++ b/libstdc++-v3/testsuite/26_numerics/random/philox_engine/operators/counter_carry.cc\r\n@@ -0,0 +1,83 @@\r\n+// { dg-do run { target c++26 } }\r\n+\r\n+// N5014 29.5.4.5 Class Template philox_engine\r\n+\r\n+#include <random>\r\n+#include <array>\r\n+\r\n+#include <testsuite_hooks.h>\r\n+\r\n+// Helper: set counter, skip one block (n outputs), then compare\r\n+// the next block against a reference engine at the expected counter.\r\n+template<typename Engine, std::size_t N>\r\n+void\r\n+verify_carry(const std::array<typename Engine::result_type, N>& current_counter,\r\n+                     const std::array<typename Engine::result_type, N>& expected_incremented_counter)\r\n+{\r\n+  Engine eng_a;\r\n+  eng_a.set_counter(current_counter);\r\n+  // Skip the block produced from current_counter\r\n+  eng_a.discard(N);\r\n+\r\n+  Engine eng_b;\r\n+  eng_b.set_counter(expected_incremented_counter);\r\n+\r\n+  // Both engines should now produce identical output\r\n+  for (std::size_t i = 0; i < N; ++i)\r\n+    VERIFY( eng_a() == eng_b() );\r\n+}\r\n+\r\n+\r\n+int main()\r\n+{\r\n+  // philox4x32 (n=4, w=32)\r\n+  verify_carry<std::philox4x32, 4>(std::array<std::philox4x32::result_type, 4>{0, 0, 0, 5},\r\n+                                   std::array<std::philox4x32::result_type, 4>{0, 0, 0, 6});\r\n+  verify_carry<std::philox4x32, 4>(std::array<std::philox4x32::result_type, 4>{0, 0, 0, 0xFFFFFFFF},\r\n+                                   std::array<std::philox4x32::result_type, 4>{0, 0, 1, 0});\r\n+  verify_carry<std::philox4x32, 4>(std::array<std::philox4x32::result_type, 4>{0, 0, 1, 0xFFFFFFFF},\r\n+                                   std::array<std::philox4x32::result_type, 4>{0, 0, 2, 0});\r\n+  verify_carry<std::philox4x32, 4>(std::array<std::philox4x32::result_type, 4>{0, 0, 0xFFFFFFFF, 0xFFFFFFFF},\r\n+                                   std::array<std::philox4x32::result_type, 4>{0, 1, 0, 0});\r\n+  verify_carry<std::philox4x32, 4>(std::array<std::philox4x32::result_type, 4>{0, 1, 0xFFFFFFFF, 0xFFFFFFFF},\r\n+                                   std::array<std::philox4x32::result_type, 4>{0, 2, 0, 0});\r\n+  verify_carry<std::philox4x32, 4>(std::array<std::philox4x32::result_type, 4>{0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF},\r\n+                                   std::array<std::philox4x32::result_type, 4>{0, 0, 0, 0});\r\n+\r\n+  // philox4x64 (n=4, w=64)\r\n+  constexpr auto philox4x64_max = std::philox4x64::max();\r\n+  verify_carry<std::philox4x64, 4>(std::array<std::philox4x64::result_type, 4>{0, 0, 0, philox4x64_max},\r\n+                                   std::array<std::philox4x64::result_type, 4>{0, 0, 1, 0});\r\n+  verify_carry<std::philox4x64, 4>(std::array<std::philox4x64::result_type, 4>{0, 0, 1, philox4x64_max},\r\n+                                   std::array<std::philox4x64::result_type, 4>{0, 0, 2, 0});\r\n+  verify_carry<std::philox4x64, 4>(std::array<std::philox4x64::result_type, 4>{0, 0, philox4x64_max, philox4x64_max},\r\n+                                   std::array<std::philox4x64::result_type, 4>{0, 1, 0, 0});\r\n+  verify_carry<std::philox4x64, 4>(std::array<std::philox4x64::result_type, 4>{0, 1, philox4x64_max, philox4x64_max},\r\n+                                   std::array<std::philox4x64::result_type, 4>{0, 2, 0, 0});\r\n+  verify_carry<std::philox4x64, 4>(std::array<std::philox4x64::result_type, 4>{philox4x64_max, philox4x64_max, philox4x64_max, philox4x64_max},\r\n+                                   std::array<std::philox4x64::result_type, 4>{0, 0, 0, 0});\r\n+\r\n+  // philox2x32 (n=2, w=32)\r\n+  using philox2x32 = std::philox_engine<std::uint_fast32_t,\r\n+        32, 2, 10, 0xCD9E8D57, 0x9E3779B9>;\r\n+  verify_carry<philox2x32, 2>(std::array<philox2x32::result_type, 2>{0, 5},\r\n+                              std::array<philox2x32::result_type, 2>{0, 6});\r\n+  verify_carry<philox2x32, 2>(std::array<philox2x32::result_type, 2>{0, 0xFFFFFFFF},\r\n+                              std::array<philox2x32::result_type, 2>{1, 0});\r\n+  verify_carry<philox2x32, 2>(std::array<philox2x32::result_type, 2>{1, 0xFFFFFFFF},\r\n+                              std::array<philox2x32::result_type, 2>{2, 0});\r\n+  verify_carry<philox2x32, 2>(std::array<philox2x32::result_type, 2>{0xFFFFFFFF, 0xFFFFFFFF},\r\n+                              std::array<philox2x32::result_type, 2>{0, 0});\r\n+  // philox2x64 (n=2, w=64)\r\n+  using philox2x64 = std::philox_engine<std::uint_fast64_t,\r\n+        64, 2, 10, 0xCD9E8D57, 0x9E3779B9>;\r\n+  constexpr auto philox2x64_max = philox2x64::max();\r\n+  verify_carry<philox2x64, 2>(std::array<philox2x64::result_type, 2>{0, 5},\r\n+                              std::array<philox2x64::result_type, 2>{0, 6});\r\n+  verify_carry<philox2x64, 2>(std::array<philox2x64::result_type, 2>{0, philox2x64_max},\r\n+                              std::array<philox2x64::result_type, 2>{1, 0});\r\n+  verify_carry<philox2x64, 2>(std::array<philox2x64::result_type, 2>{1, philox2x64_max},\r\n+                              std::array<philox2x64::result_type, 2>{2, 0});\r\n+  verify_carry<philox2x64, 2>(std::array<philox2x64::result_type, 2>{philox2x64_max, philox2x64_max},\r\n+                              std::array<philox2x64::result_type, 2>{0, 0});\r\n+}\r\n","prefixes":[]}