aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorThomas Koenig <tkoenig@gcc.gnu.org>2018-09-16 19:37:44 +0000
committerThomas Koenig <tkoenig@gcc.gnu.org>2018-09-16 19:37:44 +0000
commited33417a64bfe3d5d8159e29751532c34cb54990 (patch)
treeba8e542af26f27874bb62f5c38c81fc6bc9c411d /gcc
parentc546dbdc4a3a41d12219ea8edc891e51b1aca610 (diff)
downloadgcc-ed33417a64bfe3d5d8159e29751532c34cb54990.zip
gcc-ed33417a64bfe3d5d8159e29751532c34cb54990.tar.gz
gcc-ed33417a64bfe3d5d8159e29751532c34cb54990.tar.bz2
re PR fortran/37802 (Improve wording for matmul bound checking)
2018-09-16 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/37802 * frontend-passes.c (B_ERROR): New macro for matmul bounds checking error messages. (C_ERROR): Likewise. (inline_matmul_assign): Reorganize bounds checking, use B_ERROR and C_ERROR macros. 2018-09-16 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/37802 * gfortran.dg/matmul_bounds_13.f90: New test case. * gfortran.dg/inline_matmul_15.f90: Adjust test for runtime error. * gfortran.dg/matmul_5.f90: Likewise. * gfortran.dg/matmul_bounds_10.f90: Likewise. * gfortran.dg/matmul_bounds_11.f90: Likewise. * gfortran.dg/matmul_bounds_2.f90: Likewise. * gfortran.dg/matmul_bounds_4.f90: Likewise. * gfortran.dg/matmul_bounds_5.f90: Likewise. 2018-09-16 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/37802 * m4/matmul_internal.m4: Adjust error messages. * generated/matmul_c10.c: Regenerated. * generated/matmul_c16.c: Regenerated. * generated/matmul_c4.c: Regenerated. * generated/matmul_c8.c: Regenerated. * generated/matmul_i1.c: Regenerated. * generated/matmul_i16.c: Regenerated. * generated/matmul_i2.c: Regenerated. * generated/matmul_i4.c: Regenerated. * generated/matmul_i8.c: Regenerated. * generated/matmul_r10.c: Regenerated. * generated/matmul_r16.c: Regenerated. * generated/matmul_r4.c: Regenerated. * generated/matmul_r8.c: Regenerated. * generated/matmulavx128_c10.c: Regenerated. * generated/matmulavx128_c16.c: Regenerated. * generated/matmulavx128_c4.c: Regenerated. * generated/matmulavx128_c8.c: Regenerated. * generated/matmulavx128_i1.c: Regenerated. * generated/matmulavx128_i16.c: Regenerated. * generated/matmulavx128_i2.c: Regenerated. * generated/matmulavx128_i4.c: Regenerated. * generated/matmulavx128_i8.c: Regenerated. * generated/matmulavx128_r10.c: Regenerated. * generated/matmulavx128_r16.c: Regenerated. * generated/matmulavx128_r4.c: Regenerated. * generated/matmulavx128_r8.c: Regenerated. From-SVN: r264349
Diffstat (limited to 'gcc')
-rw-r--r--gcc/fortran/ChangeLog9
-rw-r--r--gcc/fortran/frontend-passes.c223
-rw-r--r--gcc/testsuite/ChangeLog13
-rw-r--r--gcc/testsuite/gfortran.dg/inline_matmul_15.f902
-rw-r--r--gcc/testsuite/gfortran.dg/matmul_5.f902
-rw-r--r--gcc/testsuite/gfortran.dg/matmul_bounds_10.f902
-rw-r--r--gcc/testsuite/gfortran.dg/matmul_bounds_11.f902
-rw-r--r--gcc/testsuite/gfortran.dg/matmul_bounds_13.f9013
-rw-r--r--gcc/testsuite/gfortran.dg/matmul_bounds_2.f902
-rw-r--r--gcc/testsuite/gfortran.dg/matmul_bounds_3.f902
-rw-r--r--gcc/testsuite/gfortran.dg/matmul_bounds_4.f902
-rw-r--r--gcc/testsuite/gfortran.dg/matmul_bounds_5.f902
-rw-r--r--gcc/testsuite/gfortran.dg/matmul_bounds_8.f902
13 files changed, 146 insertions, 130 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index becc184..6f4872e 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,12 @@
+2018-09-16 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/37802
+ * frontend-passes.c (B_ERROR): New macro for matmul bounds
+ checking error messages.
+ (C_ERROR): Likewise.
+ (inline_matmul_assign): Reorganize bounds checking, use B_ERROR
+ and C_ERROR macros.
+
2018-09-13 Bernd Edlinger <bernd.edlinger@hotmail.de>
* trans-array.c (gfc_conv_array_initializer): Remove excess precision
diff --git a/gcc/fortran/frontend-passes.c b/gcc/fortran/frontend-passes.c
index 0a5e893..80a65fc 100644
--- a/gcc/fortran/frontend-passes.c
+++ b/gcc/fortran/frontend-passes.c
@@ -3748,6 +3748,15 @@ check_conjg_transpose_variable (gfc_expr *e, bool *conjg, bool *transpose)
return NULL;
}
+/* Macros for unified error messages. */
+
+#define B_ERROR(n) _("Incorrect extent in argument B in MATMUL intrinsic in " \
+ "dimension " #n ": is %ld, should be %ld")
+
+#define C_ERROR(n) _("Array bound mismatch for dimension " #n " of array " \
+ "(%ld/%ld)")
+
+
/* Inline assignments of the form c = matmul(a,b).
Handle only the cases currently where b and c are rank-two arrays.
@@ -3793,6 +3802,7 @@ inline_matmul_assign (gfc_code **c, int *walk_subtrees,
gfc_code *if_limit = NULL;
gfc_code **next_code_point;
bool conjg_a, conjg_b, transpose_a, transpose_b;
+ bool realloc_c;
if (co->op != EXEC_ASSIGN)
return 0;
@@ -3958,169 +3968,140 @@ inline_matmul_assign (gfc_code **c, int *walk_subtrees,
assign_zero->expr1->no_bounds_check = 1;
assign_zero->expr2 = zero_e;
- /* Handle the reallocation, if needed. */
- if (flag_realloc_lhs && gfc_is_reallocatable_lhs (expr1))
- {
- gfc_code *lhs_alloc;
+ realloc_c = flag_realloc_lhs && gfc_is_reallocatable_lhs (expr1);
- /* Only need to check a single dimension for the A2B2 case for
- bounds checking, the rest will be allocated. Also check this
- for A2B1. */
+ if (gfc_option.rtcheck & GFC_RTCHECK_BOUNDS)
+ {
+ gfc_code *test;
+ gfc_expr *a2, *b1, *c1, *c2, *a1, *b2;
- if (gfc_option.rtcheck & GFC_RTCHECK_BOUNDS)
+ switch (m_case)
{
- gfc_code *test;
- if (m_case == A2B2 || m_case == A2B1)
- {
- gfc_expr *a2, *b1;
+ case A2B1:
- a2 = get_array_inq_function (GFC_ISYM_SIZE, matrix_a, 2);
- b1 = get_array_inq_function (GFC_ISYM_SIZE, matrix_b, 1);
- test = runtime_error_ne (b1, a2, "Dimension of array B incorrect "
- "in MATMUL intrinsic: Is %ld, should be %ld");
- *next_code_point = test;
- next_code_point = &test->next;
- }
- else if (m_case == A1B2)
- {
- gfc_expr *a1, *b1;
+ b1 = get_array_inq_function (GFC_ISYM_SIZE, matrix_b, 1);
+ a2 = get_array_inq_function (GFC_ISYM_SIZE, matrix_a, 2);
+ test = runtime_error_ne (b1, a2, B_ERROR(1));
+ *next_code_point = test;
+ next_code_point = &test->next;
+ if (!realloc_c)
+ {
+ c1 = get_array_inq_function (GFC_ISYM_SIZE, expr1, 1);
a1 = get_array_inq_function (GFC_ISYM_SIZE, matrix_a, 1);
- b1 = get_array_inq_function (GFC_ISYM_SIZE, matrix_b, 1);
- test = runtime_error_ne (b1, a1, "Dimension of array B incorrect "
- "in MATMUL intrinsic: Is %ld, should be %ld");
+ test = runtime_error_ne (c1, a1, C_ERROR(1));
*next_code_point = test;
next_code_point = &test->next;
}
- }
-
- lhs_alloc = matmul_lhs_realloc (expr1, matrix_a, matrix_b, m_case);
-
- *next_code_point = lhs_alloc;
- next_code_point = &lhs_alloc->next;
+ break;
- }
- else if (gfc_option.rtcheck & GFC_RTCHECK_BOUNDS)
- {
- gfc_code *test;
- gfc_expr *a2, *b1, *c1, *c2, *a1, *b2;
+ case A1B2:
- if (m_case == A2B2 || m_case == A2B1)
- {
- a2 = get_array_inq_function (GFC_ISYM_SIZE, matrix_a, 2);
b1 = get_array_inq_function (GFC_ISYM_SIZE, matrix_b, 1);
- test = runtime_error_ne (b1, a2, "Dimension of array B incorrect "
- "in MATMUL intrinsic: Is %ld, should be %ld");
+ a1 = get_array_inq_function (GFC_ISYM_SIZE, matrix_a, 1);
+ test = runtime_error_ne (b1, a1, B_ERROR(1));
*next_code_point = test;
next_code_point = &test->next;
- c1 = get_array_inq_function (GFC_ISYM_SIZE, expr1, 1);
- a1 = get_array_inq_function (GFC_ISYM_SIZE, matrix_a, 1);
-
- if (m_case == A2B2)
- test = runtime_error_ne (c1, a1, "Incorrect extent in return array in "
- "MATMUL intrinsic for dimension 1: "
- "is %ld, should be %ld");
- else if (m_case == A2B1)
- test = runtime_error_ne (c1, a1, "Incorrect extent in return array in "
- "MATMUL intrinsic: "
- "is %ld, should be %ld");
+ if (!realloc_c)
+ {
+ c1 = get_array_inq_function (GFC_ISYM_SIZE, expr1, 1);
+ b2 = get_array_inq_function (GFC_ISYM_SIZE, matrix_b, 2);
+ test = runtime_error_ne (c1, b2, C_ERROR(1));
+ *next_code_point = test;
+ next_code_point = &test->next;
+ }
+ break;
+ case A2B2:
- *next_code_point = test;
- next_code_point = &test->next;
- }
- else if (m_case == A1B2)
- {
- a1 = get_array_inq_function (GFC_ISYM_SIZE, matrix_a, 1);
b1 = get_array_inq_function (GFC_ISYM_SIZE, matrix_b, 1);
- test = runtime_error_ne (b1, a1, "Dimension of array B incorrect "
- "in MATMUL intrinsic: Is %ld, should be %ld");
+ a2 = get_array_inq_function (GFC_ISYM_SIZE, matrix_a, 2);
+ test = runtime_error_ne (b1, a2, B_ERROR(1));
*next_code_point = test;
next_code_point = &test->next;
- c1 = get_array_inq_function (GFC_ISYM_SIZE, expr1, 1);
- b2 = get_array_inq_function (GFC_ISYM_SIZE, matrix_b, 2);
+ if (!realloc_c)
+ {
+ c1 = get_array_inq_function (GFC_ISYM_SIZE, expr1, 1);
+ a1 = get_array_inq_function (GFC_ISYM_SIZE, matrix_a, 1);
+ test = runtime_error_ne (c1, a1, C_ERROR(1));
+ *next_code_point = test;
+ next_code_point = &test->next;
- test = runtime_error_ne (c1, b2, "Incorrect extent in return array in "
- "MATMUL intrinsic: "
- "is %ld, should be %ld");
+ c2 = get_array_inq_function (GFC_ISYM_SIZE, expr1, 2);
+ b2 = get_array_inq_function (GFC_ISYM_SIZE, matrix_b, 2);
+ test = runtime_error_ne (c2, b2, C_ERROR(2));
+ *next_code_point = test;
+ next_code_point = &test->next;
+ }
+ break;
- *next_code_point = test;
- next_code_point = &test->next;
- }
+ case A2B2T:
- if (m_case == A2B2)
- {
- c2 = get_array_inq_function (GFC_ISYM_SIZE, expr1, 2);
b2 = get_array_inq_function (GFC_ISYM_SIZE, matrix_b, 2);
- test = runtime_error_ne (c2, b2, "Incorrect extent in return array in "
- "MATMUL intrinsic for dimension 2: is %ld, should be %ld");
-
+ a2 = get_array_inq_function (GFC_ISYM_SIZE, matrix_a, 2);
+ /* matrix_b is transposed, hence dimension 1 for the error message. */
+ test = runtime_error_ne (b2, a2, B_ERROR(1));
*next_code_point = test;
next_code_point = &test->next;
- }
- if (m_case == A2B2T)
- {
- c1 = get_array_inq_function (GFC_ISYM_SIZE, expr1, 1);
- a1 = get_array_inq_function (GFC_ISYM_SIZE, matrix_a, 1);
- test = runtime_error_ne (c1, a1, "Incorrect extent in return array in "
- "MATMUL intrinsic for dimension 1: "
- "is %ld, should be %ld");
+ if (!realloc_c)
+ {
+ c1 = get_array_inq_function (GFC_ISYM_SIZE, expr1, 1);
+ a1 = get_array_inq_function (GFC_ISYM_SIZE, matrix_a, 1);
+ test = runtime_error_ne (c1, a1, C_ERROR(1));
+ *next_code_point = test;
+ next_code_point = &test->next;
- *next_code_point = test;
- next_code_point = &test->next;
+ c2 = get_array_inq_function (GFC_ISYM_SIZE, expr1, 2);
+ b1 = get_array_inq_function (GFC_ISYM_SIZE, matrix_b, 1);
+ test = runtime_error_ne (c2, b1, C_ERROR(2));
+ *next_code_point = test;
+ next_code_point = &test->next;
+ }
+ break;
+
+ case A2TB2:
- c2 = get_array_inq_function (GFC_ISYM_SIZE, expr1, 2);
b1 = get_array_inq_function (GFC_ISYM_SIZE, matrix_b, 1);
- test = runtime_error_ne (c2, b1, "Incorrect extent in return array in "
- "MATMUL intrinsic for dimension 2: "
- "is %ld, should be %ld");
+ a1 = get_array_inq_function (GFC_ISYM_SIZE, matrix_a, 1);
+ test = runtime_error_ne (b1, a1, B_ERROR(1));
*next_code_point = test;
next_code_point = &test->next;
- a2 = get_array_inq_function (GFC_ISYM_SIZE, matrix_a, 2);
- b2 = get_array_inq_function (GFC_ISYM_SIZE, matrix_b, 2);
+ if (!realloc_c)
+ {
+ c1 = get_array_inq_function (GFC_ISYM_SIZE, expr1, 1);
+ a2 = get_array_inq_function (GFC_ISYM_SIZE, matrix_a, 2);
+ test = runtime_error_ne (c1, a2, C_ERROR(1));
+ *next_code_point = test;
+ next_code_point = &test->next;
- test = runtime_error_ne (b2, a2, "Incorrect extent in argument B in "
- "MATMUL intrnisic for dimension 2: "
- "is %ld, should be %ld");
- *next_code_point = test;
- next_code_point = &test->next;
+ c2 = get_array_inq_function (GFC_ISYM_SIZE, expr1, 2);
+ b2 = get_array_inq_function (GFC_ISYM_SIZE, matrix_b, 2);
+ test = runtime_error_ne (c2, b2, C_ERROR(2));
+ *next_code_point = test;
+ next_code_point = &test->next;
+ }
+ break;
+ default:
+ gcc_unreachable ();
}
+ }
- if (m_case == A2TB2)
- {
- c1 = get_array_inq_function (GFC_ISYM_SIZE, expr1, 1);
- a2 = get_array_inq_function (GFC_ISYM_SIZE, matrix_a, 2);
-
- test = runtime_error_ne (c1, a2, "Incorrect extent in return array in "
- "MATMUL intrinsic for dimension 1: "
- "is %ld, should be %ld");
-
- *next_code_point = test;
- next_code_point = &test->next;
+ /* Handle the reallocation, if needed. */
- c2 = get_array_inq_function (GFC_ISYM_SIZE, expr1, 2);
- b2 = get_array_inq_function (GFC_ISYM_SIZE, matrix_b, 2);
- test = runtime_error_ne (c2, b2, "Incorrect extent in return array in "
- "MATMUL intrinsic for dimension 2: "
- "is %ld, should be %ld");
- *next_code_point = test;
- next_code_point = &test->next;
+ if (realloc_c)
+ {
+ gfc_code *lhs_alloc;
- a1 = get_array_inq_function (GFC_ISYM_SIZE, matrix_a, 1);
- b1 = get_array_inq_function (GFC_ISYM_SIZE, matrix_b, 1);
+ lhs_alloc = matmul_lhs_realloc (expr1, matrix_a, matrix_b, m_case);
- test = runtime_error_ne (b1, a1, "Incorrect extent in argument B in "
- "MATMUL intrnisic for dimension 2: "
- "is %ld, should be %ld");
- *next_code_point = test;
- next_code_point = &test->next;
+ *next_code_point = lhs_alloc;
+ next_code_point = &lhs_alloc->next;
- }
}
*next_code_point = assign_zero;
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 847f57b..e37c177 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,16 @@
+2018-09-16 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/37802
+ * gfortran.dg/matmul_bounds_13.f90: New test case.
+ * gfortran.dg/inline_matmul_15.f90: Adjust test for runtime
+ error.
+ * gfortran.dg/matmul_5.f90: Likewise.
+ * gfortran.dg/matmul_bounds_10.f90: Likewise.
+ * gfortran.dg/matmul_bounds_11.f90: Likewise.
+ * gfortran.dg/matmul_bounds_2.f90: Likewise.
+ * gfortran.dg/matmul_bounds_4.f90: Likewise.
+ * gfortran.dg/matmul_bounds_5.f90: Likewise.
+
2018-09-15 Eric Botcazou <ebotcazou@adacore.com>
* gcc.c-torture/compile/20180915-1.c: New test.
diff --git a/gcc/testsuite/gfortran.dg/inline_matmul_15.f90 b/gcc/testsuite/gfortran.dg/inline_matmul_15.f90
index c822248..47da01c 100644
--- a/gcc/testsuite/gfortran.dg/inline_matmul_15.f90
+++ b/gcc/testsuite/gfortran.dg/inline_matmul_15.f90
@@ -9,4 +9,4 @@ program main
call random_number(b)
print *,matmul(a,b)
end program main
-! { dg-output "Fortran runtime error: Dimension of array B incorrect in MATMUL intrinsic.*" }
+! { dg-output "Fortran runtime error: Incorrect extent in argument B in MATMUL intrinsic in dimension 1" }
diff --git a/gcc/testsuite/gfortran.dg/matmul_5.f90 b/gcc/testsuite/gfortran.dg/matmul_5.f90
index 5f14028..79de7bf 100644
--- a/gcc/testsuite/gfortran.dg/matmul_5.f90
+++ b/gcc/testsuite/gfortran.dg/matmul_5.f90
@@ -9,4 +9,4 @@ program main
call random_number(b)
print *,matmul(a,b)
end program main
-! { dg-output "Fortran runtime error: dimension of array B incorrect in MATMUL intrinsic.*" }
+! { dg-output "Fortran runtime error: Incorrect extent in argument B in MATMUL intrinsic in dimension 1" }
diff --git a/gcc/testsuite/gfortran.dg/matmul_bounds_10.f90 b/gcc/testsuite/gfortran.dg/matmul_bounds_10.f90
index 6608b49..3899246 100644
--- a/gcc/testsuite/gfortran.dg/matmul_bounds_10.f90
+++ b/gcc/testsuite/gfortran.dg/matmul_bounds_10.f90
@@ -13,4 +13,4 @@ program main
allocate(ret(4,3))
ret = matmul(a,transpose(b)) ! This should throw an error.
end program main
-! { dg-output "Fortran runtime error: Incorrect extent in return array in MATMUL intrinsic for dimension 1: is 4, should be 3" }
+! { dg-output "Fortran runtime error: Array bound mismatch for dimension 1 of array.*" }
diff --git a/gcc/testsuite/gfortran.dg/matmul_bounds_11.f90 b/gcc/testsuite/gfortran.dg/matmul_bounds_11.f90
index 9209760..ee52a7b 100644
--- a/gcc/testsuite/gfortran.dg/matmul_bounds_11.f90
+++ b/gcc/testsuite/gfortran.dg/matmul_bounds_11.f90
@@ -11,5 +11,5 @@ program main
res = matmul(a,b)
print *,res
end program main
-! { dg-output "Fortran runtime error: Dimension of array B incorrect in MATMUL intrinsic.*" }
+! { dg-output "Fortran runtime error: Incorrect extent in argument B in MATMUL intrinsic in dimension 1: is 3, should be 2" }
diff --git a/gcc/testsuite/gfortran.dg/matmul_bounds_13.f90 b/gcc/testsuite/gfortran.dg/matmul_bounds_13.f90
new file mode 100644
index 0000000..154b133
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/matmul_bounds_13.f90
@@ -0,0 +1,13 @@
+! { dg-do run }
+! { dg-options "-fcheck=bounds" }
+! { dg-shouldfail "Fortran runtime error: Incorrect extent in argument B in MATMUL intrinsic in dimension 1" }
+program main
+ real, dimension(:,:), allocatable :: a, b, c
+ character(len=100) :: line
+ allocate (a(3,2))
+ allocate (b(2,4))
+ call random_number(a)
+ call random_number(b)
+ write (unit=line, fmt=*) matmul(a,transpose(b))
+end program main
+! { dg-output "Fortran runtime error: Incorrect extent in argument B in MATMUL intrinsic in dimension 1" }
diff --git a/gcc/testsuite/gfortran.dg/matmul_bounds_2.f90 b/gcc/testsuite/gfortran.dg/matmul_bounds_2.f90
index 978751e7..7a1deb3 100644
--- a/gcc/testsuite/gfortran.dg/matmul_bounds_2.f90
+++ b/gcc/testsuite/gfortran.dg/matmul_bounds_2.f90
@@ -13,4 +13,4 @@ program main
allocate(ret(3,2))
ret = matmul(a,b) ! This should throw an error.
end program main
-! { dg-output "Fortran runtime error: Incorrect extent in return array in MATMUL intrinsic for dimension 2: is 2, should be 3" }
+! { dg-output "Fortran runtime error: Array bound mismatch for dimension 2 of array.*" }
diff --git a/gcc/testsuite/gfortran.dg/matmul_bounds_3.f90 b/gcc/testsuite/gfortran.dg/matmul_bounds_3.f90
index 4b80f8c..8c8ae434 100644
--- a/gcc/testsuite/gfortran.dg/matmul_bounds_3.f90
+++ b/gcc/testsuite/gfortran.dg/matmul_bounds_3.f90
@@ -13,4 +13,4 @@ program main
allocate(ret(2,3))
ret = matmul(a,b) ! This should throw an error.
end program main
-! { dg-output "Fortran runtime error: Incorrect extent in return array in MATMUL intrinsic for dimension 1: is 2, should be 3" }
+! { dg-output "Fortran runtime error: Array bound mismatch for dimension 1 of array" }
diff --git a/gcc/testsuite/gfortran.dg/matmul_bounds_4.f90 b/gcc/testsuite/gfortran.dg/matmul_bounds_4.f90
index 94add6c..2dac29f 100644
--- a/gcc/testsuite/gfortran.dg/matmul_bounds_4.f90
+++ b/gcc/testsuite/gfortran.dg/matmul_bounds_4.f90
@@ -13,4 +13,4 @@ program main
allocate(ret(3))
ret = matmul(a,b) ! This should throw an error.
end program main
-! { dg-output "Fortran runtime error: Incorrect extent in return array in MATMUL intrinsic: is 3, should be 2" }
+! { dg-output "Fortran runtime error: Array bound mismatch for dimension 1 of array" }
diff --git a/gcc/testsuite/gfortran.dg/matmul_bounds_5.f90 b/gcc/testsuite/gfortran.dg/matmul_bounds_5.f90
index 5261e8e4..d2013ea 100644
--- a/gcc/testsuite/gfortran.dg/matmul_bounds_5.f90
+++ b/gcc/testsuite/gfortran.dg/matmul_bounds_5.f90
@@ -13,4 +13,4 @@ program main
allocate(ret(3))
ret = matmul(a,b) ! This should throw an error.
end program main
-! { dg-output "Fortran runtime error: Incorrect extent in return array in MATMUL intrinsic: is 3, should be 2" }
+! { dg-output "Fortran runtime error: Array bound mismatch for dimension 1 of array" }
diff --git a/gcc/testsuite/gfortran.dg/matmul_bounds_8.f90 b/gcc/testsuite/gfortran.dg/matmul_bounds_8.f90
index 2764cf3..11f5887 100644
--- a/gcc/testsuite/gfortran.dg/matmul_bounds_8.f90
+++ b/gcc/testsuite/gfortran.dg/matmul_bounds_8.f90
@@ -13,4 +13,4 @@ program main
allocate(ret(3,2))
ret = matmul(a,transpose(b)) ! This should throw an error.
end program main
-! { dg-output "Fortran runtime error: Incorrect extent in return array in MATMUL intrinsic for dimension 2: is 2, should be 3" }
+! { dg-output "Fortran runtime error: Array bound mismatch for dimension 2 of array" }