Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp2937839imb; Mon, 4 Mar 2019 18:59:27 -0800 (PST) X-Google-Smtp-Source: APXvYqzVB/fHPyWLufsFJ5tdGJ0uf2VyVaIRggNkWr1sIAtZmsoUHPEDTHM17QGMcczQf9Fj5RVG X-Received: by 2002:a63:2d5:: with SMTP id 204mr21088381pgc.407.1551754767286; Mon, 04 Mar 2019 18:59:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551754767; cv=none; d=google.com; s=arc-20160816; b=dd06MPsHSfuibI8PrBP5EWUNnwMYiGl4coN78dBceLVHSfGIZ6pWH3G47RY8U6bT5h C5xu2PILTfA148ioq9He501ec/auneeN2ylZa8bKLYNAGMBLBfF46fciXsay5O54pt3C bw7bawkKGkgZ6Ypz9zXcLCo5v0PMmh1yE/SZmHAbIth8ZJAWslsbVTlckaEXueNEGq1u A3NSMc8fUlerx0Q6poZyIsSmyKliIgHX07R8YPQ3R2+38CpESeiWkgxG9GBDQVy6RSri S9UVwHUNKPW4SuHk1QdaN3YzfcnafQC6QvxosvOnNMHcSrPHVCPZLARbdeWehzI56HPB TZpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:message-id :in-reply-to:subject:cc:to:from:date; bh=/GfGPwtEwllFshD5ZhJcasQQl8qbLvfwR59pn9UR4qM=; b=XW/WrEB9nZE9U0klY3jPmT8XnDpFiSuFRnFETPBZx0r9fUvOZFJG0JN83Wf1T6Cvjf z44Ohfuh/IzkwrQQJAHY84Fh4Wm4JTfXVr88gpsPD0sGAUlYsaNm3P4OjZoPoNeZey0h GvOz10DcpkHuPFyzTQ/Myn9+kMvuapzgIuHBhNlguFOTiVJJ/VtTokdHJr3IoluJnBxu wtiJeyeY+CbwK3prni7oWwAz3GxuLlhsCU2+xGn1iMY6sSgSt4mb1pATfF4ZgvxBwwfv ce2kDLqcuWYA7Q610dHvY4265zH14vvk9X3hCbBBv9zF2cqTOiyqKjHESKQifhwEYIma tB1Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y14si6873527pll.378.2019.03.04.18.59.11; Mon, 04 Mar 2019 18:59:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726920AbfCEC6u (ORCPT + 99 others); Mon, 4 Mar 2019 21:58:50 -0500 Received: from kvm5.telegraphics.com.au ([98.124.60.144]:44984 "EHLO kvm5.telegraphics.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726522AbfCEC6t (ORCPT ); Mon, 4 Mar 2019 21:58:49 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by kvm5.telegraphics.com.au (Postfix) with ESMTP id 945A529D6B; Mon, 4 Mar 2019 21:58:47 -0500 (EST) Date: Tue, 5 Mar 2019 13:59:03 +1100 (AEDT) From: Finn Thain To: Geert Uytterhoeven cc: kbuild test robot , kbuild-all@01.org, linux-m68k , Arnd Bergmann , Linux Kernel Mailing List Subject: Re: [m68k:master 1174/1174] arch/m68k/include/asm/string.h:72:25: warning: '__builtin_memcpy' forming offset 8 is out of the bounds [0, 7] In-Reply-To: Message-ID: References: <201903042049.npxcZzps%fengguang.wu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 5 Mar 2019, Finn Thain wrote: > > Looks bogus to me. > > If you change memcpy to __builtin_memcpy, then we avoid the macro and the > warning changes to, > > ./include/linux/string.h:456:3: warning: '__builtin_memcpy' forming offset [7, 8] is out of the bounds [0, 6] [-Warray-bounds] > __builtin_memcpy(dest, src, dest_len); > > The compiler has nothing to complain about here. dest is known to be > id->fr and dest_len is known to be sizeof(id->fr). > > The error message indicates that gcc has applied the bounds [0, 6] to dest > when in fact those are the bounds for src. > My mistake. GCC is right, it seems memcpy will read past the end of "5.0.0+". --