Dear all, after simplification of constant bound expressions of an explicit shape spec of an array, we need to ensure that we never obtain negative extents. In some cases this did happen, and we ICEd as we hit an assert that this should never happen... The original testcase by Gerhard exhibited this for sizeof() of a derived type with an array component, but the issue is more fundamental and affects other intrinsics during simplification. A straightforward solution "fixes up" the upper bound in the shape spec when it is known to be below lower bounds minus one. Regtested on x86_64-pc-linux-gnu. OK for mainline? Thanks, Harald