Received: by 10.213.65.68 with SMTP id h4csp110699imn; Thu, 5 Apr 2018 19:03:38 -0700 (PDT) X-Google-Smtp-Source: AIpwx48LscL2IuRZsmSJoYr+H+2F9HPXi+HMsg+uj4CnHhTHC5TI6R+cUMvUzCf2U9tVr7vAcTDd X-Received: by 10.99.169.1 with SMTP id u1mr16824696pge.251.1522980218553; Thu, 05 Apr 2018 19:03:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522980218; cv=none; d=google.com; s=arc-20160816; b=CEsVx9xSkD/QilKnalNCFs13uHQ9384Tj5c7FcXiSV386BrD5x7UPmHC7+LEaTkPde GItbwUeXka7oDXdqSPKlkoNIVJ6RCLoF0gaYHBmqKElSI6smxHz/ukafzmqtCeUx1jXe 8+aBlupNjnR8Wt2kxJbKPZJZK79WKgq1guASJy6VBVi9jFj9YQIjn+uw5NKzmNs2zX0W bqGJ63G+bEdWDmWVoS6jUgWl5RtqMOOTfclmI0jrvYjDxeOwPMAsXVTtUyDZ9zv4OUTX /QLptMFYfqWvMUOv1OVoyydM7opncLj6Z13YVXSywReT9Suw+IzWVymnEDe4BftaRDgs 6ZMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature:dkim-signature :arc-authentication-results; bh=yAl4rglx8dTmYw7DcbIdDWqpNJEh38FEHK9gfXjapss=; b=tL2ZRiTP+a2TTm9ukZlA1lOLwAtLa2++ZatiBl1+S+FZeaILrdkXTAHuBTLZAwd1xR L/n84UQgUFH5K4YN5RXOhTDA1pi0kLj47h9tWBcdt4SChpG8SQXPIqaSCNNoZCuvhjC6 wg0U4qOUabhYF90B77VGmxlodlMc0gLQlwD7CEdynSaewrTJnXWevIuiqcZWi5Rwwd1H kAKWtkIMF4kvGzoDyKMjZMYKCVLostIHzyHnPMvuawXCLTiMU/QuLUp8qiQK4VOCNJVE EH4d8IKtxFpSVX3BvKQ1q0ZDtkOvLP7I8dV9QYxPSXFjlIOLwDFKeerK5g4sFA/dbZf3 UOpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=D9TsvD//; dkim=fail header.i=@linux-foundation.org header.s=google header.b=ekTq7vjs; 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 u188si7203792pfb.220.2018.04.05.19.03.25; Thu, 05 Apr 2018 19:03:38 -0700 (PDT) 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; dkim=fail header.i=@gmail.com header.s=20161025 header.b=D9TsvD//; dkim=fail header.i=@linux-foundation.org header.s=google header.b=ekTq7vjs; 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 S1751445AbeDFCCT (ORCPT + 99 others); Thu, 5 Apr 2018 22:02:19 -0400 Received: from mail-io0-f182.google.com ([209.85.223.182]:38325 "EHLO mail-io0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751315AbeDFCCO (ORCPT ); Thu, 5 Apr 2018 22:02:14 -0400 Received: by mail-io0-f182.google.com with SMTP id b20so32901897iof.5 for ; Thu, 05 Apr 2018 19:02:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=yAl4rglx8dTmYw7DcbIdDWqpNJEh38FEHK9gfXjapss=; b=D9TsvD//TjJnpp780/Ni91ohlP7Wg6jF6qZ5Ez/rBFTjL+mY7aD7SqHgKkA2SWgvkT jH5tjFfDccQC0CejN8ouSY/XS0E7e1hWTwAehHsubK5PVdbmBzomJm/MgqN4+wAJlSPs +SUTAaJwc8YXol0hLPRFfZBR0GaNeQy6JfQuvIZ0Mcfi4YGYgzOjt1SE00t8Z4XVGVMC ICuhUG/O2lwE4MQYBah/S36TsNya5lhLgoGeLMz+7vJw1oi3rOf9QOJr2Epl/4h4XYT+ yDY/cCNkeMDtZpFGvWj199DJ+/B2h943Hx3HjrXEQOX36mIBzxqzzrr4c5NBxl8jpOLD NIpg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=yAl4rglx8dTmYw7DcbIdDWqpNJEh38FEHK9gfXjapss=; b=ekTq7vjsTtU+pPXEh4SRbxjFm+e6lcLnZE1fWBV1N9hFWbdEualUiSnaShRfy/fLz4 jRx8QJQoPCPjaQtXrElc6Gr5TkgTDKhb0HfohU3xH2MsKhQAGMTzoCLkuu7L+IP7nw5O g5I39I6xyeKMCzrE5P3+Eby6Yj5g0WxmfPZPw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=yAl4rglx8dTmYw7DcbIdDWqpNJEh38FEHK9gfXjapss=; b=LDdXN4vgpHUlHyjussm3MyiunfG4pkK6d9Q+Rs2yBE9FKtetier+Mbq1SRA+LSqi+N ULc8vnm2SDU0n/kqv6F4L8a2XDI80gtmOv3hqPPg26fO0Sn11vYamOKX/MZYXX20JmZf cDItdK6QtcTjL3DpeXnwmghziVBB2utmvz5nRrsvqDrz6H2uBQvD2VfNRCx6QHMWN+Ag QUe7/+xymWjsioq5bf6ccOUx0nyFwxnvgexvanemYhVtZHLKnAg4dRBZ0K/0JIXrjkj/ HQaWcnWwWld+5UOA9ktK54WJUX/IbqBlWTzQt6UjsaGflq+EVFwx2xM6VfFpcaDwcArD fH5A== X-Gm-Message-State: ALQs6tA1lb1nhcfAZ+7hAnBtIqKxhL7yb8L5ovgXH/pgqD+t4Bgtkpkq eURjnzDyqn0HDf5+sR93lElWPntU/P1JanpjsKM= X-Received: by 10.107.164.13 with SMTP id n13mr23796253ioe.238.1522980132233; Thu, 05 Apr 2018 19:02:12 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.95.15 with HTTP; Thu, 5 Apr 2018 19:02:11 -0700 (PDT) In-Reply-To: References: <20180404093007.GI4082@hirez.programming.kicks-ass.net> <20180404191724.GF87376@google.com> <20180404205848.GG87376@google.com> <20180404214639.GH87376@google.com> <20180404221744.GI87376@google.com> <20180404233111.GJ87376@google.com> <20180405072017.GN4043@hirez.programming.kicks-ass.net> From: Linus Torvalds Date: Thu, 5 Apr 2018 19:02:11 -0700 X-Google-Sender-Auth: FZnb6-Ufv1f04fPimS6ueA5EXtM Message-ID: Subject: Re: [GIT PULL] x86/build changes for v4.17 To: James Y Knight Cc: Peter Zijlstra , Matthias Kaehlcke , Arnd Bergmann , Ingo Molnar , Linux Kernel Mailing List , Thomas Gleixner , Andrew Morton , Chandler Carruth , Stephen Hines , Nick Desaulniers , Kees Cook , Guenter Roeck , Greg Hackmann , Greg Kroah-Hartman Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 5, 2018 at 3:51 PM, James Y Knight wrote: > > Unfortunately, that behavior is required by the standard, it's not up to > compiler optimization to change. I actually mis-read your example - in your case it obviously does pass the array itself down to the call, and yes, it obviously needs to be allocated. I had a test-case at one point where gcc avoided the stack allocation entirely for a regular array, but not for a VLA (of the same constant size) because the VLA logic is apparently different enough - even when the size of the array is a compile-time constant. We had that issue because we had a lot of trouble coming up with a "max()" macro that was still an I-C-E (and we had a number of array sizes that used "max()"). So all the array sizes were compile-time constants, they just weren't traditional C arrays. But now I can't recreate the thing. Maybe I had screwed up in my test-case somehow. Linus