Hi,
taking the address of a constant like in &0 is usually a bad idea. Therefore in
this location it makes sense to have &value. Please do not modify the testcase,
but fix the code generation!
Regards,
Andre
On Tue, 21 Oct 2025 12:54:15 +0800
Ma Yuao <[email protected]> wrote:
> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"><div
> dir="auto"><div dir="auto">Hi,</div><div dir="auto"><br></div><div
> dir="auto">Sorry for the regression. Looks like after the patch, the value
> gets folded to zero. Like following:</div><div dir="auto"><br></div><div
> dir="auto">_gfortran_caf_atomic_define \\(caf_token.., 0, 1, &0, 0B, 1,
> 4\\);</div><div><br><div class="gmail_extra" dir="auto">If it is intended
> behavior, I will update the testcase tonight.</div><div class="gmail_extra"
> dir="auto"><br></div><div class="gmail_extra" dir="auto">Yuao</div><div
> class="gmail_extra"><br><div class="gmail_quote">2025年10月21日
> 10:23,"Jiang, Haochen" <[email protected]>写道:<br
> type="attribution"><blockquote class="quote" style="margin:0 0 0
> .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">On
> Linux/x86_64, <br>
>
> <br>
> 2c1949bf152f8fcadb0ef7a44113c41d18724691 is the first bad commit
> <br>
> commit 2c1949bf152f8fcadb0ef7a44113c41d18724691
> <br>
> Author: Yuao Ma <[email protected]>
> <br>
> Date: Thu Oct 16 22:32:52 2025 +0800
> <br>
>
> <br>
> fortran: allow character in conditional expression
> <br>
>
> <br>
> caused
> <br>
>
> <br>
> FAIL: gfortran.dg/coarray_atomic_5.f90 -O
> scan-tree-dump-times original "_gfortran_caf_atomic_define
> \\(caf_token.., 0, 1, &value.., 0B, 1, 4\\);" 1 <br> FAIL:
> gfortran.dg/coarray_atomic_5.f90 -O
> scan-tree-dump-times original "value.. = 0;" 1 <br>
>
> <br>
> with GCC configured with
> <br>
>
> <br>
> ../../gcc/configure
> --prefix=/export/users3/haochenj/src/gcc-bisect/master/master/r16-4474/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 <br>
>
> <br>
> To reproduce:
> <br>
>
> <br>
> $ cd {build_dir}/gcc && make check
> RUNTESTFLAGS="dg.exp=gfortran.dg/coarray_atomic_5.f90
> --target_board='unix{-m32}'" <br> $ cd {build_dir}/gcc && make
> check RUNTESTFLAGS="dg.exp=gfortran.dg/coarray_atomic_5.f90
> --target_board='unix{-m32\ -march=cascadelake}'" <br> $ cd
> {build_dir}/gcc && make check
> RUNTESTFLAGS="dg.exp=gfortran.dg/coarray_atomic_5.f90
> --target_board='unix{-m64}'" <br> $ cd {build_dir}/gcc && make
> check RUNTESTFLAGS="dg.exp=gfortran.dg/coarray_atomic_5.f90
> --target_board='unix{-m64\ -march=cascadelake}'" <br>
>
> <br>
> (Please directly reply to this email for question about this report.)
> <br>
> (If you met problems with cascadelake related, disabling AVX512F in command
> line might save that.) <br>
> (However, please make sure that there is no potential problems with AVX512.)
> <br>
> </p>
> </blockquote></div><br></div></div></div>
--
Andre Vehreschild * Email: vehre ad gmx dot de