From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by sourceware.org (Postfix) with ESMTPS id A78543834E65 for ; Thu, 26 May 2022 10:13:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A78543834E65 Received: by mail-ej1-x631.google.com with SMTP id m20so2020252ejj.10 for ; Thu, 26 May 2022 03:13:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=PCQZ3brCggpuJXAVS/63Ihg/ASKtPA0hPYFXPbK20dw=; b=6ep4K+ayN4/zMMvk8XMahgoWfP7Ty/xSu2f6HWraZbzN90ih3MmNqeF3D0EsogSPn7 nS3li+NWTM5jLcvJgtnWsK8UGVTb/3FoWHud2DR3YHg2x5Ewyxf6zLeCdBQeuOiAgaM8 Y0aTs1e+7sCa0N53Q14kNd9nws5ITPeUn2K7qKwCqGc6h8eeXirSYFUwyS0CXfK5NzrK bwdHTYZdOne9kVi9zghNd9urWv7TD2d4tU7H7IpzfBYZrSH+ZO2cDncipa+SO1AYAH7M +ld6CDwxJbr6bzTgCUjVoTHg6+ggAaaqAtHMqzBraZ8AIaF41R/YQNoz1kgxpeY+FJby GybA== X-Gm-Message-State: AOAM530WYmQfvZs0Ax1pYvr+v/Xl09ioxsXQVmfoX1YDLwFvOWDCiufM yYXu45YBs3H3h2wYraUM3JMFZxgOGpBdnyN0t5w= X-Google-Smtp-Source: ABdhPJwvoEBGAXR4WjmnkpTo0D7M+r/DxIYLngrQEsmMi9y1hAKypOfW6FrakZXlUyuphlOGvTbG4XooIaBDnHglmPE= X-Received: by 2002:a17:907:8689:b0:6fe:e525:ea9c with SMTP id qa9-20020a170907868900b006fee525ea9cmr17253399ejc.720.1653560000330; Thu, 26 May 2022 03:13:20 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Tom Kacvinsky Date: Thu, 26 May 2022 06:13:09 -0400 Message-ID: Subject: Re: -march=x86_64 -mtune=generic question To: Andrew Haley Cc: gcc-help X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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: Thu, 26 May 2022 10:13:23 -0000 On Thu, May 26, 2022 at 3:12 AM Andrew Haley via Gcc-help < gcc-help@gcc.gnu.org> wrote: > On 5/25/22 19:58, Tom Kacvinsky via Gcc-help wrote: > > Does anyone have a quick rundown on what would have changed between GCC > > 8.3.0 and 12.1.0 in terms of what -mtune=generic does for optimizations? > > There was a vast amount of work done on many things, so we can't easily > say what affected you. Generally speaking GCC gets better release to > release, > but bear in mind that compiler optimizations are often based on heuristics. > That is to say, they make code better on average, but sometimes they might > make things worse. If your degradation is slight overall, there might be an > actual regression in the compiler, but chances are you just got unlucky. > I did have an idea of diffing the gcc/config/i386 folder between the 8.3 and 12.1 release tags, but that gave a _lot_ of stuff about support for AVX512. A colleague of mine reminded me of this thread: slowdown with -std=gnu18 with respect to -std=c99 So I checked what the default C standard for GCC 8.3.0 is (gnu11) and 12.1.0 (gnu17). So I used -std=c99 with the GCC 12.1 build of our code, and things went back to normal (and sometimes a teensy bit better). For what it's worth, the performance issue was death by a thousand cuts - there was no glaring hotspot, and least by looking at callgrind output. Tom