Attached patch fixes PR libfortran/21376 (library called log10 with argument equal to zero). Simple reworking of logic to avoid that. Regtesting in progress on i686-linux. OK for 4.0 and mainline? FX