public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* -Ofast/-ffast-math and SPEC 511.pov miscompilation with gcc 13.0
@ 2023-02-02 23:38 Vineet Gupta
  2023-02-02 23:43 ` Vineet Gupta
  2023-02-03  7:36 ` Richard Biener
  0 siblings, 2 replies; 5+ messages in thread
From: Vineet Gupta @ 2023-02-02 23:38 UTC (permalink / raw)
  To: gcc; +Cc: Aldy Hernandez, Jeff Law, Philipp Tomsich, gnu-toolchain

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) |||

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: -Ofast/-ffast-math and SPEC 511.pov miscompilation with gcc 13.0
  2023-02-02 23:38 -Ofast/-ffast-math and SPEC 511.pov miscompilation with gcc 13.0 Vineet Gupta
@ 2023-02-02 23:43 ` Vineet Gupta
  2023-02-03  7:36 ` Richard Biener
  1 sibling, 0 replies; 5+ messages in thread
From: Vineet Gupta @ 2023-02-02 23:43 UTC (permalink / raw)
  To: gcc; +Cc: Aldy Hernandez, Jeff Law, Philipp Tomsich, gnu-toolchain



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) ||
||

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: -Ofast/-ffast-math and SPEC 511.pov miscompilation with gcc 13.0
  2023-02-02 23:38 -Ofast/-ffast-math and SPEC 511.pov miscompilation with gcc 13.0 Vineet Gupta
  2023-02-02 23:43 ` Vineet Gupta
@ 2023-02-03  7:36 ` Richard Biener
  2023-02-03 18:47   ` Vineet Gupta
  1 sibling, 1 reply; 5+ messages in thread
From: Richard Biener @ 2023-02-03  7:36 UTC (permalink / raw)
  To: Vineet Gupta
  Cc: gcc, Aldy Hernandez, Jeff Law, Philipp Tomsich, gnu-toolchain

On Fri, Feb 3, 2023 at 12:39 AM Vineet Gupta <vineetg@rivosinc.com> 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

It's the intended behavior of -ffinite-math-only which is part of
-Ofast / -ffast-math.  There's a CLOSED INVALID bug in bugzilla
about the povray failure as well.

Richard.

> 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) |||

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: -Ofast/-ffast-math and SPEC 511.pov miscompilation with gcc 13.0
  2023-02-03  7:36 ` Richard Biener
@ 2023-02-03 18:47   ` Vineet Gupta
  2023-02-03 18:59     ` Richard Biener
  0 siblings, 1 reply; 5+ messages in thread
From: Vineet Gupta @ 2023-02-03 18:47 UTC (permalink / raw)
  To: Richard Biener
  Cc: gcc, Aldy Hernandez, Jeff Law, Philipp Tomsich, gnu-toolchain


On 2/2/23 23:36, Richard Biener wrote:
> There's a CLOSED INVALID bug in bugzilla
> about the povray failure as well.

Thx for the pointer ! For the record it is
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107021

 > The question is what to do with 511.povray_r as we want to support 
SPECs with -Ofast.

I'm curious about Martin's comment above.
So SPEC -Ofast is just not supported anymore unless -fno-finite-math-only

-Vineet


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: -Ofast/-ffast-math and SPEC 511.pov miscompilation with gcc 13.0
  2023-02-03 18:47   ` Vineet Gupta
@ 2023-02-03 18:59     ` Richard Biener
  0 siblings, 0 replies; 5+ messages in thread
From: Richard Biener @ 2023-02-03 18:59 UTC (permalink / raw)
  To: Vineet Gupta
  Cc: gcc, Aldy Hernandez, Jeff Law, Philipp Tomsich, gnu-toolchain



> Am 03.02.2023 um 19:47 schrieb Vineet Gupta <vineetg@rivosinc.com>:
> 
> 
>> On 2/2/23 23:36, Richard Biener wrote:
>> There's a CLOSED INVALID bug in bugzilla
>> about the povray failure as well.
> 
> Thx for the pointer ! For the record it is
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107021
> 
> > The question is what to do with 511.povray_r as we want to support SPECs with -Ofast.
> 
> I'm curious about Martin's comment above.
> So SPEC -Ofast is just not supported anymore unless -fno-finite-math-only

Well, that’s the fact right now.  It’s unfortunate but the povray case is difficult to single out.

Richard 

> -Vineet
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-02-03 19:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-02 23:38 -Ofast/-ffast-math and SPEC 511.pov miscompilation with gcc 13.0 Vineet Gupta
2023-02-02 23:43 ` Vineet Gupta
2023-02-03  7:36 ` Richard Biener
2023-02-03 18:47   ` Vineet Gupta
2023-02-03 18:59     ` Richard Biener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).