Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp6045099rwb; Tue, 1 Aug 2023 11:23:47 -0700 (PDT) X-Google-Smtp-Source: APBJJlES76sUctWiTtDYdLdH08AN1djZzKRRXkfuUkU9OVJlRxIEjOcCUD0EVNZwxeZFGnicllsN X-Received: by 2002:a2e:2c0e:0:b0:2b9:bc5c:1b28 with SMTP id s14-20020a2e2c0e000000b002b9bc5c1b28mr3017483ljs.49.1690914227211; Tue, 01 Aug 2023 11:23:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690914227; cv=none; d=google.com; s=arc-20160816; b=kSg2aAHG/+n6vRsV8WgK35Nk+AMgN63GOvraWcurkSXQn1nILpCewXvGXwxYWq+EV8 CeuU7td3dR//DbwywZKSnMfBmM5AXn6Y6bXcS54C7XC17l8qdkZXpWcyFZiYs8uRTtnx Q5DUcrNk6u1UTpBnxsK9xg/Tkm0my2jq4RO8n1v47i7BF/8AXR3eoD7uYz2znTIMjwBv 0Z/kSvSf3hhqsL8H3lTC0BbQfixho7jJ1WBaajLTfuJ4EOhBu8URc01unduhb47qmjs7 SnKC6HKhr/XxtZDn/B6P+QRwpu00DOyEE5GxoK41lIpCm53SuyDoLM6moeGNAS9SVOVt XpmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=JFahkUVAa3Z9C9oggz17jW5h7WEHfUtkbLkvSnyosWQ=; fh=8NDjIHUbrqwpMBUUlgEIXn62SViOmefJsKuMy6hEJLI=; b=BF0IyTlQCC/AfkmEZOaKfS/Jj/nksZkljQiZfTGN1Vqm8qXvcXwy3r0lqF6/WIYO9C ozQykZg6CbSVZj3uV6FpQUGypfB4OKBnIyyftbn4SdW+L8xSAhxLbNipWTteKpkumx/D CYX3Jo15iaTck4y3nf79+0918+voiCOklL3xk7M7gJPPtdBlG0saMumxwDQiJeYOas8t Zxz4bxToG79QMkmyOYkmiCw9XaKC12v33tsp5WfdyMvMwCkW6oA3cFxbt6x8D1y0K5Cx biG8dmfv8tMK1Z4HQfbBzRr65fvLEyftx+0jh7hWfPkeVr5ttH0xx9GBycifHmq6372L Gm+A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=acm.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e25-20020a1709067e1900b0099bd1cb6ffbsi8565730ejr.185.2023.08.01.11.23.14; Tue, 01 Aug 2023 11:23:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=acm.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231827AbjHARv2 (ORCPT + 99 others); Tue, 1 Aug 2023 13:51:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229738AbjHARvV (ORCPT ); Tue, 1 Aug 2023 13:51:21 -0400 Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3046B213C; Tue, 1 Aug 2023 10:51:06 -0700 (PDT) Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-1bbc64f9a91so50159445ad.0; Tue, 01 Aug 2023 10:51:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690912265; x=1691517065; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=JFahkUVAa3Z9C9oggz17jW5h7WEHfUtkbLkvSnyosWQ=; b=UDTa+CU5l9qb0vcEXh/qdM+cbVNE3N58W8aiv19cNfx/hM1rhGn1OxPPvb6LH/Xga+ Re0MJDemytNiE5JhI2KfRLo6i4dsy89lrZ9Cu06o71GQD7Bf7zN/4SAAKxRqAXV1+a5c mCKglWMGTjX+YN1HLcwkF85Dpiri6p8v4Q/gdLPDdfRlKxh3fez2pDUULom/GpdLmrI1 3QX0Ym2t8a/iRz1DZiLfaEU6s11pxFEi340Rw8U2ie1RHkzzBbG8sJvr7TSWTIae0qD5 RoIbhDUFIikvGjuuKxJPEmV5+m+e3iKp7GRmxz04uVDGT4R8dICOJvfrOMP14iYGSllo GWSw== X-Gm-Message-State: ABy/qLaw/bxT0/P5OwCqTfz7sRAEgLVZ0Qvqvc5WnjxRjIFQB3Rm/QUU h4VrmdwtkvlQuzjg1wj1hwo= X-Received: by 2002:a17:902:c103:b0:1bb:809d:ae6a with SMTP id 3-20020a170902c10300b001bb809dae6amr11968955pli.7.1690912265455; Tue, 01 Aug 2023 10:51:05 -0700 (PDT) Received: from [192.168.51.14] ([98.51.102.78]) by smtp.gmail.com with ESMTPSA id f16-20020a170902ce9000b001ac6b926621sm10761570plg.292.2023.08.01.10.51.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 01 Aug 2023 10:51:04 -0700 (PDT) Message-ID: <67f2a68f-8462-e1de-c016-b84d7c6e3222@acm.org> Date: Tue, 1 Aug 2023 10:51:03 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: next: arm64: gcc-8-defconfig: ufshcd.c:10629:2: /builds/linux/include/linux/compiler_types.h:397:38: error: call to '__compiletime_assert_553' declared with attribute error: BUILD_BUG_ON failed: Content-Language: en-US To: Arnd Bergmann , Naresh Kamboju Cc: open list , linux-scsi@vger.kernel.org, linux-next , Avri Altman , "Martin K. Petersen" , Anders Roxell References: <227327a3-399a-4a9f-a775-e9627656b5a1@app.fastmail.com> From: Bart Van Assche In-Reply-To: <227327a3-399a-4a9f-a775-e9627656b5a1@app.fastmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, NICE_REPLY_A,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/1/23 07:56, Arnd Bergmann wrote: > On Tue, Aug 1, 2023, at 16:23, Naresh Kamboju wrote: >> On Tue, 1 Aug 2023 at 18:53, Bart Van Assche wrote: > >>>> - https://qa-reports.linaro.org/lkft/linux-next-master/build/next-20230801/testrun/18754886/suite/build/test/gcc-8-defconfig/log >>>> - https://qa-reports.linaro.org/lkft/linux-next-master/build/next-20230801/testrun/18754886/suite/build/test/gcc-8-defconfig/details/ >>>> - https://qa-reports.linaro.org/lkft/linux-next-master/build/next-20230801/testrun/18754886/suite/build/test/gcc-8-defconfig/history/ >>> >>> I can't reproduce this build error with a gcc-12 arm64 cross-compiler. How >>> important is gcc-8 for the ARM community? >> >> You are right, >> gcc-12 build pass. >> gcc-8 build failed. > > I can also reproduce this with gcc-9.5.0 from > https://mirrors.edge.kernel.org/pub/tools/crosstool/ but > not with 10.5.0 or clang. > > I get the same results for x86 with gcc-9.5.0. > > See https://godbolt.org/z/GjGrW9znc for a partially reduced testcase. Thanks Arnd, this is very helpful. The first error message reported for that test case is as follows: :34:286: error: call to '__compiletime_assert_655' declared with attribute error: BUILD_BUG_ON failed: ((u8 *)&(struct request_desc_header){ .enable_crypto = 1})[2] != 0x80 34 | do { __attribute__((__noreturn__)) extern void __compiletime_assert_655(void) __attribute__((__error__("BUILD_BUG_ON failed: " "((u8 *)&(struct request_desc_header){ .enable_crypto = 1})[2] != 0x80"))); if (!(!(((u8 *)&(struct request_desc_header){ .enable_crypto = 1})[2] != 0x80))) __compiletime_assert_655(); } while (0); | If I change the return type of ufshcd_check_header_layout() from void into unsigned int and insert the following at the start of that function: return ((u8 *)&(struct request_desc_header){ .enable_crypto = 1})[2] != 0x80; then the compiler shows the following in the output window: xorl %eax, %eax In other words, the expression next to the return statement evaluates to zero but the same expression does not evaluate to zero in the BUILD_BUG_ON() statement. Does this perhaps indicate a compiler bug? And if so, what is the appropriate way to fix the build error? Insert an #ifdef/#endif pair inside ufshcd_check_header_layout() such that the compile-time checks do not happen for gcc version 9 or older? Thanks, Bart.