[Bug libfortran/36886] misaligment for cshift of character

burnus at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Sun Aug 3 07:24:00 GMT 2008



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



More information about the Gcc-bugs mailing list