From owner-svn-src-stable@freebsd.org Sun Feb 11 10:26:59 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58415F09A86; Sun, 11 Feb 2018 10:26:59 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EABCD7120B; Sun, 11 Feb 2018 10:26:58 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.128.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 0D7492605ED; Sun, 11 Feb 2018 11:26:56 +0100 (CET) Subject: Re: svn commit: r328973 - in stable/11: include sys/sys To: Antoine Brodin Cc: src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org, re References: <201802071506.w17F6s5l043163@repo.freebsd.org> From: Hans Petter Selasky Message-ID: Date: Sun, 11 Feb 2018 11:24:02 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Feb 2018 10:26:59 -0000 On 02/11/18 11:09, Antoine Brodin wrote: > On Sun, Feb 11, 2018 at 8:01 AM, Antoine Brodin wrote: >> On Wed, Feb 7, 2018 at 4:06 PM, Hans Petter Selasky >> wrote: >>> Author: hselasky >>> Date: Wed Feb 7 15:06:54 2018 >>> New Revision: 328973 >>> URL: https://svnweb.freebsd.org/changeset/base/328973 >>> >>> Log: >>> MFC r328237: >>> Use the __alloc_size2 attribute where relevant. >>> >>> This follows the documented use in GCC. It is basically only relevant for >>> calloc(3), reallocarray(3) and mallocarray(9). >>> >>> NOTE: Without this change clang 5.0.1 can produce incorrect optimisation >>> code for static processing of data using the allocated object. For example >>> this has been seen compiling the mlx4 core module, which allocates a >>> fixed size array which is then sorted by a fixed order loop. The >>> optimised result, -O2, is incorrect unless this patch is in place. >>> >>> Suggested by: Mark Millard >>> Reference: https://docs.freebsd.org/cgi/mid.cgi?9DE674C6-EAA3-4E8A-906F-446E74D82FC4 >>> >>> Modified: >>> stable/11/include/stdlib.h >>> stable/11/sys/sys/malloc.h >>> Directory Properties: >>> stable/11/ (props changed) >> >> Hi, >> >> Please revert this change. Lots of ports that used to build fine on >> stable/11 are now failing. >> /usr/include/stdlib.h:93:7: error: expected function body after >> function declarator >> __alloc_size2(1, 2); > Hi Antoine, I'm sorry for the inconvenience. Probably I should have sent this patch for portmgr first, to avoid such breakage. This patch is required also for ports, and it is good you are now rebuilding ports which use this define, because they might be broken due to the fact the __alloc_size2() was incorrectly implemented! I hope this will be the end of the breakage: https://svnweb.freebsd.org/changeset/base/329122 Else I will revert both patches and have you test them first. --HPS > Something like this may be needed on stable/11: > > Index: 11/sys/sys/cdefs.h > =================================================================== > --- 11/sys/sys/cdefs.h (revision 329121) > +++ 11/sys/sys/cdefs.h (working copy) > @@ -213,6 +213,7 @@ > #define __aligned(x) > #define __alloc_align(x) > #define __alloc_size(x) > +#define __alloc_size2(n, x) > #define __section(x) > #define __weak_symbol > #else > > Antoine > >