From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com [IPv6:2a00:1450:4864:20::232]) by sourceware.org (Postfix) with ESMTPS id 2A8143857C55 for ; Mon, 17 Jul 2023 12:00:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2A8143857C55 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lj1-x232.google.com with SMTP id 38308e7fff4ca-2b70bfc8db5so64761871fa.2 for ; Mon, 17 Jul 2023 05:00:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689595241; x=1692187241; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=1PAwKVqmP4aIJZuikaXomT/qvvJW9tad93vi2noVw7M=; b=hgGRsuRPL3yryvpP7PMADLJx58dn0konXLDNHSfOoZxuqjsjaRClVbfZb1PL9M/VsZ AJXwqw12RzmQKWwuI0qudiev/IMMFAeDkUHEYgzYRfgNiDPY/KLYu5qtySWfgm1w6tKi L8GTvqkqD4UNJ53n4mjcQqNRBv0a6VIrfKFU1UkUg6wWnJadYmgb9NFIXYAB86Lx8Dgj /UMcxScZoA7IKkqdAWO8g7BV3TAbh+pDg7KXz5ZzU0wRTpE1r9DKPZwWufv+zPy0BmKy oVxxxyIczSxZyZ9HsaDLUmzmPI8lthp8UT1fN72PNeR9nssWQ4WzjcW9KtVumfYVOKpZ pibg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689595241; x=1692187241; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1PAwKVqmP4aIJZuikaXomT/qvvJW9tad93vi2noVw7M=; b=j0OzMUilh/pkttingZok3dh13kAx3lggrdwnX7aesPMPURLkRPODElsXuwmiJvMTTk yLj8nuLLaPKILHDL5a76BS4Apfp+QSMzmX/9foxjwOFdsLWXPGNZKH407Zr8RpiFm2Qy ivVWhTbDaavDnMooVhjHo7mShbQMRM9ca9PlbmmmBuR8YJ9AA3h1Hok87+u3llS++9+P UV1dWZZdQU/aHHr4NrcwdFJ4PJkM613Mu8J07Nq9TYd5Ic8P+0NTuhn0miUHSINoidUp 5GAdhC2l9g5SKOW2uVgbFPnmiuP3mi0ct0lfjvYTyZ4hBGe9UjVxU+nHGG2YWQDU9r6n MhJA== X-Gm-Message-State: ABy/qLZcxfVzb+ZrP+MJGp0kkBC9Ic7sCsRZhAUjliXpkoGcfYzk84Ez Wz3xUDxaRVI3mNfrC/GmvdNpvgIof9WBBekd4pE= X-Google-Smtp-Source: APBJJlG48gxOGX8DD9Qi2e2+9RzSMgCAFgRrq1kxJ0iT8Ti7caJ5VtMo726s6Js9Z6lqr4W1Exj+NwNzreVetVkn8WQ= X-Received: by 2002:a2e:96d8:0:b0:2b6:cad9:75ba with SMTP id d24-20020a2e96d8000000b002b6cad975bamr8173440ljj.29.1689595241252; Mon, 17 Jul 2023 05:00:41 -0700 (PDT) MIME-Version: 1.0 References: <001201d9b684$e319fdd0$a94df970$@nextmovesoftware.com> In-Reply-To: From: Richard Biener Date: Mon, 17 Jul 2023 14:00:10 +0200 Message-ID: Subject: Re: [PATCH] Fix bootstrap failure (with g++ 4.8.5) in tree-if-conv.cc. To: Tamar Christina , Alexander Monakov Cc: Andrew Pinski , Roger Sayle , "gcc-patches@gcc.gnu.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Mon, Jul 17, 2023 at 9:35=E2=80=AFAM Tamar Christina wrote: > > > On Mon, Jul 17, 2023 at 12:21=E2=80=AFAM Tamar Christina via Gcc-patche= s > patches@gcc.gnu.org> wrote: > > > > > > > -----Original Message----- > > > > From: Richard Biener > > > > Sent: Monday, July 17, 2023 7:19 AM > > > > To: Roger Sayle > > > > Cc: gcc-patches@gcc.gnu.org; Tamar Christina > > > > > > > > Subject: Re: [PATCH] Fix bootstrap failure (with g++ 4.8.5) in tree= -if- > > conv.cc. > > > > > > > > On Fri, Jul 14, 2023 at 8:56=E2=80=AFPM Roger Sayle > > > > > > > > wrote: > > > > > > > > > > > > > > > > > > > > This patch fixes the bootstrap failure I'm seeing using gcc 4.8.5 > > > > > as > > > > > > > > > > the host compiler. Ok for mainline? [I might be missing > > > > > something] > > > > > > > > OK. Btw, while I didn't spot this during review I would appreciat= e > > > > if the code could use vec.[q]sort, this should work with a lambda a= s > > > > well I think. > > > > > > That was my first use, but that hits > > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99469 > > > > That is not hitting PR 99469 but rather it means your comparison is not > > correct for an (unstable) sort. > > That is qsort comparator should have this relationship `f(a,b) =3D=3D != f(b, a)` and > > `f(a,a)` should also return false. > > I'm using the standard std::pair comparator which indicates that f(a,a) i= s true, > https://en.cppreference.com/w/cpp/utility/pair/operator_cmp > > > If you are running into this for qsort here, you will most likely run i= nto issues > > with std::sort later on too. > > Don't see why or how. It needs to have a consistent relationship which st= d::pair > maintains. So why would using the standard tuple comparator with a stand= ard > std::sort cause problem? At least for return left.second < right.second; f(a,a) doesn't hold. Note qsort can end up comparing an element to itself (not sure if GCCs implementation now can). Richard. > Thanks, > Tamar > > > > > Thanks, > > Andrew > > > > > > > > Regards, > > > Tamar