pgfortran's SHAPE returns garbage non-default integer

The program below, compiled with pgfortran 17.10, gives unexpected results like “140449725546497”.

print *, shape([0],8)
end

Hello,

This was replicated and logged as TPR 24934.

A Workaround is to add -Msave

% pgfortran -o shape shape.f90 -Msave
% shape
1


dave