From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id +jxsI6tojmEyYwAAWB0awg (envelope-from ) for ; Fri, 12 Nov 2021 08:14:19 -0500 Received: by simark.ca (Postfix, from userid 112) id 80E201F0C1; Fri, 12 Nov 2021 08:14:19 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_DYNAMIC, URIBL_BLOCKED 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 (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 0F0911ECEB for ; Fri, 12 Nov 2021 08:14:18 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 543913858410 for ; Fri, 12 Nov 2021 13:14:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 543913858410 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1636722857; bh=ng/y5KNoINnNKeOFRdyw46QZWc0rH8TplPqD45HsyR4=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=IUpikHLrF+qAhXBsnogjmE/XdDur0asQinDbtMYyTN6IEF5cnMV+oDjvGJL1UeXe8 o4XDFBnG4Oy1VYAEQ+COlSljS81P6heOqo57iEbuzV0iMaovTGn1MZ2NscwWArePjv vJ9Ry5eqZKL0/qE69ie14hi/Fb5B99c5RAbOczMM= Received: from mail-ua1-x92b.google.com (mail-ua1-x92b.google.com [IPv6:2607:f8b0:4864:20::92b]) by sourceware.org (Postfix) with ESMTPS id 9EBF9385840F for ; Fri, 12 Nov 2021 13:13:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9EBF9385840F Received: by mail-ua1-x92b.google.com with SMTP id v3so18595098uam.10 for ; Fri, 12 Nov 2021 05:13:01 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=ng/y5KNoINnNKeOFRdyw46QZWc0rH8TplPqD45HsyR4=; b=dYOP5H72sGHGdI1POaGFD4YUovuQ/hy/Ha9o9/JqvHvzuauggZ44s27nUOjQONm9te 1lbfZhovXXxLwCovl3qXB2k4uDH243FBh66cHIz6QDqoyBMBXh22TinkmiIdamw8sF0q xO07VKb+gGPPyQJUjcHGN6a4oNecIV5PmlPiwQtVMKvPutcWfEZSDnG3HRji8ZNRlB5P lhBn8ylE2lDwTIEkZ/RNntowoPOBooBEaQBq8ChcYoaH2IYwTSL5O2oHBQmxunnJPpdT z/lRDAswdXpm+WD68RZU7oN0T2BdCjFoo1irfykAp0+2tC/kOjcUZ2z4ufT/5v5dhYTi cl9A== X-Gm-Message-State: AOAM530JbSzwTyUB1Hd3WZ81Hn4l62rKo8RLqAAQYKkLZWlCTUrV4xXx iTPtjubwiPgFEEW/1Vh3RE9HPV4dHPlWnw== X-Google-Smtp-Source: ABdhPJwf8J8f0RPtm47uc9xb0tpRRwvqBesqlSR+DI3lpTiPb+FUsF6+YQk5oNyq06BsfANRV5857Q== X-Received: by 2002:ab0:2b13:: with SMTP id e19mr22380613uar.3.1636722781113; Fri, 12 Nov 2021 05:13:01 -0800 (PST) Received: from ?IPv6:2804:7f0:4841:487c:58e2:edbd:1f61:6a61? ([2804:7f0:4841:487c:58e2:edbd:1f61:6a61]) by smtp.gmail.com with ESMTPSA id f26sm3861600vkl.51.2021.11.12.05.12.59 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 12 Nov 2021 05:13:00 -0800 (PST) Subject: Re: [PATCH 1/6] sim: sh: rework register layout with anonymous unions & structs To: gdb-patches@sourceware.org References: <20211107003254.4298-1-vapier@gentoo.org> <68a4c7ee-700a-22f5-62ad-9257de03e9f9@linaro.org> Message-ID: <2285394c-b1fc-6a3a-6651-5475256fbabe@linaro.org> Date: Fri, 12 Nov 2021 10:12:58 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 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: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Luis Machado via Gdb-patches Reply-To: Luis Machado Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 11/11/21 7:45 PM, Mike Frysinger wrote: > On 11 Nov 2021 19:32, Luis Machado via Gdb-patches wrote: >> On 11/11/21 7:25 PM, Mike Frysinger wrote: >>> On 11 Nov 2021 09:41, Luis Machado wrote: >>>> I can't pinpoint the exact SH patch, but builds are broken for >>>> --enable-targets=all in Ubuntu 18.04 with GCC 7.5: >>> >>> pretty sure the warnings have always been there for you, we just turned >>> -Werror in more cases recently >> >> That's fine and I'm all for more -Werror. But builds should be able to >> complete regardless, right? > > they do build for me in a huge variety of configurations. but i don't test > every random distro version that people might have. plus for release, we > turn off automatic -Werror, so the issue you highlight only affects the > live development tree. it's not going to break releases that distros use. > None of us test every possible combination. It is not easy to have high coverage without some sort of CI in place. >>>> binutils-gdb/sim/sh/interp.c: In function ‘ppi_insn’: >>>> ./ppi.c:875:21: error: assuming signed overflow does not occur when >>>> assuming that (X + c) < X is always false [-Werror=strict-overflow] >>>> carry = res < Sy; >>>> ~~~~^~~~ >>>> ./ppi.c:849:21: error: assuming signed overflow does not occur when >>>> assuming that (X - c) > X is always false [-Werror=strict-overflow] >>>> carry = res > Sy; >>>> ~~~~^~~~ >>>> ./ppi.c:823:21: error: assuming signed overflow does not occur when >>>> assuming that (X + c) < X is always false [-Werror=strict-overflow] >>>> carry = res < Sx; >>>> ~~~~^~~~ >>>> ./ppi.c:797:21: error: assuming signed overflow does not occur when >>>> assuming that (X - c) > X is always false [-Werror=strict-overflow] >>>> carry = res > Sx; >>>> ~~~~^~~~ >>>> binutils-gdb-arm64-bionic/sim/../../../repos/binutils-gdb/sim/sh/interp.c: >>>> In function ‘sim_resume’: >>>> ./ppi.c:1178:28: warning: ‘res’ may be used uninitialized in this >>>> function [-Wmaybe-uninitialized] >>>> MACL = DSP_R (z) = res; >>>> ./ppi.c:44:7: note: ‘res’ was declared here >>>> int res, res_grd; >>>> ^~~ >>> >>> how exactly are you building things ? we don't enable -Wstrict-overflow. >> >> No special way. I just ./configure with --enable-targets=all and let it >> run. I can bisect it or gather a bit more information if you think it >> would be useful. > > bisect would't really help. as i said, the warnings have probably long been > there. what changed is using -Werror in more places, and that commit is easy > to pick out. > >> Worth mentioning that it doesn't run into such warnings/failures on >> Ubuntu 20.04 with gcc 9.3. > > it looks like gcc changed behavior starting in gcc-8. in older versions, > -fstrict-overflow was enabled at -O2. Since I have it handy here, let me go through it and try to come up with a fix for the ones I'm seeing.