From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by sourceware.org (Postfix) with ESMTPS id 984573858C20 for ; Thu, 2 Feb 2023 23:43:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 984573858C20 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-x635.google.com with SMTP id jh15so3564234plb.8 for ; Thu, 02 Feb 2023 15:43:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=1/K58yX2JZ3JJw72MipHrSp3CE/YchLopMF5f9+D5Ok=; b=iMMwgYJ1XbVUyh5cmZbjBzQjVlQHDW0pN0nvSPIAqHwEqhpi4uWnMBumL+qeg6YsUK jT+xB7MfmhdFn14VCoxbQaE7z9ySWT9zjYhE5oqxuET8tuH7DeiX42dunt/lWIT5QRmV MdicffGa4YvpkYmpKKeg8oTUH7whRxiSjpm8QR+rkRjxjjLkSl06jWRRtHjvNVOcEzyE BgJ++j9DakkqBof6kCtrhOxrz62jKSSor+K4q89jD9PjQIiaEUhdtZ4GfQQSSat/TfNw apLQVxvEO4JEo/RPEc8B7K8EW7OatG7SnaBLNueFWn7qBtuZzfXYva975sfzn+rMOft5 5A4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=1/K58yX2JZ3JJw72MipHrSp3CE/YchLopMF5f9+D5Ok=; b=gdyUUdezK7tBqbXiRIWPJt1trSQFh1Jm9zIZKCeHCtPnmWW1jinBphx0/I/h1yNQ8a M+EMmVDmD1IRSitQh65qLc2Dug0otX8XkaKhsmwcUwvAE2khSK0Zq92odQo+0P4BoGaV bnHE6qiG1xTtsL9CCwpdDPxRDV8qNdnUGZvKv+jMc04A8dltl0AThXB8+oxkNPAewP1Q X6z4jfqdN/IhKgKYx4LfJ5DwdXbC0tqeFeG3Ku8Vtq/2HQCwEBdvzrtpGaNTWTrX30dz fzcRdbmwCbTvjQIM8iescpPp8g+GeL5k93AG4Ns3UmdLomzn53B3/RNnafma43t0cMS/ poMA== X-Gm-Message-State: AO0yUKXCnj64uSfqxwLk75PHF1x6PqAs2+kJIDaAxlCRQwF/9DuM99pS oZqVKWaXhFzCW7WRxjIAnCY3nLvVsaTMKSQ4 X-Google-Smtp-Source: AK7set/fSR9+xrOcUoJSLAnIWnaHBc+Y9bDCNW+7w5g3MU5zr3/kMPPJdXKwojdYaEdf87kW6L74gw== X-Received: by 2002:a17:902:e54d:b0:194:a602:13c8 with SMTP id n13-20020a170902e54d00b00194a60213c8mr11179091plf.52.1675381399408; Thu, 02 Feb 2023 15:43:19 -0800 (PST) Received: from [10.0.17.151] ([50.221.140.188]) by smtp.gmail.com with ESMTPSA id f4-20020a170902e98400b00189393ab02csm228122plb.99.2023.02.02.15.43.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 02 Feb 2023 15:43:19 -0800 (PST) Message-ID: <1e1f1d89-3f9e-8b98-6e82-0c6c43994ad5@rivosinc.com> Date: Thu, 2 Feb 2023 15:43:18 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: -Ofast/-ffast-math and SPEC 511.pov miscompilation with gcc 13.0 Content-Language: en-US From: Vineet Gupta To: gcc@gcc.gnu.org Cc: Aldy Hernandez , Jeff Law , Philipp Tomsich , gnu-toolchain References: <78f4bcde-74ac-428f-99fe-a6193c52362e@rivosinc.com> In-Reply-To: <78f4bcde-74ac-428f-99fe-a6193c52362e@rivosinc.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,KAM_NUMSUBJECT,NICE_REPLY_A,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: On 2/2/23 15:38, Vineet Gupta wrote: > 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 Apologies, mailer munged the code snippet     New->Angle = __builtin_huge_val(); ...    switch(New->Type)    { ... 1246:    if(Parse_Camera_Mods(New) == false)                       EXIT ...     } 1401:   if (New->Up != __builtin_huge_val())             { ...             } 1417:   if (New->Angle != __builtin_huge_val())             { 1419:       if ((New->Type == PERSPECTIVE_CAMERA) || ||