Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.1/patches/2226052/?format=api
{ "id": 2226052, "url": "http://patchwork.ozlabs.org/api/1.1/patches/2226052/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/or5x5jttgd.fsf_-_@lxoliva.fsfla.org/", "project": { "id": 17, "url": "http://patchwork.ozlabs.org/api/1.1/projects/17/?format=api", "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 }, "msgid": "<or5x5jttgd.fsf_-_@lxoliva.fsfla.org>", "date": "2026-04-22T06:11:46", "name": "[v2] libstdc++: follow std in numeric_limits<bool>::traps and integral traps", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "0f40ca2098967a692edc4e85418bf96754bcb6ee", "submitter": { "id": 74937, "url": "http://patchwork.ozlabs.org/api/1.1/people/74937/?format=api", "name": "Alexandre Oliva", "email": "oliva@adacore.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/gcc/patch/or5x5jttgd.fsf_-_@lxoliva.fsfla.org/mbox/", "series": [ { "id": 500924, "url": "http://patchwork.ozlabs.org/api/1.1/series/500924/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=500924", "date": "2026-04-22T06:11:46", "name": "[v2] libstdc++: follow std in numeric_limits<bool>::traps and integral traps", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/500924/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2226052/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2226052/checks/", "tags": {}, "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 secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256\n header.s=google header.b=Mvmi8ge2;\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 secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256\n header.s=google header.b=Mvmi8ge2", "sourceware.org; dmarc=pass (p=quarantine dis=none)\n header.from=adacore.com", "sourceware.org; spf=pass smtp.mailfrom=adacore.com", "server2.sourceware.org;\n arc=none smtp.remote-ip=74.125.82.169" ], "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 4g0pmh64RNz1yCv\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 16:12:51 +1000 (AEST)", "from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 7DEBE4BA900F\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 06:12:49 +0000 (GMT)", "from mail-dy1-f169.google.com (mail-dy1-f169.google.com\n [74.125.82.169])\n by sourceware.org (Postfix) with ESMTPS id 7AB924BA900F\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 06:12:06 +0000 (GMT)", "by mail-dy1-f169.google.com with SMTP id\n 5a478bee46e88-2de831d2b20so1031814eec.1\n for <gcc-patches@gcc.gnu.org>; Tue, 21 Apr 2026 23:12:06 -0700 (PDT)", "from free.home ([2804:14c:4d1:41a6::2000])\n by smtp.gmail.com with ESMTPSA id\n 5a478bee46e88-2e53d2cff04sm21098015eec.23.2026.04.21.23.12.03\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Tue, 21 Apr 2026 23:12:04 -0700 (PDT)", "from livre (livre.home [172.31.160.2])\n by free.home (8.15.2/8.15.2) with ESMTPS id 63M6BkR7032133\n (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT);\n Wed, 22 Apr 2026 03:11:47 -0300" ], "DKIM-Filter": [ "OpenDKIM Filter v2.11.0 sourceware.org 7DEBE4BA900F", "OpenDKIM Filter v2.11.0 sourceware.org 7AB924BA900F" ], "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org 7AB924BA900F", "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org 7AB924BA900F", "ARC-Seal": "i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776838326; cv=none;\n b=KH9kHi/S3NUz/+vzYdAR9+EIcQLy74sOael1D0FV7n2whRX62ehZm0F4BWt4XkK7+4/12/42oxllaS/v0S32/iiizoc62MGOO8gHQfepSpFWcIWYf9gtscAgJSABmqQr+0vhRpZdfLOX63r4C8k805imKsKS7e/GpX/edzfUqYM=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776838326; c=relaxed/simple;\n bh=sw5+sxFpHpm68WoNZiqA7rlyz9IeO/oS0iOHAl3djMw=;\n h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version;\n b=Vqin+B7zoBQ/bAt1hUrrJP4IXcSh5KQYuHyAgWZ2KlPm94K5q7JvLL9iIBpybysnvnVAvhQwrAQzpaksAI3yJoNdxK4TIFKPZccCA1NE0T+orzHftybZ4E8ZuDvRjRZnIFHchNfe3YNCsGjMR/2YomaRia1CEPfVgsiD9FcGj48=", "ARC-Authentication-Results": "i=1; server2.sourceware.org", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=adacore.com; s=google; t=1776838325; x=1777443125; darn=gcc.gnu.org;\n h=mime-version:user-agent:message-id:in-reply-to:date:references\n :organization:subject:cc:to:from:from:to:cc:subject:date:message-id\n :reply-to; bh=1iLCnV4Ulik9r3Q28TEowrhdPCj7GB9UZjwWHr+6BQU=;\n b=Mvmi8ge2ltDhhYMi3DPEbyjIU8CVenW1rw6Wtcy3dA8lkZ2p3B1cO7bzQ8k6HfEaMv\n hE1bSvflPRIStwaXFsHvycvet9B8mVVoREv/eJ0IyuOQc8iCvOMU4DEG/yUHqUm9hwjo\n +bJEGGB+k7zQdCsxYK05yFOhAetnvu2xajdTncwwxW+RcJ110fD7QCxQQ62qhKxLx+02\n ssaom6NJBfJkJAlwHrKiuRcmN/4RpWw71NvzA5GtwRnrDxT4/qlMupyrrOe9qUXkuhKF\n DqghXwhBG1Y+WK8aHTi4ui2vf4LJleLFZpVJgq9zl5K/Al3UW8UhuFODqLT+7EfHgowC\n uqzQ==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1776838325; x=1777443125;\n h=mime-version:user-agent:message-id:in-reply-to:date:references\n :organization:subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to\n :cc:subject:date:message-id:reply-to;\n bh=1iLCnV4Ulik9r3Q28TEowrhdPCj7GB9UZjwWHr+6BQU=;\n b=aqAZdtWv5BkqaCuNC5XF21Mm71icUcJkg8kyD5Bq0QJlYWbR/d5webdUERVk/r6jnZ\n CWtH2ovjYb97incjrQQ7jrvrvM5IiwEsXNqqXUlxmkp6SAFL5SDidjcdvGLm7po+RHrp\n q2dBD+bem0IE4psxzGBnr0KCT/VkghJf8jlPzYXBOxtf1muM+khbSKoKh6imPsj5VHZ9\n AWJcA85jnSjQVBKHj2hhl0tvDrnogZ6eMMGsJfxmq5uBAdBv6qymz/9wvAg9THqtQQpi\n m6MgLwm6ss+P59Hf98GkOmSWl/4fKEO5XUq0GYG1XvYrGcGn+2rLcIPhhqn/qc/fwm3e\n zpHw==", "X-Gm-Message-State": "AOJu0YyaaZ0zICfP8AF8QvHBdgc8LjAXhpTDWg232fPHvgM+B54+xtDl\n fbLosiMNWorIFHWmBiMX7XtHU4uyy0b5jgUHg1laIaYfzp7QX+uH2ADltsJHY+Ebjg==", "X-Gm-Gg": "AeBDievnVkanQLhnsSuUyqVWIQydaF1vM1aDQS8Bb91h4qzCnxFpbk1UXHw69xIaJAI\n i4EAlh01Vfqq/kr2DYhafIj/1C/r/V5k4ETIjgFJJV30XcBXtvAiNytzmeJS4fmskhEgx4r2J8r\n xECz7u0CI3YjSYm/hl9G3kqbH6GotrbXmtnHBaeTnKLKDtdiZ2Nr9TbH9JFZhaxX2yn41fHOb/l\n VHCiYVv4drIj2XHVNHF2VVOeKPOqWy0mbOfJedCjcR4Uv8CLjP7+BaQlUCrdjPaQFna3pica/X1\n 7UTpUr165Su86MvwRbSsRAT85FbtwbD1BABymRD1nqMdoTS/n/OpWntTpXH6Ujp+zrP4xTcCkZS\n teFVLzoUMTXfAKOJFkH2mwJDPY+bf1nMGa8ofbM6iZAY2uM4dtJirX1KISgX17r/QQA/gb0g8ng\n ccN8DFV/pcCA==", "X-Received": "by 2002:a05:7301:1305:b0:2e5:8ec2:82c9 with SMTP id\n 5a478bee46e88-2e58ec28773mr8658638eec.26.1776838324963;\n Tue, 21 Apr 2026 23:12:04 -0700 (PDT)", "From": "Alexandre Oliva <oliva@adacore.com>", "To": "Jonathan Wakely <jwakely@redhat.com>", "Cc": "gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org", "Subject": "[PATCH v2] libstdc++: follow std in numeric_limits<bool>::traps and\n integral traps", "Organization": "Free thinker, does not speak for AdaCore", "References": "<oro6jr10tw.fsf@lxoliva.fsfla.org>\n <CACb0b4nsiE_9CxUczx8=iHgsDgo-_-uE2P8Z8aiPMTQgu1RpZg@mail.gmail.com>\n <or4il4vrsy.fsf_-_@lxoliva.fsfla.org>\n <CACb0b4kL84SsEQ+Ho1OVVPRRYVHc1PRK7gps-OwDbGTC_Cr4qg@mail.gmail.com>", "Date": "Wed, 22 Apr 2026 03:11:46 -0300", "In-Reply-To": "\n <CACb0b4kL84SsEQ+Ho1OVVPRRYVHc1PRK7gps-OwDbGTC_Cr4qg@mail.gmail.com>\n (Jonathan Wakely's message of \"Tue, 21 Apr 2026 09:42:12 +0100\")", "Message-ID": "<or5x5jttgd.fsf_-_@lxoliva.fsfla.org>", "User-Agent": "Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)", "MIME-Version": "1.0", "Content-Type": "text/plain", "X-Scanned-By": "MIMEDefang 2.84", "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": "On Apr 21, 2026, Jonathan Wakely <jwakely@redhat.com> wrote:\n\n> This is strictly speaking an ABI change for most targets, but I doubt\n> anybody cares about numeric_limits<integral-type>::traps. I hope\n> nobody is depending on it for anything.\n\n> Anybody who needs the old behaviour can compile with\n> -D__glibcxx_integral_traps=1 if they really need it, so I think this\n> is OK to fix ion stage 1.\n\nGiven the ABI change argument, I decided to revert the bool\nspecialization to use the macro, so that -D__glibcxx_integral_traps=1\nfully restores the earlier ABI properties.\n\n>> (should the otherwise-effectively-empty cpu_defines.h headers be deleted\n>> altogether?)\n\n> I had to look into that, but it looks like we don't bother having an\n> empty cpu_defines.h, and just use the default generic/cpu_defines.h\n> file. So I think yes, they should be removed.\n\nACK\n\n> I don't think we need such a detailed comment here (especially not\n> referring to non-bool specializations).\n\n> We already have this comment above the whole explicit specialization,\n> which justifies why it's there and what all its values are:\n\n> // _GLIBCXX_RESOLVE_LIB_DEFECTS\n> // 184. numeric_limits<bool> wording problems\n\n> So I would just remove the comment on traps entirely.\n\nFair enough. I tweaked the opening comment, and dropped the one next to\nthe specialization. Here's what I've just regstrapped on\nx86_64-linux-gnu and powerpc64le-linux-gnu. Ok for stage1?\n\n\nThere's a comment from 2002 suggesting that\nnumeric_limits<bool>::traps was in a DR, but C++ standards including\n11, 17 and 23 explicitly set it to false, presumably in response to\nissue 184.\n\nIssue 554 clarifies that traps is about values that may trap, rather\nthan operations that may trap, so we were wrong in the interpretation\nabout divide-by-zero operations' trapping on integral types that led\nto __glibcxx_integral_traps's defaulting to true, and some of its\noverrides.\n\nAlign numeric_limits<bool>::traps with the standard, default\n__glibcxx_integral_traps to false, drop the overriders based on the\nincorrect interpretation, but keep __glibcxx_integral_traps to allow\ncommand-line restoring of this ABI fix, and for the admittedly\nunlikely case of trapping integral values' coming to exist on some\narchitecture.\n\n\nfor libstdc++-v3/ChangeLog\n\n\t* include/std/limits (__glibcxx_integral_traps): Set to\n\tfalse. Update comments.\n\t(numeric_limits<bool>::traps): Drop comments.\n\t* config/cpu/arm/cpu_defines.h: Remove.\n\t* config/cpu/powerpc/cpu_defines.h: Likewise.\n\t* configure.host (cpu_defines_dir): Adjust.\n---\n libstdc++-v3/config/cpu/arm/cpu_defines.h | 40 -------------------------\n libstdc++-v3/config/cpu/powerpc/cpu_defines.h | 36 -----------------------\n libstdc++-v3/configure.host | 6 ----\n libstdc++-v3/include/std/limits | 14 +++++----\n 4 files changed, 8 insertions(+), 88 deletions(-)\n delete mode 100644 libstdc++-v3/config/cpu/arm/cpu_defines.h\n delete mode 100644 libstdc++-v3/config/cpu/powerpc/cpu_defines.h", "diff": "diff --git a/libstdc++-v3/config/cpu/arm/cpu_defines.h b/libstdc++-v3/config/cpu/arm/cpu_defines.h\ndeleted file mode 100644\nindex 57e4cbbe0136b..0000000000000\n--- a/libstdc++-v3/config/cpu/arm/cpu_defines.h\n+++ /dev/null\n@@ -1,40 +0,0 @@\n-// Specific definitions for generic platforms -*- C++ -*-\n-\n-// Copyright (C) 2015-2026 Free Software Foundation, Inc.\n-//\n-// This file is part of the GNU ISO C++ Library. This library is free\n-// software; you can redistribute it and/or modify it under the\n-// terms of the GNU General Public License as published by the\n-// Free Software Foundation; either version 3, or (at your option)\n-// any later version.\n-\n-// This library is distributed in the hope that it will be useful,\n-// but WITHOUT ANY WARRANTY; without even the implied warranty of\n-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n-// GNU General Public License for more details.\n-\n-// Under Section 7 of GPL version 3, you are granted additional\n-// permissions described in the GCC Runtime Library Exception, version\n-// 3.1, as published by the Free Software Foundation.\n-\n-// You should have received a copy of the GNU General Public License and\n-// a copy of the GCC Runtime Library Exception along with this program;\n-// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see\n-// <http://www.gnu.org/licenses/>.\n-\n-/** @file bits/cpu_defines.h\n- * This is an internal header file, included by other library headers.\n- * Do not attempt to use it directly. @headername{iosfwd}\n- */\n-\n-#ifndef _GLIBCXX_CPU_DEFINES\n-#define _GLIBCXX_CPU_DEFINES 1\n-\n-// Integer divide instructions don't trap on ARM.\n-#ifdef __ARM_ARCH_EXT_IDIV__\n-#define __glibcxx_integral_traps false\n-#else\n-#define __glibcxx_integral_traps true\n-#endif\n-\n-#endif\ndiff --git a/libstdc++-v3/config/cpu/powerpc/cpu_defines.h b/libstdc++-v3/config/cpu/powerpc/cpu_defines.h\ndeleted file mode 100644\nindex f4248e0f602a3..0000000000000\n--- a/libstdc++-v3/config/cpu/powerpc/cpu_defines.h\n+++ /dev/null\n@@ -1,36 +0,0 @@\n-// Specific definitions for generic platforms -*- C++ -*-\n-\n-// Copyright (C) 2005-2026 Free Software Foundation, Inc.\n-//\n-// This file is part of the GNU ISO C++ Library. This library is free\n-// software; you can redistribute it and/or modify it under the\n-// terms of the GNU General Public License as published by the\n-// Free Software Foundation; either version 3, or (at your option)\n-// any later version.\n-\n-// This library is distributed in the hope that it will be useful,\n-// but WITHOUT ANY WARRANTY; without even the implied warranty of\n-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n-// GNU General Public License for more details.\n-\n-// Under Section 7 of GPL version 3, you are granted additional\n-// permissions described in the GCC Runtime Library Exception, version\n-// 3.1, as published by the Free Software Foundation.\n-\n-// You should have received a copy of the GNU General Public License and\n-// a copy of the GCC Runtime Library Exception along with this program;\n-// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see\n-// <http://www.gnu.org/licenses/>.\n-\n-/** @file bits/cpu_defines.h\n- * This is an internal header file, included by other library headers.\n- * Do not attempt to use it directly. @headername{iosfwd}\n- */\n-\n-#ifndef _GLIBCXX_CPU_DEFINES\n-#define _GLIBCXX_CPU_DEFINES 1\n-\n-// Integer divide instructions don't trap on PowerPC.\n-#define __glibcxx_integral_traps false\n-\n-#endif\ndiff --git a/libstdc++-v3/configure.host b/libstdc++-v3/configure.host\nindex ff97216167dec..e52a32bb4c682 100644\n--- a/libstdc++-v3/configure.host\n+++ b/libstdc++-v3/configure.host\n@@ -150,15 +150,9 @@ case \"${host_cpu}\" in\n amdgcn)\n cpu_defines_dir=cpu/gcn\n ;;\n- arm*)\n- cpu_defines_dir=cpu/arm\n- ;;\n nvptx)\n cpu_defines_dir=cpu/nvptx\n ;;\n- powerpc* | rs6000)\n- cpu_defines_dir=cpu/powerpc\n- ;;\n esac\n \n \ndiff --git a/libstdc++-v3/include/std/limits b/libstdc++-v3/include/std/limits\nindex f0ba2851a0a2e..cfdbe02c844c2 100644\n--- a/libstdc++-v3/include/std/limits\n+++ b/libstdc++-v3/include/std/limits\n@@ -81,10 +81,15 @@\n // The default values are appropriate for many 32-bit targets.\n \n // GCC only intrinsically supports modulo integral types. The only remaining\n-// integral exceptional values is division by zero. Only targets that do not\n-// signal division by zero in some \"hard to ignore\" way should use false.\n+// integral exceptional values is division by zero, but that's an operation,\n+// not a value, and traps is about values that trap (Issue554), so there aren't\n+// any for integral types. The standard has numeric_limits<bool>::traps\n+// explicitly set to false. However, we used to set them all to true based on\n+// the division-by-zero misinterpretation, so we retain this macro, and those\n+// who relied on the misinterpretation can restore it with a command-line\n+// define and revert the ABI-changing effects of this fix.\n #ifndef __glibcxx_integral_traps\n-# define __glibcxx_integral_traps true\n+# define __glibcxx_integral_traps false\n #endif\n \n // float\n@@ -446,9 +451,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION\n static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true;\n static _GLIBCXX_USE_CONSTEXPR bool is_modulo = false;\n \n- // It is not clear what it means for a boolean type to trap.\n- // This is a DR on the LWG issue list. Here, I use integer\n- // promotion semantics.\n static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps;\n static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false;\n static _GLIBCXX_USE_CONSTEXPR float_round_style round_style\n", "prefixes": [ "v2" ] }