From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3B010C433EF for ; Wed, 6 Apr 2022 14:22:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234513AbiDFOYb (ORCPT ); Wed, 6 Apr 2022 10:24:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234763AbiDFOWa (ORCPT ); Wed, 6 Apr 2022 10:22:30 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id BE72B394A26 for ; Wed, 6 Apr 2022 03:28:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1649240880; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Gl9lzH2B8iXtNv+PmQrHe3XVaVHAWUpzZOHHKPgN0ss=; b=VaBpmafL9zuYSLXgpCGVMAarQxVgXuxFsGTxV72RCIC+/xjY+TnQoi+AQqgRBbBUs6QL/l VabBkA2YwJKCsaaSrvoZrqiP+ncw+Pxi+EuPulEu80wMGvUZEsPVk4+gtCBo8a7DfKqCd4 PEu6spljAmUi0ICeHNy4jF9yYqwUy/Q= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-595-GKo8ae7zNg6o77SSGIC75Q-1; Wed, 06 Apr 2022 06:13:33 -0400 X-MC-Unique: GKo8ae7zNg6o77SSGIC75Q-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 976FC1C068E6; Wed, 6 Apr 2022 10:13:32 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.195.172]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5743540316C; Wed, 6 Apr 2022 10:13:32 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.16.1/8.16.1) with ESMTPS id 236ADTpr1580645 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Wed, 6 Apr 2022 12:13:29 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.16.1/8.16.1/Submit) id 236ADSnS1580644; Wed, 6 Apr 2022 12:13:28 +0200 Date: Wed, 6 Apr 2022 12:13:27 +0200 From: Jakub Jelinek To: Peter Zijlstra Cc: Borislav Petkov , linux-toolchains@vger.kernel.org, Michael Matz , Richard Biener , lkml Subject: Re: older gccs and case labels producing integer constants Message-ID: Reply-To: Jakub Jelinek References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 Precedence: bulk List-ID: X-Mailing-List: linux-toolchains@vger.kernel.org On Tue, Apr 05, 2022 at 02:23:31PM +0200, Peter Zijlstra wrote: > On Tue, Apr 05, 2022 at 11:50:35AM +0200, Borislav Petkov wrote: > > Hi folks, > > > > I'm starting to see failures like this on allmodconfig builds: > > > > sound/usb/midi.c: In function ‘snd_usbmidi_out_endpoint_create’: > > sound/usb/midi.c:1389:2: error: case label does not reduce to an integer constant > > case (((0xfc08) << 16) | (0x0101)): > > ^~~~ > > > > (The case statement is a macro but it evaluates to what I have there) > > > > and that thing fails with > > > > $ gcc --version > > gcc (SUSE Linux) 7.5.0 > > > > although it doesn't have any problems building with newer compilers. > > > > I'm presuming older gccs consider those case statements signed ints and > > the following fixes it: > > > > case ((((unsigned int)0xfc08) << 16) | (0x0101)): > > > > and I guess we can whack the couple of occurrences but what I'm > > wondering is why does this work with newer gccs? > > IIRC GCC-8 fixed a bunch of -wrapv issues. Could be this is one of them > I suppose. If we are talking about -fsanitize=shift -fwrapv, then that is https://gcc.gnu.org/PR68418 , i.e. it was fixed already for GCC 6. Jakub