testsuite: Avoid uninit var in pr60510.f [PR111427]

Message ID 51d2ee57-3df2-e038-b37f-4c296537d6c6@linux.ibm.com
State Accepted
Headers
Series testsuite: Avoid uninit var in pr60510.f [PR111427] |

Checks

Context Check Description
snail/gcc-patch-check success Github commit url

Commit Message

Kewen.Lin Sept. 27, 2023, 5:37 a.m. UTC
  Hi,

The uninitialized variable a in pr60510.f can cause some
random failures as exposed in PR111427, see the details
there.  This patch is to make it initialized accordingly.

As verified, it can fix the reported -m32 failures on
P7 and P8 BE.  It's also tested well on powerpc64-linux-gnu
P9 and powerpc64le-linux-gnu P9 and P10.

Is it ok for trunk?

BR,
Kewen
-----

	PR testsuite/111427

gcc/testsuite/ChangeLog:

	* gfortran.dg/vect/pr60510.f (test): Init variable a.
---
 gcc/testsuite/gfortran.dg/vect/pr60510.f | 1 +
 1 file changed, 1 insertion(+)

--
2.35.4
  

Comments

Richard Biener Sept. 27, 2023, 7:30 a.m. UTC | #1
On Wed, Sep 27, 2023 at 7:39 AM Kewen.Lin <linkw@linux.ibm.com> wrote:
>
> Hi,
>
> The uninitialized variable a in pr60510.f can cause some
> random failures as exposed in PR111427, see the details
> there.  This patch is to make it initialized accordingly.
>
> As verified, it can fix the reported -m32 failures on
> P7 and P8 BE.  It's also tested well on powerpc64-linux-gnu
> P9 and powerpc64le-linux-gnu P9 and P10.
>
> Is it ok for trunk?

OK.

Richard.

> BR,
> Kewen
> -----
>
>         PR testsuite/111427
>
> gcc/testsuite/ChangeLog:
>
>         * gfortran.dg/vect/pr60510.f (test): Init variable a.
> ---
>  gcc/testsuite/gfortran.dg/vect/pr60510.f | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/gcc/testsuite/gfortran.dg/vect/pr60510.f b/gcc/testsuite/gfortran.dg/vect/pr60510.f
> index ecd50dd5586..6cae82acece 100644
> --- a/gcc/testsuite/gfortran.dg/vect/pr60510.f
> +++ b/gcc/testsuite/gfortran.dg/vect/pr60510.f
> @@ -17,6 +17,7 @@
>
>        program test
>        real*8 x(1024),y(1024),a
> +      a = 0.0
>        do i=1,1024
>          x(i) = i
>          y(i) = i+1
> --
> 2.35.4
  

Patch

diff --git a/gcc/testsuite/gfortran.dg/vect/pr60510.f b/gcc/testsuite/gfortran.dg/vect/pr60510.f
index ecd50dd5586..6cae82acece 100644
--- a/gcc/testsuite/gfortran.dg/vect/pr60510.f
+++ b/gcc/testsuite/gfortran.dg/vect/pr60510.f
@@ -17,6 +17,7 @@ 

       program test
       real*8 x(1024),y(1024),a
+      a = 0.0
       do i=1,1024
         x(i) = i
         y(i) = i+1