https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97017
Bug ID: 97017 Summary: The function determine_precision is called twice for each formatted real write Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: libfortran Assignee: unassigned at gcc dot gnu.org Reporter: jvdelisle at charter dot net Target Milestone: --- I discovered this while working on the EX formattting feature. The determine_precision function is called by both get_precision and inside the macro FORMAT_FLOAT used by get_float_string. To me this implies we have something factored wrong as we should not have to call it twice to get things done. (a small performance issue as well as obscure) A simple test case will show the issue in a debugger: ! pr93727 EX Format Specifiers program main implicit none real(4) :: r4 real(8) :: r8 r4 = 3.14158_4 r8 = 12.3456789_8 print *, r4, r8 end program main