diff mbox

[fortran] Check bounds for matrix-vector multiplication

Message ID 05e6ea3e-4d09-0b0a-0623-3525d90daf53@netcologne.de
State New
Headers show

Commit Message

Thomas Koenig May 1, 2017, 5:21 p.m. UTC
Hi Steve,

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

You are quite right.

Here's an updated patch:

           gfc_expr *a2, *b1;

OK for trunk?

Regards

	Thomas

Comments

Steve Kargl May 1, 2017, 5:26 p.m. UTC | #1
On Mon, May 01, 2017 at 07:21:03PM +0200, Thomas Koenig wrote:
> 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?
> 

Yes.
diff mbox

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;