This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libfortran/36886] misaligment for cshift of character
- From: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 3 Aug 2008 07:23:31 -0000
- Subject: [Bug libfortran/36886] misaligment for cshift of character
- References: <bug-36886-10391@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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