------- Comment #5 from tkoenig at gcc dot gnu dot org  2008-08-03 09:22 -------
(In reply to comment #4)
> > 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've done so for other intrinsics (see PR 34670), and I plan to do so
for cshift as well.

Not with this patch, though; I like to do one thing at a time :-)

> 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.

Sure, we could do that for all of the run-time checks.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36886

Reply via email to