From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.ispras.ru (mail.ispras.ru [83.149.199.84]) by sourceware.org (Postfix) with ESMTPS id 3AA90385780F for ; Tue, 3 May 2022 12:12:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3AA90385780F Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=ispras.ru Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=ispras.ru Received: from [10.10.3.121] (unknown [10.10.3.121]) by mail.ispras.ru (Postfix) with ESMTPS id DF0AD40D403D; Tue, 3 May 2022 12:12:28 +0000 (UTC) Date: Tue, 3 May 2022 15:12:28 +0300 (MSK) From: Alexander Monakov To: Paul Zimmermann cc: gcc-help@gcc.gnu.org, stephane.glondu@inria.fr, sibid@uvic.ca Subject: Re: slowdown with -std=gnu18 with respect to -std=c99 In-Reply-To: Message-ID: <603c2c46-93d3-6ec1-ef5-a592ef566ed@ispras.ru> References: <9f7e3aa9-8d46-1fbb-75b-1c8ad9a667f@ispras.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_NUMSUBJECT, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-help@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-help mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 May 2022 12:12:37 -0000 On Tue, 3 May 2022, Paul Zimmermann via Gcc-help wrote: > > I can reproduce a difference, but in my case it's simply because in -std=gnuXX > > mode (as opposed to -std=cXX) GCC enables FMA contraction, enabling the last few > > steps in the benchmarked function to use fma instead of separate mul/add > > instructions. > > but then you should get better (i.e. smaller) timings with -std=gnuXX than > with -std=cXX, instead of worse timings as we get? Right, for me -std=gnuXX is faster. But for you it's slower by almost 1.5x, that's quite a lot and should be easy to spot on 'perf report' profile. > > perf record -e instructions:P -c 500000 ./perf ... > > thank you, we'll investigate that. Good luck! I'm curious what you'll find, please let me know. Alexander