From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS17314 8.43.84.0/22 X-Spam-Status: No, score=-3.7 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI,NICE_REPLY_A, PDS_RDNS_DYNAMIC_FP,RCVD_IN_DNSWL_MED,RDNS_DYNAMIC,SPF_HELO_PASS, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 02AB31F8C6 for ; Fri, 30 Jul 2021 17:30:59 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B0D483953CFA for ; Fri, 30 Jul 2021 17:30:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B0D483953CFA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1627666257; bh=C8aUyx6KxuiR1bFMO1ZAN+BmuqpNyNelfZ2UYfTyE3k=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=MaT/Z8yBM8kXNBMMkTTS4XFhBoeIc4D22EcLcIWW76lDNsVT4DrLWDdbaDDpdq4FY vSF2pUFxdVGBpU+DRaCRrjQkiblhyPQkUVH0vcNWF0ateJD7NLFvD8nn95ZDPsI7Dn Jb7VCc3O+PGN4WG7tLvfDbvYBFUENz+uaaPpqQws= Received: from mail-qk1-x736.google.com (mail-qk1-x736.google.com [IPv6:2607:f8b0:4864:20::736]) by sourceware.org (Postfix) with ESMTPS id DEE313953826 for ; Fri, 30 Jul 2021 17:28:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DEE313953826 Received: by mail-qk1-x736.google.com with SMTP id c9so10092608qkc.13 for ; Fri, 30 Jul 2021 10:28:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=C8aUyx6KxuiR1bFMO1ZAN+BmuqpNyNelfZ2UYfTyE3k=; b=rD7uQ8v8596BcPfevKk2vBcs0lR0zYWeAZG841cHP7el7BTCNiXKBcAKX4wa9JQHQp 1HDW/NnPQpP2QLDqCL4lCak+Hmn5+UKZCtvrrIVrcDbq/e4IQNp81JChqHQBEuEcuiZ3 C1jX5aNENkusbAQRcEwofSDJ2HVsOu8Cbs8CoO92Su1pXvmbmSKrjtIyXq3fbgXorR2L 2Y/rzZzniPZE9YKX7THE1m7I+iOz6dFdxHtWIo7y8mImWNFH8J7Z2jRsYOcerDY/qaHu jqqVN5vE7GUKTBltkfxmhYi88sW1wid+sHokxjRtZMbGbnPYyMCS388vpA3JR1pCz8MA Z9dA== X-Gm-Message-State: AOAM530yYcWxTuRQJVWobd118usxO4+byStDGV9zcZWHC3E7cTPQxLPN KjioBvxozObjLcAE3tJ3+aLAhQ8me0U= X-Google-Smtp-Source: ABdhPJxw6Mh9eMgdjOCl1sSjIuPPvNCZDaxMNBi9nb+ydEIH2JZyIkU4IxyVoJCd2VPqmVmC01vGMA== X-Received: by 2002:a05:620a:1672:: with SMTP id d18mr3306330qko.288.1627666126395; Fri, 30 Jul 2021 10:28:46 -0700 (PDT) Received: from [192.168.0.41] (75-166-102-22.hlrn.qwest.net. [75.166.102.22]) by smtp.gmail.com with ESMTPSA id d19sm1161747qkn.94.2021.07.30.10.28.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 30 Jul 2021 10:28:45 -0700 (PDT) Subject: Re: Failures building glibc with mainline GCC To: Jeff Law , Aldy Hernandez , Joseph Myers References: Message-ID: <768a6da5-9435-dc3d-9e29-57ccbd21c2a3@gmail.com> Date: Fri, 30 Jul 2021 11:28:44 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Martin Sebor via Libc-alpha Reply-To: Martin Sebor Cc: GCC Mailing List , Martin Sebor , libc-alpha@sourceware.org Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" On 7/30/21 10:45 AM, Jeff Law via Gcc wrote: > > > On 7/30/2021 10:19 AM, Aldy Hernandez via Libc-alpha wrote: >> There's a new jump threader in GCC which is much more aggressive, and >> may trigger latent problems with other warning passes, especially >> -Warray-bounds, -Woverflow, and -Wuninitialized. > [ ... ] > Ugh.  First attempt got blocked as message was slightly too big. > > I think this is pretty generic as I've seen it on multiple ports and > Joseph mentioned them as well. > > With an s390-linux-gnu (not s390x!) cross compiler you should be able to > trigger: > > bash-5.1# s390-linux-gnu-gcc -std=gnu99 -O2 -Wall -mlong-double-128 *.i > In file included from t.61.c:437: > In function 'from_t_61_single', >     inlined from 'gconv' at ../iconv/skeleton.c:568:15: > ../iconv/loop.c:440:22: warning: writing 1 byte into a region of size 0 > [-Wstringop-overflow=] > In file included from t.61.c:437: > ../iconv/loop.c: In function 'gconv': > ../iconv/loop.c:382:17: note: at offset 2 into destination object > 'bytebuf' of size 2 > > > I don't know if it's a real failure or a false positive.  I haven't even > bisected, but I suspect the new threader is the triggering change. > Ideally the threader threaded a path we hadn't previously and by some > chain of events exposed a out of bounds write that needs to be fixed. The warning is valid for the IL. Bytebuf is unsigned char[2] and in bb 25 the warning sees: [local count: 2288797]: _613 = *inptr_96; bytebuf[2] = _613; <<< -Wstringop-overflow goto ; [100.00%] GCC can't tell if the code is reachable and neither can I. As far as I can see it's the result of unrolling one if the loops in the function, likely this one: do bytebuf[inlen++] = *inptr++; while (inlen < 2 && inptr < inend); Adding: if (inlen >= 2) __builtin_unreachable (); just above it avoids the warning. Martin