public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/103576] New: [12 Regression] gcc/fortran/openmp.c:7556:8: warning: overlapping comparisons always evaluate to true [-Wtautological-overlap-compare] since r12-5793-g689407ef916503b2f5a3c8c07fe7d5ab1913f956
@ 2021-12-06  9:54 marxin at gcc dot gnu.org
  2021-12-06  9:56 ` [Bug fortran/103576] " marxin at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-12-06  9:54 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103576

            Bug ID: 103576
           Summary: [12 Regression] gcc/fortran/openmp.c:7556:8: warning:
                    overlapping comparisons always evaluate to true
                    [-Wtautological-overlap-compare] since
                    r12-5793-g689407ef916503b2f5a3c8c07fe7d5ab1913f956
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: marxin at gcc dot gnu.org
                CC: burnus at gcc dot gnu.org
  Target Milestone: ---

Since the revision, Clang complains here:

gcc/fortran/openmp.c:7556:8: warning: overlapping comparisons always evaluate
to true [-Wtautological-overlap-compare]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug fortran/103576] [12 Regression] gcc/fortran/openmp.c:7556:8: warning: overlapping comparisons always evaluate to true [-Wtautological-overlap-compare] since r12-5793-g689407ef916503b2f5a3c8c07fe7d5ab1913f956
  2021-12-06  9:54 [Bug fortran/103576] New: [12 Regression] gcc/fortran/openmp.c:7556:8: warning: overlapping comparisons always evaluate to true [-Wtautological-overlap-compare] since r12-5793-g689407ef916503b2f5a3c8c07fe7d5ab1913f956 marxin at gcc dot gnu.org
@ 2021-12-06  9:56 ` marxin at gcc dot gnu.org
  2021-12-06 10:05 ` burnus at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-12-06  9:56 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103576

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |12.0
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2021-12-06
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
I suppose it should be:
expr->ts.type != foo && expr->ts.type != bar ...

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug fortran/103576] [12 Regression] gcc/fortran/openmp.c:7556:8: warning: overlapping comparisons always evaluate to true [-Wtautological-overlap-compare] since r12-5793-g689407ef916503b2f5a3c8c07fe7d5ab1913f956
  2021-12-06  9:54 [Bug fortran/103576] New: [12 Regression] gcc/fortran/openmp.c:7556:8: warning: overlapping comparisons always evaluate to true [-Wtautological-overlap-compare] since r12-5793-g689407ef916503b2f5a3c8c07fe7d5ab1913f956 marxin at gcc dot gnu.org
  2021-12-06  9:56 ` [Bug fortran/103576] " marxin at gcc dot gnu.org
@ 2021-12-06 10:05 ` burnus at gcc dot gnu.org
  2021-12-13 11:38 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: burnus at gcc dot gnu.org @ 2021-12-06 10:05 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103576

--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> ---
(In reply to Martin Liška from comment #1)
> I suppose it should be:
> expr->ts.type != foo && expr->ts.type != bar ...

Rather the following. There are some more fixes I should do in this area; I
added this patch on top of it. (Remaining: some more testcase writing and
testcase cleanup.)

--- a/gcc/fortran/openmp.c
+++ b/gcc/fortran/openmp.c
@@ -7555,4 +7555,4 @@ is_scalar_intrinsic_expr (gfc_expr *expr, bool
must_be_var, bool
-         && (expr->ts.type != BT_INTEGER
-             || expr->ts.type != BT_REAL
-             || expr->ts.type != BT_COMPLEX
-             || expr->ts.type != BT_LOGICAL));
+         && (expr->ts.type == BT_INTEGER
+             || expr->ts.type == BT_REAL
+             || expr->ts.type == BT_COMPLEX
+             || expr->ts.type == BT_LOGICAL));

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug fortran/103576] [12 Regression] gcc/fortran/openmp.c:7556:8: warning: overlapping comparisons always evaluate to true [-Wtautological-overlap-compare] since r12-5793-g689407ef916503b2f5a3c8c07fe7d5ab1913f956
  2021-12-06  9:54 [Bug fortran/103576] New: [12 Regression] gcc/fortran/openmp.c:7556:8: warning: overlapping comparisons always evaluate to true [-Wtautological-overlap-compare] since r12-5793-g689407ef916503b2f5a3c8c07fe7d5ab1913f956 marxin at gcc dot gnu.org
  2021-12-06  9:56 ` [Bug fortran/103576] " marxin at gcc dot gnu.org
  2021-12-06 10:05 ` burnus at gcc dot gnu.org
@ 2021-12-13 11:38 ` cvs-commit at gcc dot gnu.org
  2021-12-13 11:40 ` burnus at gcc dot gnu.org
  2021-12-14  6:21 ` cvs-commit at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-12-13 11:38 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103576

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tobias Burnus <burnus@gcc.gnu.org>:

https://gcc.gnu.org/g:494ebfa7c9aacaeb6ec1fccc47a0e49f31eb2bb8

commit r12-5926-g494ebfa7c9aacaeb6ec1fccc47a0e49f31eb2bb8
Author: Tobias Burnus <tobias@codesourcery.com>
Date:   Mon Dec 13 12:37:40 2021 +0100

    Fortran: Handle compare in OpenMP atomic

    gcc/fortran/ChangeLog:

            PR fortran/103576
            * openmp.c (is_scalar_intrinsic_expr): Fix condition.
            (resolve_omp_atomic): Fix/update checks, accept compare.
            * trans-openmp.c (gfc_trans_omp_atomic): Handle compare.

    libgomp/ChangeLog:

            * libgomp.texi (OpenMP 5.1): Set Fortran support for atomic to 'Y'.
            * testsuite/libgomp.fortran/atomic-19.f90: New test.

    gcc/testsuite/ChangeLog:

            * gfortran.dg/gomp/atomic-25.f90: Remove sorry, fix + add checks.
            * gfortran.dg/gomp/atomic-26.f90: Likewise.
            * gfortran.dg/gomp/atomic-21.f90: New test.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug fortran/103576] [12 Regression] gcc/fortran/openmp.c:7556:8: warning: overlapping comparisons always evaluate to true [-Wtautological-overlap-compare] since r12-5793-g689407ef916503b2f5a3c8c07fe7d5ab1913f956
  2021-12-06  9:54 [Bug fortran/103576] New: [12 Regression] gcc/fortran/openmp.c:7556:8: warning: overlapping comparisons always evaluate to true [-Wtautological-overlap-compare] since r12-5793-g689407ef916503b2f5a3c8c07fe7d5ab1913f956 marxin at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2021-12-13 11:38 ` cvs-commit at gcc dot gnu.org
@ 2021-12-13 11:40 ` burnus at gcc dot gnu.org
  2021-12-14  6:21 ` cvs-commit at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: burnus at gcc dot gnu.org @ 2021-12-13 11:40 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103576

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #4 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Should be FIXED.

Thanks for the report.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug fortran/103576] [12 Regression] gcc/fortran/openmp.c:7556:8: warning: overlapping comparisons always evaluate to true [-Wtautological-overlap-compare] since r12-5793-g689407ef916503b2f5a3c8c07fe7d5ab1913f956
  2021-12-06  9:54 [Bug fortran/103576] New: [12 Regression] gcc/fortran/openmp.c:7556:8: warning: overlapping comparisons always evaluate to true [-Wtautological-overlap-compare] since r12-5793-g689407ef916503b2f5a3c8c07fe7d5ab1913f956 marxin at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2021-12-13 11:40 ` burnus at gcc dot gnu.org
@ 2021-12-14  6:21 ` cvs-commit at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-12-14  6:21 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103576

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Thomas Schwinge <tschwinge@gcc.gnu.org>:

https://gcc.gnu.org/g:228d64af4e244faabab5c47506920a1bde85d74e

commit r12-5946-g228d64af4e244faabab5c47506920a1bde85d74e
Author: Thomas Schwinge <thomas@codesourcery.com>
Date:   Tue Dec 14 07:03:52 2021 +0100

    Adjust 'gfortran.dg/goacc/privatization-1-*' [PR103576, PR103697]

    ... for the recent commit 494ebfa7c9aacaeb6ec1fccc47a0e49f31eb2bb8
    "Fortran: Handle compare in OpenMP atomic", which changes the GIMPLE IR
    such that a temporary is no longer used; 'original' dump:

                 x = *a;
        -        {
        -          integer(kind=4) D.4237;
        -
        -          D.4237 = *a;
                   #pragma omp atomic relaxed
        -            &y = D.4237;
        -        }
        +          &y = *a;
               }

    (I'm not familiar to comment whether that's correct; but it appears that
the
    difference again disappears in later compiler passes.)

    These OpenACC test cases verify behavior re OpenACC privatization levels,
and
    have to be adjusted accordingly.

            gcc/testsuite/
            PR fortran/103576
            PR testsuite/103697
            * gfortran.dg/goacc/privatization-1-compute-loop.f90: Adjust.
            * gfortran.dg/goacc/privatization-1-compute.f90: Likewise.
            * gfortran.dg/goacc/privatization-1-routine_gang-loop.f90:
            Likewise.
            * gfortran.dg/goacc/privatization-1-routine_gang.f90: Likewise.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-12-14  6:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-06  9:54 [Bug fortran/103576] New: [12 Regression] gcc/fortran/openmp.c:7556:8: warning: overlapping comparisons always evaluate to true [-Wtautological-overlap-compare] since r12-5793-g689407ef916503b2f5a3c8c07fe7d5ab1913f956 marxin at gcc dot gnu.org
2021-12-06  9:56 ` [Bug fortran/103576] " marxin at gcc dot gnu.org
2021-12-06 10:05 ` burnus at gcc dot gnu.org
2021-12-13 11:38 ` cvs-commit at gcc dot gnu.org
2021-12-13 11:40 ` burnus at gcc dot gnu.org
2021-12-14  6:21 ` cvs-commit at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).