https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93948
Bug ID: 93948
Summary: Surprising option processing of -fdec and -fdec-math
in combination with -std
Product: gcc
Version: 9.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: thenlich at gcc dot gnu.org
Target Milestone: ---
It is surprising that the -std option leads to the -fdec-math option to be
silently ignored, while the -fdec option is honoured.
This makes it hard to enforce standard-compliant code while allowing only the
small subset of the DEC math extensions.
For example
====
program dec1
print "(g0)", sind(0.)
end program
====
$ gf10 -std=f2008 dec1.f90 && ./a.exe
cco91hFa.o:dec1.f90:(.text+0x57): undefined reference to `sind_'
$ gf10 -std=f2008 -fdec dec1.f90 && ./a.exe
0.00000000
$ gf10 -std=f2008 -fdec-math dec1.f90 && ./a.exe
cc6E3irl.o:dec1.f90:(.text+0x57): undefined reference to `sind_'
collect2.exe: error: ld returned 1 exit status
$ gf10 -fdec-math dec1.f90 && ./a.exe
0.00000000