------- Comment #4 from burnus at gcc dot gnu dot org 2008-08-03 07:23 ------- > Created an attachment (id=16001) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=16001&action=view) [edit] > better patch
I think some of the run-time checks (with -fbounds-checks) for PR 36874 can be best done in libgfortran. How about including in your patch a check that the shape of ARRAY (minus dimension DIM) is conformable with the SHIFT argument? (i.e. that for every dimension SHIFT has the same number of elements as ARRAY.) I was additionally wondering whether one should change error code such as: if (which < 0 || (which + 1) > GFC_DESCRIPTOR_RANK (array)) into if (__builtin_expect (which < 0 || (which + 1) > GFC_DESCRIPTOR_RANK (array), 0)) to speed up the run time by a tiny bit. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36886