From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com [IPv6:2607:f8b0:4864:20::52b]) by sourceware.org (Postfix) with ESMTPS id CC1043850435 for ; Fri, 24 Mar 2023 19:42:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CC1043850435 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pg1-x52b.google.com with SMTP id y35so1740166pgl.4 for ; Fri, 24 Mar 2023 12:42:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679686958; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=YZU8MFHT2sEtHN6zb1vV+67tQ+LLUrPhWyCkWIJHcXA=; b=d+35J/TNyjIlo8z68OkY4iktBAus0v6rSNOg5hZnyYXxWTe/czu2gyt8FBKfDVzOvG iLSjlmI5jxDxpSBOfduc6hJYKHEm0c2z5q1r0kolHSQx0x+iF6ADX80o0GLX3cGWtISn hQd3nW7e7flCjKmEKNwP4TWHWcHw09awAmzJa7w+mjMT0h8UsANCe1/+27RnzuZ5yW11 vBkTpuwh36C9WeKL6uzs5xEaEGH0gyFW6oOaJJcngWJhKCpf/whOxVfJZIfegrpM1fWh dptb3KOw6BvPS7YUyvnthZvJOqvh1VIO65IBkxtKwuv8TqT2ZXOee6TO56cYQ6/qaqR9 28Vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679686958; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YZU8MFHT2sEtHN6zb1vV+67tQ+LLUrPhWyCkWIJHcXA=; b=1oPfBEQjV4iiaONOHLGvJ6/5VkB5HY9FOqn+W4yb34BhQG4rbC3Gbgm3pkuVmWfNwb 4aPD96xkbdrb2CCoebYGasTKdcPdvgy/fhikhrb763o6oQV0kRPoDIB7npLmy49w5jTD SqsB0G7AhjlagBzPd8pwUcCMbsw+e21CfgSeIKG5S+EaGfFp8Xainiq6QlMBvDQLPM0D fD3pq+PLb9ScJVn/RY3AMcy5kKKPHYM75p41Nv6VY6eulmJ8j8L8KTJ4UTbia8y0AIF7 qmcKZLgBirMaJcHGqAXICuUVjUUW6LJAn+7YmF47EKwWwm7R3YprVk/lh3JVoSscB1Cg 5LYQ== X-Gm-Message-State: AAQBX9e57ZU2Hv0FN8jCz4P5LaaYuIuiZRQ//wEYiXPYm+Fwq8hqK8I5 URRwIC4SiJlxbsOw/uSZH43aX0nlJy9tS3WAuFE= X-Google-Smtp-Source: AKy350b+TTPTzXG7eELw3Mz7+wehbm0pctPd4OWcAquG+YnXuaF3hl7Dxumt1LjE2QpZI54tDIO8FF1VwuFTF5nPFgQ= X-Received: by 2002:a65:5a4a:0:b0:50f:b887:1637 with SMTP id z10-20020a655a4a000000b0050fb8871637mr983337pgs.7.1679686958353; Fri, 24 Mar 2023 12:42:38 -0700 (PDT) MIME-Version: 1.0 References: <6659A77B-DA2F-40A6-BDBD-E8B29B9E901D@oracle.com> <87384938-FDB1-487B-8B03-7787996435B2@comcast.net> <7C6B7ED7-7AA4-47EF-8E44-E3AD81BF3E29@oracle.com> <4a670847-9728-e0cb-46f3-d476839f7cd4@gmail.com> <435162cb-99b5-1204-d723-ec3800e78997@ispras.ru> In-Reply-To: From: Andrew Pinski Date: Fri, 24 Mar 2023 12:42:25 -0700 Message-ID: Subject: Re: Should -ffp-contract=off the default on GCC? To: Fangrui Song Cc: Qing Zhao , Richard Biener , Alexander Monakov , Jeff Law , gcc Patches Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.2 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Fri, Mar 24, 2023 at 1:14=E2=80=AFAM Fangrui Song via Gcc-patches wrote: > > On Wed, Mar 22, 2023 at 8:52=E2=80=AFAM Qing Zhao via Gcc-patches > wrote: > > > > > > > > > On Mar 22, 2023, at 9:57 AM, Richard Biener via Gcc-patches wrote: > > > > > > On Wed, Mar 22, 2023 at 1:26=E2=80=AFPM Alexander Monakov wrote: > > >> > > >> > > >> On Wed, 22 Mar 2023, Richard Biener wrote: > > >> > > >>> I think it's even less realistic to expect users to know the detail= s of > > >>> floating-point math. So I doubt any such sentence will be helpful > > >>> besides spreading some FUD? > > >> > > >> I think it's closer to "fundamental notions" rather than "details". = For > > >> users who bother to read the GCC manual there's a decent chance it w= ouldn't > > >> be for naught. > > >> > > >> For documentation, I was thinking > > >> > > >> Together with -fexcess-precision=3Dstandard, -ffp-contract=3Doff > > >> is necessary to ensure that rounding of intermediate results to pre= cision > > >> implied by the source code and the FLT_EVAL_METHOD macro is not > > >> omitted by the compiler. > > > > > > that sounds good to me > > > > Shall we add such clarification to our Gcc13 doc? That should be helpfu= l if we keep the currently default. > > > > Qing > > > > > >> Alexander > > > > While updating the documentation, consider adding information that > #pragma STDC FP_CONTRACT OFF is ignored with -ffp-contract=3Dfast. > > This surprising behavior motivated Clang to add > -Xclang=3D-ffp-contract=3Dfast-honor-pragmas > (https://discourse.llvm.org/t/fp-contract-fast-and-pragmas/58529). `#pragma STDC FP_CONTRACT OFF` is not even implemented yet in GCC. Rather we should document that :). It does not matter what clang does here really since GCC does not even implement the pragma. Thanks, Andrew Pinski > > > > -- > =E5=AE=8B=E6=96=B9=E7=9D=BF