public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug testsuite/61567] New: gfortran.dg/coarray_collectives_{5,6}.f90 failure
@ 2014-06-19 22:11 vries at gcc dot gnu.org
  2014-06-19 22:15 ` [Bug testsuite/61567] " vries at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: vries at gcc dot gnu.org @ 2014-06-19 22:11 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 61567
           Summary: gfortran.dg/coarray_collectives_{5,6}.f90 failure
           Product: gcc
           Version: 4.10.0
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: testsuite
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vries at gcc dot gnu.org

Created attachment 32978
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=32978&action=edit
coarray_collectives_5.f90

I see these failures with r211823.

./gcc/testsuite/gfortran/gfortran.sum:
...
FAIL: gfortran.dg/coarray_collectives_5.f90  -O   scan-tree-dump-times original
"_gfortran_caf_co_max \\(&desc.., 0B, 0, &stat1, 0B, 0, 0\\);" 1
FAIL: gfortran.dg/coarray_collectives_5.f90  -O   scan-tree-dump-times original
"_gfortran_caf_co_min \\(&desc.., 0B, 0, &stat2, 0B, 0, 0\\);" 1
FAIL: gfortran.dg/coarray_collectives_5.f90  -O   scan-tree-dump-times original
"_gfortran_caf_co_sum \\(&desc.., 0B, 0, &stat3, 0B, 0\\);" 1
FAIL: gfortran.dg/coarray_collectives_6.f90  -O   scan-tree-dump-times original
"_gfortran_caf_co_max \\(&desc.., 0B, 0, &stat1, errmesg1, 0, 6\\);" 1
FAIL: gfortran.dg/coarray_collectives_6.f90  -O   scan-tree-dump-times original
"_gfortran_caf_co_sum \\(&val2, 0B, 4, &stat2, errmesg2, 7\\);" 1
FAIL: gfortran.dg/coarray_collectives_6.f90  -O   scan-tree-dump-times original
"_gfortran_caf_co_min \\(&desc.., 0B, res, &stat3, errmesg3, 99, 8\\);" 1
...

The original dump for coarray_collectives_5.f90 contains:
  _gfortran_caf_co_max (&desc.0, 0, &stat1, 0B, 0, 0);
and the scan for this pattern fails:
  _gfortran_caf_co_max \\(&desc.., 0B, 0, &stat1, 0B, 0, 0\\);

I tentatively marked this as a testsuite problem.


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

* [Bug testsuite/61567] gfortran.dg/coarray_collectives_{5,6}.f90 failure
  2014-06-19 22:11 [Bug testsuite/61567] New: gfortran.dg/coarray_collectives_{5,6}.f90 failure vries at gcc dot gnu.org
@ 2014-06-19 22:15 ` vries at gcc dot gnu.org
  2014-06-20  5:24 ` burnus at gcc dot gnu.org
  2014-06-20  5:34 ` burnus at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: vries at gcc dot gnu.org @ 2014-06-19 22:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from vries at gcc dot gnu.org ---
configure line:
...
src/configure --prefix=nobootstrap/install --with-cloog=infra --with-ppl=infra
--with-gmp=infra --with-mpfr=infra --with-mpc=infra --disable-bootstrap
--enable-checking=yes,rtl --enable-languages=c,fortran,ada,java,objc,c++
...


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

* [Bug testsuite/61567] gfortran.dg/coarray_collectives_{5,6}.f90 failure
  2014-06-19 22:11 [Bug testsuite/61567] New: gfortran.dg/coarray_collectives_{5,6}.f90 failure vries at gcc dot gnu.org
  2014-06-19 22:15 ` [Bug testsuite/61567] " vries at gcc dot gnu.org
@ 2014-06-20  5:24 ` burnus at gcc dot gnu.org
  2014-06-20  5:34 ` burnus at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: burnus at gcc dot gnu.org @ 2014-06-20  5:24 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Author: burnus
Date: Fri Jun 20 05:24:09 2014
New Revision: 211833

URL: https://gcc.gnu.org/viewcvs?rev=211833&root=gcc&view=rev
Log:
2014-06-20  Tobias Burnus  <burnus@net-b.de>

        PR testsuite/61567
        * gfortran.dg/coarray_collectives_5.f90: Update
        dg-final scan-tree-dump-times.
        * gfortran.dg/coarray_collectives_6.f90: Ditto.


Modified:
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gfortran.dg/coarray_collectives_5.f90
    trunk/gcc/testsuite/gfortran.dg/coarray_collectives_6.f90


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

* [Bug testsuite/61567] gfortran.dg/coarray_collectives_{5,6}.f90 failure
  2014-06-19 22:11 [Bug testsuite/61567] New: gfortran.dg/coarray_collectives_{5,6}.f90 failure vries at gcc dot gnu.org
  2014-06-19 22:15 ` [Bug testsuite/61567] " vries at gcc dot gnu.org
  2014-06-20  5:24 ` burnus at gcc dot gnu.org
@ 2014-06-20  5:34 ` burnus at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: burnus at gcc dot gnu.org @ 2014-06-20  5:34 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

Thanks for the report and sorry for the breakage. When testing what became
r211816, I wondered why it didn't require testsuite changes – well, it turned
out it did, but I had looked at the wrong testsuite log file.
>From gcc-bugs-return-454579-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Jun 20 06:07:35 2014
Return-Path: <gcc-bugs-return-454579-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 17724 invoked by alias); 20 Jun 2014 06:07:34 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 17666 invoked by uid 48); 20 Jun 2014 06:07:25 -0000
From: "n-gcc at nn dot kiev.ua" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/61569] New: faggressive-loop-optimizations overoptimize loop checks with unpredicted result
Date: Fri, 20 Jun 2014 06:07:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: tree-optimization
X-Bugzilla-Version: 4.8.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: n-gcc at nn dot kiev.ua
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter
Message-ID: <bug-61569-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-06/txt/msg01661.txt.bz2
Content-length: 2217

https://gcc.gnu.org/bugzilla/show_bug.cgi?ida569

            Bug ID: 61569
           Summary: faggressive-loop-optimizations overoptimize loop
                    checks with unpredicted result
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: n-gcc at nn dot kiev.ua

The following program performs 112 iterations (and stop on x==1) instead of
expected 10 ones.

#include <stdio.h>

int main()
{
    int i, x = 27;
    for (i = 0; i < 10; ++i)
    {
        printf("%11d : %11d : %d\n", i, i*1000000000, x);
        if (x==1) break;
        x = x%2 ? x*3+1 : x/2;
    }
    return 0;
}

With a small change, it, instead, limits itself to 3 iterations.

#include <stdio.h>

int main()
{
    int i, j, x = 27;
    for (i = j = 0; i < 10; ++i, ++j)
    {
        printf("%11d : %11d : %d\n", i, j*1000000000, x);
        if (x==1) break;
        x = x%2 ? x*3+1 : x/2;
    }
    return 0;
}

Conditions to represent the issue are:
1. gcc after 4.8.0 (my versions gcc48-4.8.4.s20140605 and gcc49-4.9.1.s20140611
from FreeBSD ports).
2. -O2 or higher, or -Os.

The issue goes after any of the following options added:
* -fno-aggressive-loop-optimizations
* -fno-strict-overflow
* -fwrapv or -ftrapv (obviously)

Stage dump analysis shows that loop exit condition check (i<10 in that code
examples, i<=9 internally after some change) is gone away at 056t.cunrolli.

Adding of -Wstrict-overflow of any level doesn't cause warning emission.

The similar issue was reported in #58143 comment 9, and #53265 seems devoted to
lack of warning, but I'm not sure cases are equal.

Disclaimer: I'm aware of standard's statement "signed integer overflow is UB"
but I'm confident that a respected common-goal compiler should thoroughly limit
this UB to result value of the operator itself and avoid expanding it to any
other program action.

Thanks to: livejournal.com user _winnie for issue finding; user kodt_rsdn
(Nikolay Merkin) for the clear example designing; Serge Ryabchun for diagnosing
-faggressive-loop-optimizations influence.


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

end of thread, other threads:[~2014-06-20  5:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-19 22:11 [Bug testsuite/61567] New: gfortran.dg/coarray_collectives_{5,6}.f90 failure vries at gcc dot gnu.org
2014-06-19 22:15 ` [Bug testsuite/61567] " vries at gcc dot gnu.org
2014-06-20  5:24 ` burnus at gcc dot gnu.org
2014-06-20  5:34 ` burnus 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).