From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 104916 invoked by alias); 14 Dec 2015 17:04:46 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 104888 invoked by uid 89); 14 Dec 2015 17:04:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-wm0-f53.google.com Received: from mail-wm0-f53.google.com (HELO mail-wm0-f53.google.com) (74.125.82.53) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 14 Dec 2015 17:04:37 +0000 Received: by wmpp66 with SMTP id p66so69111181wmp.1 for ; Mon, 14 Dec 2015 09:04:34 -0800 (PST) X-Received: by 10.194.185.6 with SMTP id ey6mr39742914wjc.42.1450112632700; Mon, 14 Dec 2015 09:03:52 -0800 (PST) Received: from [10.180.153.187] (aruba-ctlr7-nat.its.manchester.ac.uk. [130.88.99.223]) by smtp.googlemail.com with ESMTPSA id 197sm17067702wmt.19.2015.12.14.09.03.51 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 14 Dec 2015 09:03:51 -0800 (PST) Subject: Re: [PATCH] doc: discourage use of __attribute__((optimize())) in production code To: Markus Trippelsdorf , Trevor Saunders References: <20151213081911.GA320@x4> <87mvtet8t6.fsf@tassilo.jf.intel.com> <20151214161453.GA16122@tsaunders-iceball.corp.tor1.mozilla.com> <20151214164057.GD1409@x4> Cc: Richard Biener , Andi Kleen , Gerald Pfeifer , GCC Patches From: =?UTF-8?B?TWFudWVsIEzDs3Blei1JYsOhw7Fleg==?= Message-ID: <566EF674.70707@gmail.com> Date: Mon, 14 Dec 2015 17:04:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <20151214164057.GD1409@x4> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-SW-Source: 2015-12/txt/msg01418.txt.bz2 On 14/12/15 16:40, Markus Trippelsdorf wrote: > On 2015.12.14@11:20 -0500, Trevor Saunders wrote: >> On Mon, Dec 14, 2015@10:01:27AM +0100, Richard Biener wrote: >>> On Sun, Dec 13, 2015@9:03 PM, Andi Kleen wrote: >>>> Markus Trippelsdorf writes: >>>> >>>>> Many developers are still using __attribute__((optimize())) in >>>>> production code, although it quite broken. >>>> >>>> Wo reads documentation? @) If you want to discourage it better warn once >>>> @runtime. >>> >>> We're also quite heavily using it in LTO internally now. >> >> besides that does this really make sense? I suspect very few people are >> using this for the fun of it. I'd guess most usage is to disable >> optimizations to work around bugs, or maybe trying to get a very hot >> function optimized more. Either way I suspect its only used by people >> with good reason and this would just really iritate them. > > Well, if you look@bugzilla you'll find several wrong code bugs caused > by this attribute, e.g.: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59262 > > Also Richi stated in the past (I quote): > »I consider the optimize attribute code seriously broken and > unmaintained (but sometimes useful for debugging - and only that).« > > https://gcc.gnu.org/ml/gcc/2012-07/msg00201.html It is even a FAQ: https://gcc.gnu.org/wiki/FAQ#optimize_attribute_broken Cheers, Manuel.