From 0bba1319ed51cf669ced5fe5ec416c2fbdfe814e Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Fri, 14 Aug 2020 00:35:45 +0200 Subject: [PATCH 1/6] Fix incorrect calls to DLASET Reference-LAPACK issue 429 Suggested-By: Serguei Patchkovskii --- TESTING/EIG/cchkhb2stg.f | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/TESTING/EIG/cchkhb2stg.f b/TESTING/EIG/cchkhb2stg.f index 61537f44bc..cd884febfe 100644 --- a/TESTING/EIG/cchkhb2stg.f +++ b/TESTING/EIG/cchkhb2stg.f @@ -680,8 +680,8 @@ SUBROUTINE CCHKHB2STG( NSIZES, NN, NWDTHS, KK, NTYPES, DOTYPE, * the one from above. Compare it with D1 computed * using the DSBTRD. * - CALL DLASET( 'Full', N, 1, ZERO, ZERO, SD, 1 ) - CALL DLASET( 'Full', N, 1, ZERO, ZERO, SE, 1 ) + CALL SLASET( 'Full', N, 1, ZERO, ZERO, SD, 1 ) + CALL SLASET( 'Full', N, 1, ZERO, ZERO, SE, 1 ) CALL CLACPY( ' ', K+1, N, A, LDA, U, LDU ) LH = MAX(1, 4*N) LW = LWORK - LH @@ -753,8 +753,8 @@ SUBROUTINE CCHKHB2STG( NSIZES, NN, NWDTHS, KK, NTYPES, DOTYPE, * the one from above. Compare it with D1 computed * using the DSBTRD. * - CALL DLASET( 'Full', N, 1, ZERO, ZERO, SD, 1 ) - CALL DLASET( 'Full', N, 1, ZERO, ZERO, SE, 1 ) + CALL SLASET( 'Full', N, 1, ZERO, ZERO, SD, 1 ) + CALL SLASET( 'Full', N, 1, ZERO, ZERO, SE, 1 ) CALL CLACPY( ' ', K+1, N, A, LDA, U, LDU ) LH = MAX(1, 4*N) LW = LWORK - LH From 7d8e2f09240f10dc90148db51355c18fbaa1358c Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Fri, 14 Aug 2020 00:40:24 +0200 Subject: [PATCH 2/6] Fix incorrect argument to SLASET Reference-LAPACK issue 425 (and 318) Suggested-By: Serguei Patchkovskii --- TESTING/EIG/schksb2stg.f | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TESTING/EIG/schksb2stg.f b/TESTING/EIG/schksb2stg.f index 07b6fa95cb..7308bb690a 100644 --- a/TESTING/EIG/schksb2stg.f +++ b/TESTING/EIG/schksb2stg.f @@ -670,8 +670,8 @@ SUBROUTINE SCHKSB2STG( NSIZES, NN, NWDTHS, KK, NTYPES, DOTYPE, * the one from above. Compare it with D1 computed * using the SSBTRD. * - CALL SLASET( 'Full', N, 1, ZERO, ZERO, SD, 1 ) - CALL SLASET( 'Full', N, 1, ZERO, ZERO, SE, 1 ) + CALL SLASET( 'Full', N, 1, ZERO, ZERO, SD, N ) + CALL SLASET( 'Full', N, 1, ZERO, ZERO, SE, N ) CALL SLACPY( ' ', K+1, N, A, LDA, U, LDU ) LH = MAX(1, 4*N) LW = LWORK - LH From 7744f9e08a1e0cafcde6745c375c3c3019c85564 Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Fri, 14 Aug 2020 00:41:56 +0200 Subject: [PATCH 3/6] Fix incorrect argument to SLASET Reference-LAPACK issue 425 (and 318) Suggested-By: Serguei Patchkovskii --- TESTING/EIG/schkst2stg.f | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TESTING/EIG/schkst2stg.f b/TESTING/EIG/schkst2stg.f index f386ab43c1..83edb9dcee 100644 --- a/TESTING/EIG/schkst2stg.f +++ b/TESTING/EIG/schkst2stg.f @@ -999,8 +999,8 @@ SUBROUTINE SCHKST2STG( NSIZES, NN, NTYPES, DOTYPE, ISEED, THRESH, * the one from above. Compare it with D1 computed * using the 1-stage. * - CALL SLASET( 'Full', N, 1, ZERO, ZERO, SD, 1 ) - CALL SLASET( 'Full', N, 1, ZERO, ZERO, SE, 1 ) + CALL SLASET( 'Full', N, 1, ZERO, ZERO, SD, N ) + CALL SLASET( 'Full', N, 1, ZERO, ZERO, SE, N ) CALL SLACPY( "U", N, N, A, LDA, V, LDU ) LH = MAX(1, 4*N) LW = LWORK - LH From a5bfdf80d637f0b94d1d69ac08b34a7290dd6157 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Sun, 6 Sep 2020 10:53:52 +0200 Subject: [PATCH 4/6] Fix bounds-violation in SLASET These have been grandfathered in by compilers based on an ancient version of the language definition, but would invoke undefined behaviour per the standard. For more details, see the following: https://github.com/Reference-LAPACK/lapack/pull/438#issuecomment-687560690 Suggested-By: Serguei Patchkovskii --- TESTING/EIG/cchkhb2stg.f | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/TESTING/EIG/cchkhb2stg.f b/TESTING/EIG/cchkhb2stg.f index cd884febfe..100f133abd 100644 --- a/TESTING/EIG/cchkhb2stg.f +++ b/TESTING/EIG/cchkhb2stg.f @@ -680,8 +680,8 @@ SUBROUTINE CCHKHB2STG( NSIZES, NN, NWDTHS, KK, NTYPES, DOTYPE, * the one from above. Compare it with D1 computed * using the DSBTRD. * - CALL SLASET( 'Full', N, 1, ZERO, ZERO, SD, 1 ) - CALL SLASET( 'Full', N, 1, ZERO, ZERO, SE, 1 ) + CALL SLASET( 'Full', N, 1, ZERO, ZERO, SD, N ) + CALL SLASET( 'Full', N, 1, ZERO, ZERO, SE, N ) CALL CLACPY( ' ', K+1, N, A, LDA, U, LDU ) LH = MAX(1, 4*N) LW = LWORK - LH @@ -753,8 +753,8 @@ SUBROUTINE CCHKHB2STG( NSIZES, NN, NWDTHS, KK, NTYPES, DOTYPE, * the one from above. Compare it with D1 computed * using the DSBTRD. * - CALL SLASET( 'Full', N, 1, ZERO, ZERO, SD, 1 ) - CALL SLASET( 'Full', N, 1, ZERO, ZERO, SE, 1 ) + CALL SLASET( 'Full', N, 1, ZERO, ZERO, SD, N ) + CALL SLASET( 'Full', N, 1, ZERO, ZERO, SE, N ) CALL CLACPY( ' ', K+1, N, A, LDA, U, LDU ) LH = MAX(1, 4*N) LW = LWORK - LH From 94994eb1620a0f83a8e6a6d71f56b2a8f11864aa Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Sun, 6 Sep 2020 11:24:01 +0200 Subject: [PATCH 5/6] Fix more bounds-violations in SLASET-calls The last parameter must satisfy `LDA >= max(1,M)`, where M is the number of rows of the matrix, see https://github.com/Reference-LAPACK/lapack/blob/v3.9.0/SRC/slaset.f#L95 Suggested-By: Serguei Patchkovskii --- TESTING/EIG/schksb2stg.f | 4 ++-- TESTING/EIG/schkst2stg.f | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/TESTING/EIG/schksb2stg.f b/TESTING/EIG/schksb2stg.f index 7308bb690a..c6c9e39cfd 100644 --- a/TESTING/EIG/schksb2stg.f +++ b/TESTING/EIG/schksb2stg.f @@ -743,8 +743,8 @@ SUBROUTINE SCHKSB2STG( NSIZES, NN, NWDTHS, KK, NTYPES, DOTYPE, * the one from above. Compare it with D1 computed * using the SSBTRD. * - CALL SLASET( 'Full', N, 1, ZERO, ZERO, SD, 1 ) - CALL SLASET( 'Full', N, 1, ZERO, ZERO, SE, 1 ) + CALL SLASET( 'Full', N, 1, ZERO, ZERO, SD, N ) + CALL SLASET( 'Full', N, 1, ZERO, ZERO, SE, N ) CALL SLACPY( ' ', K+1, N, A, LDA, U, LDU ) LH = MAX(1, 4*N) LW = LWORK - LH diff --git a/TESTING/EIG/schkst2stg.f b/TESTING/EIG/schkst2stg.f index 83edb9dcee..c4e1572c1c 100644 --- a/TESTING/EIG/schkst2stg.f +++ b/TESTING/EIG/schkst2stg.f @@ -1032,8 +1032,8 @@ SUBROUTINE SCHKST2STG( NSIZES, NN, NTYPES, DOTYPE, ISEED, THRESH, * the one from above. Compare it with D1 computed * using the 1-stage. * - CALL SLASET( 'Full', N, 1, ZERO, ZERO, SD, 1 ) - CALL SLASET( 'Full', N, 1, ZERO, ZERO, SE, 1 ) + CALL SLASET( 'Full', N, 1, ZERO, ZERO, SD, N ) + CALL SLASET( 'Full', N, 1, ZERO, ZERO, SE, N ) CALL SLACPY( "L", N, N, A, LDA, V, LDU ) CALL SSYTRD_2STAGE( 'N', "L", N, V, LDU, SD, SE, TAU, $ WORK, LH, WORK( LH+1 ), LW, IINFO ) From bffac66e456eeb2ff88916461ac6891b3b5b837e Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Sun, 6 Sep 2020 11:27:53 +0200 Subject: [PATCH 6/6] Fix bounds-violations in DLASET-calls The last parameter must satisfy `LDA >= max(1,M)`, where M is the number of rows of the matrix, see https://github.com/Reference-LAPACK/lapack/blob/v3.9.0/SRC/dlaset.f#L95 Suggested-By: Serguei Patchkovskii --- TESTING/EIG/cchkst2stg.f | 8 ++++---- TESTING/EIG/dchksb2stg.f | 8 ++++---- TESTING/EIG/dchkst2stg.f | 8 ++++---- TESTING/EIG/zchkhb2stg.f | 8 ++++---- TESTING/EIG/zchkst2stg.f | 8 ++++---- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/TESTING/EIG/cchkst2stg.f b/TESTING/EIG/cchkst2stg.f index 5c478577f0..8c7f962b74 100644 --- a/TESTING/EIG/cchkst2stg.f +++ b/TESTING/EIG/cchkst2stg.f @@ -1014,8 +1014,8 @@ SUBROUTINE CCHKST2STG( NSIZES, NN, NTYPES, DOTYPE, ISEED, THRESH, * the one from above. Compare it with D1 computed * using the 1-stage. * - CALL DLASET( 'Full', N, 1, ZERO, ZERO, SD, 1 ) - CALL DLASET( 'Full', N, 1, ZERO, ZERO, SE, 1 ) + CALL DLASET( 'Full', N, 1, ZERO, ZERO, SD, N ) + CALL DLASET( 'Full', N, 1, ZERO, ZERO, SE, N ) CALL CLACPY( 'U', N, N, A, LDA, V, LDU ) LH = MAX(1, 4*N) LW = LWORK - LH @@ -1048,8 +1048,8 @@ SUBROUTINE CCHKST2STG( NSIZES, NN, NTYPES, DOTYPE, ISEED, THRESH, * the one from above. Compare it with D1 computed * using the 1-stage. * - CALL DLASET( 'Full', N, 1, ZERO, ZERO, SD, 1 ) - CALL DLASET( 'Full', N, 1, ZERO, ZERO, SE, 1 ) + CALL DLASET( 'Full', N, 1, ZERO, ZERO, SD, N ) + CALL DLASET( 'Full', N, 1, ZERO, ZERO, SE, N ) CALL CLACPY( 'L', N, N, A, LDA, V, LDU ) CALL CHETRD_2STAGE( 'N', "L", N, V, LDU, SD, SE, TAU, $ WORK, LH, WORK( LH+1 ), LW, IINFO ) diff --git a/TESTING/EIG/dchksb2stg.f b/TESTING/EIG/dchksb2stg.f index ee66f7ebb3..88f6e18d36 100644 --- a/TESTING/EIG/dchksb2stg.f +++ b/TESTING/EIG/dchksb2stg.f @@ -670,8 +670,8 @@ SUBROUTINE DCHKSB2STG( NSIZES, NN, NWDTHS, KK, NTYPES, DOTYPE, * the one from above. Compare it with D1 computed * using the DSBTRD. * - CALL DLASET( 'Full', N, 1, ZERO, ZERO, SD, 1 ) - CALL DLASET( 'Full', N, 1, ZERO, ZERO, SE, 1 ) + CALL DLASET( 'Full', N, 1, ZERO, ZERO, SD, N ) + CALL DLASET( 'Full', N, 1, ZERO, ZERO, SE, N ) CALL DLACPY( ' ', K+1, N, A, LDA, U, LDU ) LH = MAX(1, 4*N) LW = LWORK - LH @@ -743,8 +743,8 @@ SUBROUTINE DCHKSB2STG( NSIZES, NN, NWDTHS, KK, NTYPES, DOTYPE, * the one from above. Compare it with D1 computed * using the DSBTRD. * - CALL DLASET( 'Full', N, 1, ZERO, ZERO, SD, 1 ) - CALL DLASET( 'Full', N, 1, ZERO, ZERO, SE, 1 ) + CALL DLASET( 'Full', N, 1, ZERO, ZERO, SD, N ) + CALL DLASET( 'Full', N, 1, ZERO, ZERO, SE, N ) CALL DLACPY( ' ', K+1, N, A, LDA, U, LDU ) LH = MAX(1, 4*N) LW = LWORK - LH diff --git a/TESTING/EIG/dchkst2stg.f b/TESTING/EIG/dchkst2stg.f index ca31c9d1f0..7115175c29 100644 --- a/TESTING/EIG/dchkst2stg.f +++ b/TESTING/EIG/dchkst2stg.f @@ -999,8 +999,8 @@ SUBROUTINE DCHKST2STG( NSIZES, NN, NTYPES, DOTYPE, ISEED, THRESH, * the one from above. Compare it with D1 computed * using the 1-stage. * - CALL DLASET( 'Full', N, 1, ZERO, ZERO, SD, 1 ) - CALL DLASET( 'Full', N, 1, ZERO, ZERO, SE, 1 ) + CALL DLASET( 'Full', N, 1, ZERO, ZERO, SD, N ) + CALL DLASET( 'Full', N, 1, ZERO, ZERO, SE, N ) CALL DLACPY( "U", N, N, A, LDA, V, LDU ) LH = MAX(1, 4*N) LW = LWORK - LH @@ -1032,8 +1032,8 @@ SUBROUTINE DCHKST2STG( NSIZES, NN, NTYPES, DOTYPE, ISEED, THRESH, * the one from above. Compare it with D1 computed * using the 1-stage. * - CALL DLASET( 'Full', N, 1, ZERO, ZERO, SD, 1 ) - CALL DLASET( 'Full', N, 1, ZERO, ZERO, SE, 1 ) + CALL DLASET( 'Full', N, 1, ZERO, ZERO, SD, N ) + CALL DLASET( 'Full', N, 1, ZERO, ZERO, SE, N ) CALL DLACPY( "L", N, N, A, LDA, V, LDU ) CALL DSYTRD_2STAGE( 'N', "L", N, V, LDU, SD, SE, TAU, $ WORK, LH, WORK( LH+1 ), LW, IINFO ) diff --git a/TESTING/EIG/zchkhb2stg.f b/TESTING/EIG/zchkhb2stg.f index dbbb843480..05434e4e33 100644 --- a/TESTING/EIG/zchkhb2stg.f +++ b/TESTING/EIG/zchkhb2stg.f @@ -680,8 +680,8 @@ SUBROUTINE ZCHKHB2STG( NSIZES, NN, NWDTHS, KK, NTYPES, DOTYPE, * the one from above. Compare it with D1 computed * using the DSBTRD. * - CALL DLASET( 'Full', N, 1, ZERO, ZERO, SD, 1 ) - CALL DLASET( 'Full', N, 1, ZERO, ZERO, SE, 1 ) + CALL DLASET( 'Full', N, 1, ZERO, ZERO, SD, N ) + CALL DLASET( 'Full', N, 1, ZERO, ZERO, SE, N ) CALL ZLACPY( ' ', K+1, N, A, LDA, U, LDU ) LH = MAX(1, 4*N) LW = LWORK - LH @@ -753,8 +753,8 @@ SUBROUTINE ZCHKHB2STG( NSIZES, NN, NWDTHS, KK, NTYPES, DOTYPE, * the one from above. Compare it with D1 computed * using the DSBTRD. * - CALL DLASET( 'Full', N, 1, ZERO, ZERO, SD, 1 ) - CALL DLASET( 'Full', N, 1, ZERO, ZERO, SE, 1 ) + CALL DLASET( 'Full', N, 1, ZERO, ZERO, SD, N ) + CALL DLASET( 'Full', N, 1, ZERO, ZERO, SE, N ) CALL ZLACPY( ' ', K+1, N, A, LDA, U, LDU ) LH = MAX(1, 4*N) LW = LWORK - LH diff --git a/TESTING/EIG/zchkst2stg.f b/TESTING/EIG/zchkst2stg.f index 167e5f3591..4eadca4f30 100644 --- a/TESTING/EIG/zchkst2stg.f +++ b/TESTING/EIG/zchkst2stg.f @@ -1014,8 +1014,8 @@ SUBROUTINE ZCHKST2STG( NSIZES, NN, NTYPES, DOTYPE, ISEED, THRESH, * the one from above. Compare it with D1 computed * using the 1-stage. * - CALL DLASET( 'Full', N, 1, ZERO, ZERO, SD, 1 ) - CALL DLASET( 'Full', N, 1, ZERO, ZERO, SE, 1 ) + CALL DLASET( 'Full', N, 1, ZERO, ZERO, SD, N ) + CALL DLASET( 'Full', N, 1, ZERO, ZERO, SE, N ) CALL ZLACPY( 'U', N, N, A, LDA, V, LDU ) LH = MAX(1, 4*N) LW = LWORK - LH @@ -1048,8 +1048,8 @@ SUBROUTINE ZCHKST2STG( NSIZES, NN, NTYPES, DOTYPE, ISEED, THRESH, * the one from above. Compare it with D1 computed * using the 1-stage. * - CALL DLASET( 'Full', N, 1, ZERO, ZERO, SD, 1 ) - CALL DLASET( 'Full', N, 1, ZERO, ZERO, SE, 1 ) + CALL DLASET( 'Full', N, 1, ZERO, ZERO, SD, N ) + CALL DLASET( 'Full', N, 1, ZERO, ZERO, SE, N ) CALL ZLACPY( 'L', N, N, A, LDA, V, LDU ) CALL ZHETRD_2STAGE( 'N', "L", N, V, LDU, SD, SE, TAU, $ WORK, LH, WORK( LH+1 ), LW, IINFO )