Hi!

First, note this is now GCC PR115989
"[15 regression] libgomp.oacc-fortran/privatized-ref-2.f90 fails after 
r15-2135-gc3aa339ea50f05".

Otherwise:

On 2024-07-19T06:54:46+0100, Paul Richard Thomas 
<paul.richard.tho...@gmail.com> wrote:
> Thanks for doing that test. Here is what the error looks like on 14-branch:
> libgomp.oacc-fortran/privatized-ref-2.f90:36:22:
>    36 |   A = [(3*j, j=1, 10)]
>       |                      ^
> Warning: ‘a.offset’ is used uninitialized [-Wuninitialized]
> libgomp.oacc-fortran/privatized-ref-2.f90:31:30:
>    31 |   integer, allocatable :: A(:)
>       |                              ^
> note: ‘a’ declared here
> libgomp.oacc-fortran/privatized-ref-2.f90:36:22:
> ....repeats for the descriptor bounds.
>
> The scalarizer, which sets up the loops for the assignment of 'A' assigns
> the bounds and offset to variables. These are then manipulated further and
> used for the loop bounds and allocation. The patch does a once off setting
> of the bounds, to eliminate the bogus warnings. The allocate statement
> already does this.

Maybe you're already aware, but if not, please have a look how PR108889
(Paul's commit r15-2135-gc3aa339ea50f050caf7ed2e497f5499ec2d7b9cc
"Fortran: Suppress bogus used uninitialized warnings [PR108889]") relates
to "PR77504 etc." as mentioned in
'libgomp.oacc-fortran/privatized-ref-2.f90'?

> I will patch appropriately just as soon as I am able.

Next, the proposed patch:

> On Fri, 19 Jul 2024 at 02:59, Jiang, Haochen <haochen.ji...@intel.com>
> wrote:
>> Just did a quick test. Correct myself previously. Those lines also
>> needs to be removed since they are XPASS now.
>>
>> However the real issue is the dg-note at Line 32, that is the warning
>> disappeared.
>>
>> diff --git a/libgomp/testsuite/libgomp.oacc-fortran/privatized-ref-2.f90 
>> b/libgomp/testsuite/libgomp.oacc-fortran/privatized-ref-2.f90
>> index 498ef70b63a..8cf79a10e8d 100644
>> --- a/libgomp/testsuite/libgomp.oacc-fortran/privatized-ref-2.f90
>> +++ b/libgomp/testsuite/libgomp.oacc-fortran/privatized-ref-2.f90
>> @@ -29,16 +29,10 @@ program main
>>    implicit none (type, external)
>>    integer :: j
>>    integer, allocatable :: A(:)
>> -  ! { dg-note {'a' declared here} {} { target *-*-* } .-1 }
>>    character(len=:), allocatable :: my_str
>>    character(len=15), allocatable :: my_str15
>>
>>    A = [(3*j, j=1, 10)]
>> -  ! { dg-bogus {'a\.offset' is used uninitialized} {PR77504 etc.} { xfail 
>> *-*-* } .-1 }
>> -  ! { dg-bogus {'a\.dim\[0\]\.lbound' is used uninitialized} {PR77504 etc.} 
>> { xfail *-*-* } .-2 }
>> -  ! { dg-bogus {'a\.dim\[0\]\.ubound' is used uninitialized} {PR77504 etc.} 
>> { xfail *-*-* } .-3 }
>> -  ! { dg-bogus {'a\.dim\[0\]\.lbound' may be used uninitialized} {PR77504 
>> etc.} { xfail { ! __OPTIMIZE__ } } .-4 }
>> -  ! { dg-bogus {'a\.dim\[0\]\.ubound' may be used uninitialized} {PR77504 
>> etc.} { xfail { ! __OPTIMIZE__ } } .-5 }
>>    call foo (A, size(A))
>>    call bar (A)
>>    my_str = "1234567890"
>>
>> After the change, all the tests are passed. However, is that right?

... looks exactly right to me.  Please push.


Grüße
 Thomas


>> I am not familiar with either Fortran or libgomp, but the warning
>> like something declared here which might report variable declaration
>> conflict seems needed.
>>
>> Thx,
>> Haochen
>>
>> *From:* Jiang, Haochen
>> *Sent:* Friday, July 19, 2024 9:49 AM
>> *To:* Paul Richard Thomas <paul.richard.tho...@gmail.com>
>> *Cc:* pa...@gcc.gnu.org; gcc-regress...@gcc.gnu.org;
>> gcc-patc...@gcc.gnu.org
>> *Subject:* RE: [r15-2135 Regression] FAIL:
>> libgomp.oacc-fortran/privatized-ref-2.f90 -DACC_DEVICE_TYPE_host=1
>> -DACC_MEM_SHARED=1 -foffload=disable -Os at line 32 (test for warnings,
>> line 31) on Linux/x86_64
>>
>>
>>
>> Hi Paul,
>>
>>
>>
>> I suspect it is not the correct way to do that, those lines are ok since
>> they are XFAIL. The problem is that specific warning test.
>>
>>
>>
>> Thx,
>>
>> Haochen
>>
>>
>>
>> *From:* Paul Richard Thomas <paul.richard.tho...@gmail.com>
>> *Sent:* Friday, July 19, 2024 12:28 AM
>> *To:* haochen.jiang <haoch...@ecsmtp.sh.intel.com>
>> *Cc:* pa...@gcc.gnu.org; gcc-regress...@gcc.gnu.org;
>> gcc-patc...@gcc.gnu.org; Jiang, Haochen <haochen.ji...@intel.com>
>> *Subject:* Re: [r15-2135 Regression] FAIL:
>> libgomp.oacc-fortran/privatized-ref-2.f90 -DACC_DEVICE_TYPE_host=1
>> -DACC_MEM_SHARED=1 -foffload=disable -Os at line 32 (test for warnings,
>> line 31) on Linux/x86_64
>>
>>
>>
>> Hi Haochen,
>>
>>
>>
>> Try removing lines 37-41 since these are precisely the bogus warnings that
>> the patch is meant to eliminate.
>>
>>
>>
>> Regards
>>
>>
>>
>> Paul
>>
>>
>>
>> On Thu, 18 Jul 2024 at 14:38, haochen.jiang <haoch...@ecsmtp.sh.intel.com>
>> wrote:
>>
>> On Linux/x86_64,
>>
>> c3aa339ea50f050caf7ed2e497f5499ec2d7b9cc is the first bad commit
>> commit c3aa339ea50f050caf7ed2e497f5499ec2d7b9cc
>> Author: Paul Thomas <pa...@gcc.gnu.org>
>> Date:   Thu Jul 18 08:51:35 2024 +0100
>>
>>     Fortran: Suppress bogus used uninitialized warnings [PR108889].
>>
>> caused
>>
>> FAIL: libgomp.oacc-fortran/privatized-ref-2.f90 -DACC_DEVICE_TYPE_host=1
>> -DACC_MEM_SHARED=1 -foffload=disable  -O0   at line 32 (test for warnings,
>> line 31)
>> FAIL: libgomp.oacc-fortran/privatized-ref-2.f90 -DACC_DEVICE_TYPE_host=1
>> -DACC_MEM_SHARED=1 -foffload=disable  -O1   at line 32 (test for warnings,
>> line 31)
>> FAIL: libgomp.oacc-fortran/privatized-ref-2.f90 -DACC_DEVICE_TYPE_host=1
>> -DACC_MEM_SHARED=1 -foffload=disable  -O2   at line 32 (test for warnings,
>> line 31)
>> FAIL: libgomp.oacc-fortran/privatized-ref-2.f90 -DACC_DEVICE_TYPE_host=1
>> -DACC_MEM_SHARED=1 -foffload=disable  -O3 -fomit-frame-pointer
>> -funroll-loops -fpeel-loops -ftracer -finline-functions   at line 32 (test
>> for warnings, line 31)
>> FAIL: libgomp.oacc-fortran/privatized-ref-2.f90 -DACC_DEVICE_TYPE_host=1
>> -DACC_MEM_SHARED=1 -foffload=disable  -O3 -g   at line 32 (test for
>> warnings, line 31)
>> FAIL: libgomp.oacc-fortran/privatized-ref-2.f90 -DACC_DEVICE_TYPE_host=1
>> -DACC_MEM_SHARED=1 -foffload=disable  -Os   at line 32 (test for warnings,
>> line 31)
>>
>> with GCC configured with
>>
>> ../../gcc/configure
>> --prefix=/export/users/haochenj/src/gcc-bisect/master/master/r15-2135/usr
>> --enable-clocale=gnu --with-system-zlib --with-demangler-in-ld
>> --with-fpmath=sse --enable-languages=c,c++,fortran --enable-cet
>> --without-isl --enable-libmpx x86_64-linux --disable-bootstrap
>>
>> To reproduce:
>>
>> $ cd {build_dir}/x86_64-linux/libgomp/testsuite && make check
>> RUNTESTFLAGS="fortran.exp=libgomp.oacc-fortran/privatized-ref-2.f90
>> --target_board='unix{-m32}'"
>> $ cd {build_dir}/x86_64-linux/libgomp/testsuite && make check
>> RUNTESTFLAGS="fortran.exp=libgomp.oacc-fortran/privatized-ref-2.f90
>> --target_board='unix{-m32\ -march=cascadelake}'"
>> $ cd {build_dir}/x86_64-linux/libgomp/testsuite && make check
>> RUNTESTFLAGS="fortran.exp=libgomp.oacc-fortran/privatized-ref-2.f90
>> --target_board='unix{-m64}'"
>> $ cd {build_dir}/x86_64-linux/libgomp/testsuite && make check
>> RUNTESTFLAGS="fortran.exp=libgomp.oacc-fortran/privatized-ref-2.f90
>> --target_board='unix{-m64\ -march=cascadelake}'"
>>
>> (Please do not reply to this email, for question about this report,
>> contact me at haochen dot jiang at intel.com.)
>> (If you met problems with cascadelake related, disabling AVX512F in
>> command line might save that.)
>> (However, please make sure that there is no potential problems with
>> AVX512.)

Reply via email to