This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch, fortran] Check bounds for matrix-vector multiplication


Hi Steve,

Why the duplicate code?  Seems like an OR is needed.

You are quite right.

Here's an updated patch:

Index: frontend-passes.c
===================================================================
--- frontend-passes.c   (Revision 247003)
+++ frontend-passes.c   (Arbeitskopie)
@@ -3066,9 +3066,10 @@
       gfc_code *lhs_alloc;

       /* Only need to check a single dimension for the A2B2 case for
-        bounds checking, the rest will be allocated.  */
+        bounds checking, the rest will be allocated.  Also check this
+        for A2B1.   */

-      if (gfc_option.rtcheck & GFC_RTCHECK_BOUNDS && m_case == A2B2)
+ if ((gfc_option.rtcheck & GFC_RTCHECK_BOUNDS) && (m_case == A2B2 || m_case == A2B1))
        {
          gfc_code *test;
          gfc_expr *a2, *b1;

OK for trunk?

Regards

	Thomas


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]