(Note: This issue came up in considering the Fortran testsuite, but I
think it's sufficiently relevant to GCC as a whole (and I'm hoping for
some comments from people familiar with the non-Fortran parts of GCC
that it seemed reasonable to crosspost it.)
I've been recently poking at some bugs in Fortran's intrinsics
(specifically, ISHFTC and IBCLR and the like), and one of the tricky
bits is that there are two entirely separate code paths to consider --
there's the GMP-based one in gcc/fortran/simplify.c that does
constant-folding, and there's the native-code one in libgfortran that
does the runtime work.
However, as best I can tell, the relevant testcases completely ignore
this issue, and thus end up only testing the constant-folding case.
This strikes me as likely to be an endemic problem in the Fortran
testsuite, and I would guess that substantial portions of libgfortran
are not actually tested by "make check-fortran".
I think that this is probably a significant enough issue that it would
be worth implementing an option in the Fortran front end to turn off
the majority (or even all) of the constant folding, and then adding a
testsuite pass that uses this option. Is there a relevant flag already
present in GCC, or would we need to add one? Thoughts on this proposal?