From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by sourceware.org (Postfix) with ESMTPS id 5CD383858C5E for ; Thu, 2 Feb 2023 23:38:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5CD383858C5E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=rivosinc.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=rivosinc.com Received: by mail-pl1-x62b.google.com with SMTP id m2so3569737plg.4 for ; Thu, 02 Feb 2023 15:38:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:subject:from:cc:to:content-language :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=+hCEgtmFk1Ypr4CdA0XGIKl5A11GS2IvGu/aEZ+mN5g=; b=2m2ENbRI7Jdg6aYsJj2H7pojYjjsQMCUx2eQ0UffvYQ60dj0FvCNXhsO5NAWgYF7cK /wpDeVvVfKUYlzTX7djHURd/SF7Oa925PpOIQHGpn48gIuJfALC8KxGUX1bcZrSC8NvI ssbbelc5rvgSEJR3QhkUWzodtJqOKhPR0/RKvKQDBvLXh7C8T4xfJs8aQMKqcnBB96Hy 1CLcwpTWIOTEWeOFAP5aun7Q9DzgNpm7f8Uneh44UrAoOIgzOL5ic2twExr8qDbGCAFs vLXvBCbP0MSt2IeNw2n8S94e6mU0FFrUdkxNC6tJy9zCqS6rKzXzBLCxQA8ne+UFnAuI tY8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:subject:from:cc:to:content-language :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=+hCEgtmFk1Ypr4CdA0XGIKl5A11GS2IvGu/aEZ+mN5g=; b=P/hGoVp1kst7kGF9/zz/0wK5VqQ9fJq4F1tUzjVIdChyloAn8yMwcKdBpRPAOMzb7s K8MuXakJPlqpL2Kumo6C3CsNiKTSi0ZSFVRgGApOVaAlCfBLdPauy2bP6JMEhKcG9JNV zhSiTQWKzKTq+IdKv0PBGy25Ljicjvmo1Q/qC8QJcpNAt3/mPt6sJ96ORk9aCJcxGqFk namoaD1SJzAr1N4mwMMigrVomrQpqvw0ypTF8CcNvrC+d5DdrNWrvye1GaeCYQfef063 OjsJ4oSfyOdBZQaAiMALq6nnAj7/Ln1R5RKFb/nsPs0+vi+iwP8wlveFwz/TSPn1sr9+ OBfA== X-Gm-Message-State: AO0yUKVk+fzE3z+o2FUYt+6c6Z4iF6h6F24oQIIeN4uelP4saO+8vhPT HtJLeyqwoGUzQsnKTr3GhKQ5BNFWiR2kGhiK X-Google-Smtp-Source: AK7set8lXjwEzWRMpyy0fPiqNblLJ5xydNojr6UKklZZxD2Lg2B6SL4jEQN4FQI7xxL8KojSb/eGQg== X-Received: by 2002:a17:902:cec6:b0:198:adc4:2287 with SMTP id d6-20020a170902cec600b00198adc42287mr4033341plg.2.1675381087110; Thu, 02 Feb 2023 15:38:07 -0800 (PST) Received: from [10.0.17.151] ([50.221.140.188]) by smtp.gmail.com with ESMTPSA id s7-20020a170902988700b00180033438a0sm223668plp.106.2023.02.02.15.38.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 02 Feb 2023 15:38:06 -0800 (PST) Message-ID: <78f4bcde-74ac-428f-99fe-a6193c52362e@rivosinc.com> Date: Thu, 2 Feb 2023 15:38:05 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 X-Mozilla-News-Host: news://news.gmane.io:119 Content-Language: en-US To: gcc@gcc.gnu.org Cc: Aldy Hernandez , Jeff Law , Philipp Tomsich , gnu-toolchain From: Vineet Gupta Subject: -Ofast/-ffast-math and SPEC 511.pov miscompilation with gcc 13.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no 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've noticed SPEC 2017, 511.pov failing for RV64 on bleeding edge gcc. This is with -Ofast -march=rv64gcv_zba_zbb_zbc_zbs. Problem also happens with -O3 -ffast-math (and goes away with fast-math removed) I've bisected it to b7fd7fb50111 ("frange: drop endpoints to min/max representable numbers for -ffinite-math-only") With that commit evrp is eliding a bunch of if conditions as they pertain to inf (in code snippet below, it elides code corresponding to lines 1401-1418 with line 1417 being elided causing the failure). I think I know the answer, but  just wanted to confirm if that is the intended behavior given -Ofast / -ffast-math Thx, -Vineet |New->Angle = __builtin_huge_val(); ||||switch(New->Type) ||{ ||... ||1246: if(Parse_Camera_Mods(New) == false) ||EXIT ||... ||} ||||1401: if (New->Up[X] == ||||__builtin_huge_val|()|) { ... } 1417: if (New->Angle != |||__builtin_huge_val|()) ||{ ||1419: if ((New->Type == PERSPECTIVE_CAMERA) |||