Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp100675rwo; Tue, 1 Aug 2023 13:39:53 -0700 (PDT) X-Google-Smtp-Source: APBJJlGv6PlZPk+WoVskQLeaJGGsUdbNCmDz85U/zpGA9WvTaCl/QkNsgABtK99WqtuEBBbCsmWH X-Received: by 2002:a17:906:74d3:b0:957:2e48:5657 with SMTP id z19-20020a17090674d300b009572e485657mr3480250ejl.68.1690922392981; Tue, 01 Aug 2023 13:39:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690922392; cv=none; d=google.com; s=arc-20160816; b=TURL4OfXh7hli5dJdr658Vk0KSi8wD8adlunVZKp8LXKVDt43PlggxBGD4z/TjpxCF XPExeo2q3Jc2Q1xJitrTmDXf/acTBiADL09jW3pJhiVw0z/PFoTjbjvxR0hWkonDNwde WGWYnU27GvxBTTdvfEWALV0/rEsMzrvf4IneSKiNXO852D9rAmQxLVOqE7rGwrMo8ZSz vG102gcIJmkW/K9BpoortGcXbZkboxC3rfbkTKKJvC6CxrEq7qD9Z6MefZepxgdorv5U l2zTXtMlPOzYL77m75724aC6JAs2KPg8vwYpQ3QnnsVG3KaqNZBMNpAvQuYBlFhZuBMI 6C4w== 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=xB85EUEyYNgKQVCE1WlItPU56xIvZB5N93QNEp6sDIo=; fh=8NDjIHUbrqwpMBUUlgEIXn62SViOmefJsKuMy6hEJLI=; b=xYGXyP/vPOifyihaPM1fK0XJ27UTveBj18mpyRqhPY0vM77GykxLXW11uZ0GQbhPK4 9Um8F3Ex44TU3HThWEujgu8x0LTjDq1Y4yzpqDgUlMV6cJ6QxNqPCVKXtArnHyiPM1Nd y+mkzeRXY5t7oah1R0FfiT0MtEO7EpxEFYlB3ai95xbKzXh0bLzRgmDDd4SPaOMdr3Yu wzGtekVw7FInBbQTGjK6M3rQFpHlFUchsoj+TAzK0z7eWlmVaPVyFoOdqq8P/pgsasmf ktOryu2oh8PstzCtJStzYCZEyvzEOH1AZag0IWY+SBJZu2csqY5TNmoMRjxJ7rrF6kkh U1IA== 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 i9-20020a17090685c900b00988b2dfc3b3si4819356ejy.517.2023.08.01.13.39.16; Tue, 01 Aug 2023 13:39:52 -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 S229942AbjHAUPi (ORCPT + 99 others); Tue, 1 Aug 2023 16:15:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229543AbjHAUPh (ORCPT ); Tue, 1 Aug 2023 16:15:37 -0400 Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D54A2683; Tue, 1 Aug 2023 13:15:35 -0700 (PDT) Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-1b8b4749013so48229415ad.2; Tue, 01 Aug 2023 13:15:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690920935; x=1691525735; 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=xB85EUEyYNgKQVCE1WlItPU56xIvZB5N93QNEp6sDIo=; b=geDpVVZFDdfqZbkAtbfy2X67vKV3caS6dvGDKIti3r3qOYtI+8nC+ldfK2k12CNWcH 9xorTSy1bzCwfhyTDwbuuAwEneqXlxncMcHSEs1BI1qOu9huJH84O4V9LYrQUS0GMwJZ Zdt4b3lyAL9MnUPOwVJ+4r4txRAu+djO5AuWyexBrZej514PYU0b/pQ9d6UcWR3Aatu1 mIyakXsJ5Meey5euBZ4NfdYhLRxtzvSzrPXQgxVrq/lqksjlR6pTrdXihasN3aoyaaI/ cX9LE6K7Y6TX3HNMk1YBPmJSIe1i1JIOidOpZxWSoBTjiOiBpDykTk1blasFy+RvXHvH 60/Q== X-Gm-Message-State: ABy/qLaajollY2YH/5nufITH8Gg6Yrc+2sCqcMEpYUyxUDqaxReAIj5A 780Ub4QfYCFL2e2SBUeFN5E= X-Received: by 2002:a17:902:7009:b0:1bc:2bd:852a with SMTP id y9-20020a170902700900b001bc02bd852amr9131808plk.42.1690920934786; Tue, 01 Aug 2023 13:15:34 -0700 (PDT) Received: from [192.168.51.14] ([98.51.102.78]) by smtp.gmail.com with ESMTPSA id c13-20020a170902d48d00b001b558c37f91sm10825541plg.288.2023.08.01.13.15.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 01 Aug 2023 13:15:34 -0700 (PDT) Message-ID: <5f6c1dd7-982b-2214-f229-80a8ae40780d@acm.org> Date: Tue, 1 Aug 2023 13:15:32 -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> <67f2a68f-8462-e1de-c016-b84d7c6e3222@acm.org> <1f7e045a-5dc1-4667-b09d-bc74953e48b0@app.fastmail.com> From: Bart Van Assche In-Reply-To: <1f7e045a-5dc1-4667-b09d-bc74953e48b0@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_H2,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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 12:54, Arnd Bergmann wrote: > On Tue, Aug 1, 2023, at 19:51, Bart Van Assche wrote: >> On 8/1/23 07:56, Arnd Bergmann wrote: >>> On Tue, Aug 1, 2023, at 16:23, Naresh Kamboju wrote: >> >> 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? > > I played around it some more, and this apparently comes > down to constant-folding in sub-byte bitfields, so in the > older compilers neither the ==0x80 nor the !=0x80 case > can be ruled out because of a missing optimization. > Instead the generated code would try to initialize the > variable at runtime and then do a conditional branch to > the assert, but that of course fails the build. > > I'd suggest something like > > if (defined(GCC_VERSION) && GCC_VERSION < 100000) > return; > > before the assertion, in that case it doesn't evaluate it. An untested patch has been posted on the linux-scsi mailing list. It would be really appreciated if someone could help with testing that patch since none of the Linux distro's that I use regularly provides binaries for gcc-9 nor for gcc-8. Thanks, Bart.