From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) by sourceware.org (Postfix) with ESMTPS id CB6B83858D32 for ; Sat, 1 Apr 2023 22:29:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CB6B83858D32 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-pf1-x42d.google.com with SMTP id cm5so11099089pfb.0 for ; Sat, 01 Apr 2023 15:29:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680388169; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=g7n0Rt6OpRvxUp75gtYnq4rLebu619zAPyJQh1ZgUcc=; b=U6+b0sd/RYFNBMP7eovphOqvhQzABWiJQA4cCLRoUBy+bgt17TAyidUiDIqL1d/tNV j/lU00UKxJRZs/LQY+6SGN0BSe+e4wtCpwGnLW0OvH9jaNMGjVQsWQ3Y1WOzC0npZ8sF EgZNaXoPjHWlEJayZ/kI3SzNpFAD3p7OZNvqxs5X0EwOXanfvpS+9FXzJpv8cNlabLMg mUBMrfklZWFTenDSzRHYAnmNVLw7g7hNVbpazqw2psij3/Iq4v4qAhYmqMMjXez2/NzZ UdEvmYYV8VTpJRXRNfAVDuNHRHiBDLgy54iB8Z2wFL0OqKRsCdd+zs2OhUfEnaioSzd4 7mqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680388169; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=g7n0Rt6OpRvxUp75gtYnq4rLebu619zAPyJQh1ZgUcc=; b=XWI8N1Ry6aLw3SBGObXfOijJGowCHVWSEYvm9DIuwf6z6pLfnpkr75WAP1Xou/L4zx gdrkTEsnbYnWLIT6r60/iaHNd2nDjiP3RZ0HqEzdwkx6TUHK+jk2DtLMw9/nwt/z26OK aQZVvZgaEHuRlt/LYzu4eHlucCcxOABkhvo4F6K6FdapJl+k/YZZQbNoclaoPKImpoU9 Z42Tu+Rz2h6eB+CsPGHS7Lhfgn5KtwI47YiyfEovwW2LVqoAmU15YZtnB4A6Pej9iqS7 lPf+9ATSOs6EtdqmXs5ctpJ7f7OAgBX3eL8Jy8cZpves57hBz3RlfhPYh8+Lz+8mTdNI VbpQ== X-Gm-Message-State: AAQBX9eqVFYO+8O1kfeUe0T3U/uAVageEYC8OThEgU7vwN8hsfwA6bcz jPRzuFskeQhLzLWs4Y1Y63SNTEaGCZVLRy/7kZQOyZajz/LQzA== X-Google-Smtp-Source: AKy350ZeATZF9mU+YkG40TOxKxYFI852Jrxe0rAI2NTHVY7npyFYAUkAHvZxSFUlVQmzn+y4Sba6mm7y4yERxKzZQs8= X-Received: by 2002:a63:d80a:0:b0:513:98d5:5ba with SMTP id b10-20020a63d80a000000b0051398d505bamr3235681pgh.7.1680388169413; Sat, 01 Apr 2023 15:29:29 -0700 (PDT) MIME-Version: 1.0 From: Andrew Pinski Date: Sat, 1 Apr 2023 15:29:17 -0700 Message-ID: Subject: MIN/MAX and trapping math and NANs To: GCC Mailing List , Richard Guenther Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,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: Hi, I noticed while working on phi-opt, that MIN/MAX EXPR (and the corresponding RTL codes) both can return true for trapping even if NANs are not honored (that is -ffinite-math-only). Is this true? I would have assumed when -ffinite-math-only -fno-signed-zeros is used, then MIN/MAX would be the same as a > b ? a : b which would not cause a trap. If we think they should not trap, then I will create a patch and test it for GCC 14. Thanks, Andrew Pinski