public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/59124] New: [4.8 Regression] Wrong warnings "array subscript is above array bounds"
@ 2013-11-14  0:44 d.g.gorbachev at gmail dot com
  2013-11-14  9:51 ` [Bug tree-optimization/59124] [4.8/4.9 " rguenth at gcc dot gnu.org
                   ` (29 more replies)
  0 siblings, 30 replies; 31+ messages in thread
From: d.g.gorbachev at gmail dot com @ 2013-11-14  0:44 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59124

            Bug ID: 59124
           Summary: [4.8 Regression] Wrong warnings "array subscript is
                    above array bounds"
           Product: gcc
           Version: 4.8.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: d.g.gorbachev at gmail dot com

$ gcc -S -Wall -O3 1.c
1.c: In function 'foo':
1.c:12:23: warning: array subscript is above array bounds [-Warray-bounds]
       bar[j - 1] = baz[j - 1];
                       ^
1.c:12:23: warning: array subscript is above array bounds [-Warray-bounds]

=============== 8< ===============
unsigned baz[6];

void foo(unsigned *bar, unsigned n)
{
  unsigned i, j;

  if (n > 6)
    n = 6;

  for (i = 1; i < n; i++)
    for (j = i - 1; j > 0; j--)
      bar[j - 1] = baz[j - 1];
}
=============== >8 ===============

GCC 4.8.0 20120902 /rev. 190863/ - works,
GCC 4.8.0 20121111 /rev. 193417/ - fails.


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

* [Bug tree-optimization/59124] [4.8/4.9 Regression] Wrong warnings "array subscript is above array bounds"
  2013-11-14  0:44 [Bug tree-optimization/59124] New: [4.8 Regression] Wrong warnings "array subscript is above array bounds" d.g.gorbachev at gmail dot com
@ 2013-11-14  9:51 ` rguenth at gcc dot gnu.org
  2013-11-14 17:56 ` d.g.gorbachev at gmail dot com
                   ` (28 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-11-14  9:51 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59124

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-11-14
                 CC|                            |hubicka at gcc dot gnu.org
   Target Milestone|---                         |4.8.3
            Summary|[4.8 Regression] Wrong      |[4.8/4.9 Regression] Wrong
                   |warnings "array subscript   |warnings "array subscript
                   |is above array bounds"      |is above array bounds"
     Ever confirmed|0                           |1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed.  The inner loop is completely peeled but unreachable code remains.


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

* [Bug tree-optimization/59124] [4.8/4.9 Regression] Wrong warnings "array subscript is above array bounds"
  2013-11-14  0:44 [Bug tree-optimization/59124] New: [4.8 Regression] Wrong warnings "array subscript is above array bounds" d.g.gorbachev at gmail dot com
  2013-11-14  9:51 ` [Bug tree-optimization/59124] [4.8/4.9 " rguenth at gcc dot gnu.org
@ 2013-11-14 17:56 ` d.g.gorbachev at gmail dot com
  2013-11-21 14:39 ` rguenth at gcc dot gnu.org
                   ` (27 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: d.g.gorbachev at gmail dot com @ 2013-11-14 17:56 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59124

--- Comment #2 from Dmitry Gorbachev <d.g.gorbachev at gmail dot com> ---
Another testcase:

============= 8< =============
extern char *bar[17];

int foo(int argc, char **argv)
{
  int i;
  int n = 0;

  for (i = 0; i < argc; i++)
    n++;

  for (i = 0; i < argc; i++)
    argv[i] = bar[i + n];

  return 0;
}
============= >8 =============

$ gcc -S -Wall -O3 2.c
2.c: In function 'foo':
2.c:12:18: warning: array subscript is above array bounds [-Warray-bounds]
     argv[i] = bar[i + n];
                  ^
2.c:12:18: warning: array subscript is above array bounds [-Warray-bounds]
2.c:12:18: warning: array subscript is above array bounds [-Warray-bounds]
2.c:12:18: warning: array subscript is above array bounds [-Warray-bounds]
2.c:12:18: warning: array subscript is above array bounds [-Warray-bounds]
2.c:12:18: warning: array subscript is above array bounds [-Warray-bounds]
2.c:12:18: warning: array subscript is above array bounds [-Warray-bounds]
2.c:12:18: warning: array subscript is above array bounds [-Warray-bounds]
2.c:12:18: warning: array subscript is above array bounds [-Warray-bounds]


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

* [Bug tree-optimization/59124] [4.8/4.9 Regression] Wrong warnings "array subscript is above array bounds"
  2013-11-14  0:44 [Bug tree-optimization/59124] New: [4.8 Regression] Wrong warnings "array subscript is above array bounds" d.g.gorbachev at gmail dot com
  2013-11-14  9:51 ` [Bug tree-optimization/59124] [4.8/4.9 " rguenth at gcc dot gnu.org
  2013-11-14 17:56 ` d.g.gorbachev at gmail dot com
@ 2013-11-21 14:39 ` rguenth at gcc dot gnu.org
  2014-03-12 14:33 ` jakub at gcc dot gnu.org
                   ` (26 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-11-21 14:39 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59124

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2


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

* [Bug tree-optimization/59124] [4.8/4.9 Regression] Wrong warnings "array subscript is above array bounds"
  2013-11-14  0:44 [Bug tree-optimization/59124] New: [4.8 Regression] Wrong warnings "array subscript is above array bounds" d.g.gorbachev at gmail dot com
                   ` (2 preceding siblings ...)
  2013-11-21 14:39 ` rguenth at gcc dot gnu.org
@ 2014-03-12 14:33 ` jakub at gcc dot gnu.org
  2014-05-22  9:03 ` [Bug tree-optimization/59124] [4.8/4.9/4.10 " rguenth at gcc dot gnu.org
                   ` (25 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-03-12 14:33 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59124

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Both testcases regressed with r192538.


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

* [Bug tree-optimization/59124] [4.8/4.9/4.10 Regression] Wrong warnings "array subscript is above array bounds"
  2013-11-14  0:44 [Bug tree-optimization/59124] New: [4.8 Regression] Wrong warnings "array subscript is above array bounds" d.g.gorbachev at gmail dot com
                   ` (3 preceding siblings ...)
  2014-03-12 14:33 ` jakub at gcc dot gnu.org
@ 2014-05-22  9:03 ` rguenth at gcc dot gnu.org
  2014-12-19 13:25 ` [Bug tree-optimization/59124] [4.8/4.9/5 " jakub at gcc dot gnu.org
                   ` (24 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-05-22  9:03 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.8.3                       |4.8.4

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 4.8.3 is being released, adjusting target milestone.


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

* [Bug tree-optimization/59124] [4.8/4.9/5 Regression] Wrong warnings "array subscript is above array bounds"
  2013-11-14  0:44 [Bug tree-optimization/59124] New: [4.8 Regression] Wrong warnings "array subscript is above array bounds" d.g.gorbachev at gmail dot com
                   ` (4 preceding siblings ...)
  2014-05-22  9:03 ` [Bug tree-optimization/59124] [4.8/4.9/4.10 " rguenth at gcc dot gnu.org
@ 2014-12-19 13:25 ` jakub at gcc dot gnu.org
  2015-01-27  9:50 ` rguenth at gcc dot gnu.org
                   ` (23 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-12-19 13:25 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.8.4                       |4.8.5

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 4.8.4 has been released.


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

* [Bug tree-optimization/59124] [4.8/4.9/5 Regression] Wrong warnings "array subscript is above array bounds"
  2013-11-14  0:44 [Bug tree-optimization/59124] New: [4.8 Regression] Wrong warnings "array subscript is above array bounds" d.g.gorbachev at gmail dot com
                   ` (5 preceding siblings ...)
  2014-12-19 13:25 ` [Bug tree-optimization/59124] [4.8/4.9/5 " jakub at gcc dot gnu.org
@ 2015-01-27  9:50 ` rguenth at gcc dot gnu.org
  2015-01-27 10:59 ` rguenth at gcc dot gnu.org
                   ` (22 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-01-27  9:50 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
Author: rguenth
Date: Tue Jan 27 09:49:29 2015
New Revision: 220157

URL: https://gcc.gnu.org/viewcvs?rev=220157&root=gcc&view=rev
Log:
2015-01-27  Richard Biener  <rguenther@suse.de>

    PR tree-optimization/56273
    PR tree-optimization/59124
    PR tree-optimization/64277
    * tree-vrp.c (vrp_finalize): Emit array-bound warnings only
    from the first VRP pass.

    * g++.dg/warn/Warray-bounds-6.C: New testcase.
    * gcc.dg/Warray-bounds-12.c: Likewise.
    * gcc.dg/Warray-bounds-13.c: Likewise.

Added:
    trunk/gcc/testsuite/g++.dg/warn/Warray-bounds-6.C
    trunk/gcc/testsuite/gcc.dg/Warray-bounds-12.c
    trunk/gcc/testsuite/gcc.dg/Warray-bounds-13.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-vrp.c


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

* [Bug tree-optimization/59124] [4.8/4.9/5 Regression] Wrong warnings "array subscript is above array bounds"
  2013-11-14  0:44 [Bug tree-optimization/59124] New: [4.8 Regression] Wrong warnings "array subscript is above array bounds" d.g.gorbachev at gmail dot com
                   ` (6 preceding siblings ...)
  2015-01-27  9:50 ` rguenth at gcc dot gnu.org
@ 2015-01-27 10:59 ` rguenth at gcc dot gnu.org
  2015-02-18  2:22 ` solar-gcc at openwall dot com
                   ` (21 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-01-27 10:59 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> ---
The testcase in comment #2 is fixed for GCC 5 but the original testcase still
warns.


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

* [Bug tree-optimization/59124] [4.8/4.9/5 Regression] Wrong warnings "array subscript is above array bounds"
  2013-11-14  0:44 [Bug tree-optimization/59124] New: [4.8 Regression] Wrong warnings "array subscript is above array bounds" d.g.gorbachev at gmail dot com
                   ` (7 preceding siblings ...)
  2015-01-27 10:59 ` rguenth at gcc dot gnu.org
@ 2015-02-18  2:22 ` solar-gcc at openwall dot com
  2015-02-18  4:37 ` solar-gcc at openwall dot com
                   ` (20 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: solar-gcc at openwall dot com @ 2015-02-18  2:22 UTC (permalink / raw)
  To: gcc-bugs

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

Alexander Peslyak <solar-gcc at openwall dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |solar-gcc at openwall dot com

--- Comment #8 from Alexander Peslyak <solar-gcc at openwall dot com> ---
Here's another testcase:

$ gcc -S -Wall -O2 -funroll-loops testcase.c 
testcase.c: In function 'DES_std_set_key':
testcase.c:14:17: warning: array subscript is above array bounds
[-Warray-bounds]
   while (DES_key[i++]) k += 2;
                 ^

=============== 8< ===============
static int DES_KS_updates;
static char DES_key[16];

void DES_std_set_key(char *key)
{
        int i, j, k, l;

        j = key[0];
        for (k = i = 0; (l = DES_key[i]) && (j = key[i]); i++)
                ;

        if (!j) {
                j = i;
                while (DES_key[i++]) k += 2;
        }

        if (k < j && ++DES_KS_updates) {
        }

        DES_key[0] = key[0];
}
=============== >8 ===============

GCC 4.7.4 and below report no warning, 4.8.0 and 4.9.2 report the warning
above.  Either -O2 -funroll-loops or -O3 result in the warning; simple -O2 does
not.  While i++ could potentially run beyond the end of DES_key[], depending on
what's in DES_key[] and key[], this isn't the case in the program this snippet
is taken from (and simplified), whereas the warning definitively claims "is"
rather than "might be".

For comparison, Dmitry's first testcase (from this bug's description) results
in no warning with -O2 -funroll-loops (but does give the warning to me with
-O3, as reported by Dmitry), whereas his second testcase (from comment 2) also
reports the warning with -O2 -funroll-loops (but not with simple -O2).  I
tested this with 4.9.2.

I hope this is similar enough to add to this bug (same affected versions, one
of the two testcases also affected by -funroll-loops).


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

* [Bug tree-optimization/59124] [4.8/4.9/5 Regression] Wrong warnings "array subscript is above array bounds"
  2013-11-14  0:44 [Bug tree-optimization/59124] New: [4.8 Regression] Wrong warnings "array subscript is above array bounds" d.g.gorbachev at gmail dot com
                   ` (8 preceding siblings ...)
  2015-02-18  2:22 ` solar-gcc at openwall dot com
@ 2015-02-18  4:37 ` solar-gcc at openwall dot com
  2015-02-19 14:14 ` rguenth at gcc dot gnu.org
                   ` (19 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: solar-gcc at openwall dot com @ 2015-02-18  4:37 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Alexander Peslyak <solar-gcc at openwall dot com> ---
(In reply to Alexander Peslyak from comment #8)
> $ gcc -S -Wall -O2 -funroll-loops testcase.c 
> testcase.c: In function 'DES_std_set_key':
> testcase.c:14:17: warning: array subscript is above array bounds

With GCC 5.0.0 20150215, this warning is gone.  I also confirm that Dmitry's
comment #2 warning is gone.  The original one from this bug's description
remains.


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

* [Bug tree-optimization/59124] [4.8/4.9/5 Regression] Wrong warnings "array subscript is above array bounds"
  2013-11-14  0:44 [Bug tree-optimization/59124] New: [4.8 Regression] Wrong warnings "array subscript is above array bounds" d.g.gorbachev at gmail dot com
                   ` (9 preceding siblings ...)
  2015-02-18  4:37 ` solar-gcc at openwall dot com
@ 2015-02-19 14:14 ` rguenth at gcc dot gnu.org
  2015-02-24 13:09 ` rguenth at gcc dot gnu.org
                   ` (18 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-02-19 14:14 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from Richard Biener <rguenth at gcc dot gnu.org> ---
Author: rguenth
Date: Thu Feb 19 14:13:16 2015
New Revision: 220815

URL: https://gcc.gnu.org/viewcvs?rev=220815&root=gcc&view=rev
Log:
2015-02-19  Richard Biener  <rguenther@suse.de>

    Backport from mainline
    2014-12-09  Richard Biener  <rguenther@suse.de>

    PR middle-end/64199
    * fold-const.c (fold_binary_loc): Use TREE_OVERFLOW_P.

    * gcc.dg/torture/pr64199.c: New testcase.

    2015-01-14  Richard Biener  <rguenther@suse.de>

    PR tree-optimization/64493
    PR tree-optimization/64495
    * tree-vect-loop.c (vect_finalize_reduction): For double-reductions
    assign the proper vectorized PHI to the inner loop exit PHIs.

    * gcc.dg/vect/pr64493.c: New testcase.
    * gcc.dg/vect/pr64495.c: Likewise.

    2015-01-27  Richard Biener  <rguenther@suse.de>

    PR tree-optimization/56273
    PR tree-optimization/59124
    PR tree-optimization/64277
    * tree-vrp.c (vrp_finalize): Emit array-bound warnings only
    from the first VRP pass.

    * g++.dg/warn/Warray-bounds-6.C: New testcase.
    * gcc.dg/Warray-bounds-12.c: Likewise.
    * gcc.dg/Warray-bounds-13.c: Likewise.

    2015-02-19  Richard Biener  <rguenther@suse.de>

    Backport from mainline
    2015-01-15  Richard Biener  <rguenther@suse.de>

    PR middle-end/64365
    * tree-data-ref.c (dr_analyze_indices): Make sure that accesses
    for MEM_REF access functions with the same base can never partially
    overlap.

    * gcc.dg/torture/pr64365.c: New testcase.

Added:
    branches/gcc-4_9-branch/gcc/testsuite/g++.dg/warn/Warray-bounds-6.C
    branches/gcc-4_9-branch/gcc/testsuite/gcc.dg/Warray-bounds-12.c
    branches/gcc-4_9-branch/gcc/testsuite/gcc.dg/Warray-bounds-13.c
    branches/gcc-4_9-branch/gcc/testsuite/gcc.dg/torture/pr64199.c
    branches/gcc-4_9-branch/gcc/testsuite/gcc.dg/torture/pr64365.c
    branches/gcc-4_9-branch/gcc/testsuite/gcc.dg/vect/pr64493.c
    branches/gcc-4_9-branch/gcc/testsuite/gcc.dg/vect/pr64495.c
Modified:
    branches/gcc-4_9-branch/gcc/ChangeLog
    branches/gcc-4_9-branch/gcc/fold-const.c
    branches/gcc-4_9-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_9-branch/gcc/tree-data-ref.c
    branches/gcc-4_9-branch/gcc/tree-vect-loop.c
    branches/gcc-4_9-branch/gcc/tree-vrp.c


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

* [Bug tree-optimization/59124] [4.8/4.9/5 Regression] Wrong warnings "array subscript is above array bounds"
  2013-11-14  0:44 [Bug tree-optimization/59124] New: [4.8 Regression] Wrong warnings "array subscript is above array bounds" d.g.gorbachev at gmail dot com
                   ` (10 preceding siblings ...)
  2015-02-19 14:14 ` rguenth at gcc dot gnu.org
@ 2015-02-24 13:09 ` rguenth at gcc dot gnu.org
  2015-04-16 12:14 ` [Bug tree-optimization/59124] [4.8/4.9/5/6 " georgmueller at gmx dot net
                   ` (17 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-02-24 13:09 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 from Richard Biener <rguenth at gcc dot gnu.org> ---
Author: rguenth
Date: Tue Feb 24 12:49:11 2015
New Revision: 220939

URL: https://gcc.gnu.org/viewcvs?rev=220939&root=gcc&view=rev
Log:
2015-02-24  Richard Biener  <rguenther@suse.de>

        Backport from mainline
        2015-01-27  Richard Biener  <rguenther@suse.de>

    PR tree-optimization/56273
    PR tree-optimization/59124
    PR tree-optimization/64277
    * tree-vrp.c (vrp_finalize): Emit array-bound warnings only
    from the first VRP pass.

    * g++.dg/warn/Warray-bounds-6.C: New testcase.
    * gcc.dg/Warray-bounds-12.c: Likewise.
    * gcc.dg/Warray-bounds-13.c: Likewise.

Added:
    branches/gcc-4_8-branch/gcc/testsuite/g++.dg/warn/Warray-bounds-6.C
    branches/gcc-4_8-branch/gcc/testsuite/gcc.dg/Warray-bounds-12.c
    branches/gcc-4_8-branch/gcc/testsuite/gcc.dg/Warray-bounds-13.c
Modified:
    branches/gcc-4_8-branch/gcc/ChangeLog
    branches/gcc-4_8-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_8-branch/gcc/tree-vrp.c


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

* [Bug tree-optimization/59124] [4.8/4.9/5/6 Regression] Wrong warnings "array subscript is above array bounds"
  2013-11-14  0:44 [Bug tree-optimization/59124] New: [4.8 Regression] Wrong warnings "array subscript is above array bounds" d.g.gorbachev at gmail dot com
                   ` (11 preceding siblings ...)
  2015-02-24 13:09 ` rguenth at gcc dot gnu.org
@ 2015-04-16 12:14 ` georgmueller at gmx dot net
  2015-05-26 15:34 ` georgmueller at gmx dot net
                   ` (16 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: georgmueller at gmx dot net @ 2015-04-16 12:14 UTC (permalink / raw)
  To: gcc-bugs

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

Georg Müller <georgmueller at gmx dot net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |georgmueller at gmx dot net

--- Comment #12 from Georg Müller <georgmueller at gmx dot net> ---
gcc --version
gcc (GCC) 5.0.1 20150413 (Red Hat 5.0.1-0.1)


When compiling the first example with -fopt-info, I see the following
difference between -O2 -funroll-loops and -O3:

gcc -Wall -Wextra -fopt-info -O2 -c 1.c -funroll-loops
1.c:11:5: note: loop turned into non-loop; it never loops.
1.c:11:5: note: loop with 6 iterations completely unrolled
1.c:10:3: note: loop turned into non-loop; it never loops.
1.c:10:3: note: loop with 5 iterations completely unrolled


gcc -Wall -Wextra -fopt-info -O3 -c 1.c -funroll-loops
1.c:11:5: note: loop turned into non-loop; it never loops.
1.c:11:5: note: loop with 7 iterations completely unrolled
1.c: In function 'foo':
1.c:12:23: warning: array subscript is above array bounds [-Warray-bounds]
       bar[j - 1] = baz[j - 1];
                       ^
1.c:12:23: warning: array subscript is above array bounds [-Warray-bounds]
1.c:10:3: note: loop turned into non-loop; it never loops.
1.c:10:3: note: loop with 5 iterations completely unrolled

So, -O2 unrolls 6 and 5 iterations, while -O3 unrolls 7 and 5.
>From gcc-bugs-return-483796-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Apr 16 12:25:33 2015
Return-Path: <gcc-bugs-return-483796-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 21027 invoked by alias); 16 Apr 2015 12:25:33 -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 20953 invoked by uid 48); 16 Apr 2015 12:25:29 -0000
From: "amacleod at redhat dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/65697] __atomic memory barriers not strong enough for __sync builtins
Date: Thu, 16 Apr 2015 12:25:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: target
X-Bugzilla-Version: 5.0
X-Bugzilla-Keywords: wrong-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: amacleod at redhat dot com
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: mwahab at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-65697-4-oKQOW6XDEp@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-65697-4@http.gcc.gnu.org/bugzilla/>
References: <bug-65697-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: 2015-04/txt/msg01348.txt.bz2
Content-length: 2313

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

--- Comment #34 from Andrew Macleod <amacleod at redhat dot com> ---
> However, I guess some people relying on data races in their programs could
> (mis?)understand the __sync_lock_release semantics to mean that it is a
> means to get the equivalent of a C11 release *fence* -- which it is not
> because the fence would apply to the (erroneously non-atomic) store after
> the barrier, which could one lead to believe that if one observes the store
> after the barrier, the fence must also be in effect.  Thoughts?

before we get too carried away, maybe we should return to what we *think*
__sync are suppose to do. It represents a specific definition by intel.. From
the original documentation for __sync "back in the day", and all legacy uses of
sync should expect this behaviour:


"The following builtins are intended to be compatible with those described
in the "Intel Itanium Processor-specific Application Binary Interface",
section 7.4.  As such, they depart from the normal GCC practice of using
the ``__builtin_'' prefix, and further that they are overloaded such that
they work on multiple types."

The definition of "barrier" from that documentation is :

acquire barrier : Disallows the movement of memory references to visible data
from before the intrinsic (in program order) to after the intrinsic (this
behavior is desirable at lock-release operations, hence the name).

release barrier: Disallows the movement of memory references to visible data
from after the intrinsic (in program order) to before the intrinsic (this
behavior is desirable at lock-acquire operations, hence the name).

full barrier: disallows the movement of memory references to visible data past
the intrinsic (in either direction), and is thus both an acquire and a release
barrier. A barrier only restricts the movement of memory references to visible
data across the intrinsic operation: between synchronization operations (or in
their absence), memory references to visible data may be freely reordered
subject to the usual data-dependence constraints.

Caution: Conditional execution of a synchronization intrinsic (such as within
an if or a while statement) does not prevent the movement of memory references
to visible data past the overall if or while construct.


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

* [Bug tree-optimization/59124] [4.8/4.9/5/6 Regression] Wrong warnings "array subscript is above array bounds"
  2013-11-14  0:44 [Bug tree-optimization/59124] New: [4.8 Regression] Wrong warnings "array subscript is above array bounds" d.g.gorbachev at gmail dot com
                   ` (12 preceding siblings ...)
  2015-04-16 12:14 ` [Bug tree-optimization/59124] [4.8/4.9/5/6 " georgmueller at gmx dot net
@ 2015-05-26 15:34 ` georgmueller at gmx dot net
  2015-06-01 23:49 ` daniel at imperfectcode dot com
                   ` (15 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: georgmueller at gmx dot net @ 2015-05-26 15:34 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #13 from Georg Müller <georgmueller at gmx dot net> ---
This bug is causing dpdk build failures on my fedora 22 machine:

git clone git://dpdk.org/dpdk
cd dpdk
make config T=x86_64-native-linuxapp-gcc
make

[...]
.../dpdk/lib/librte_eal/linuxapp/eal/eal_memory.c:1193:35: error: array
subscript is above array bounds [-Werror=array-bounds]
      internal_config.hugepage_info[j].hugepage_sz) {
                                   ^
.../dpdk/lib/librte_eal/linuxapp/eal/eal_memory.c:1198:34: error: array
subscript is above array bounds [-Werror=array-bounds]
     internal_config.hugepage_info[j].num_pages[socket]++;
                                  ^
.../dpdk/lib/librte_eal/linuxapp/eal/eal_memory.c:1198:34: error: array
subscript is above array bounds [-Werror=array-bounds]
[...]

(fix is to disable -Werror, but it I had no problems with fedora 22 (gcc
4.9.2))
>From gcc-bugs-return-487319-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue May 26 15:39:00 2015
Return-Path: <gcc-bugs-return-487319-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 23613 invoked by alias); 26 May 2015 15:39:00 -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 23564 invoked by uid 48); 26 May 2015 15:38:46 -0000
From: "georgmueller at gmx dot net" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/59124] [4.8/4.9/5/6 Regression] Wrong warnings "array subscript is above array bounds"
Date: Tue, 26 May 2015 15:39:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: tree-optimization
X-Bugzilla-Version: 4.8.3
X-Bugzilla-Keywords: diagnostic
X-Bugzilla-Severity: normal
X-Bugzilla-Who: georgmueller at gmx dot net
X-Bugzilla-Status: NEW
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P2
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.8.5
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-59124-4-GaSVvEUbXn@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-59124-4@http.gcc.gnu.org/bugzilla/>
References: <bug-59124-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-05/txt/msg02159.txt.bz2
Content-length: 234

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

--- Comment #14 from Georg Müller <georgmueller at gmx dot net> ---
sorry, a small typo in the last line of the last message: there was no problem
with fedora 21, not 22...
>From gcc-bugs-return-487320-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue May 26 15:44:36 2015
Return-Path: <gcc-bugs-return-487320-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 39034 invoked by alias); 26 May 2015 15:44:36 -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 38961 invoked by uid 48); 26 May 2015 15:44:29 -0000
From: "ysrumyan at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/66142] Loop is not vectorized because not sufficient support for GOMP_SIMD_LANE
Date: Tue, 26 May 2015 15:44:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: tree-optimization
X-Bugzilla-Version: 6.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: ysrumyan at gmail dot com
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Resolution: FIXED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-66142-4-qwMjZngcvV@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-66142-4@http.gcc.gnu.org/bugzilla/>
References: <bug-66142-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: 2015-05/txt/msg02160.txt.bz2
Content-length: 193

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

--- Comment #13 from Yuri Rumyantsev <ysrumyan at gmail dot com> ---
Original test-case is not vectorized yet with Richard patch for sccvn.


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

* [Bug tree-optimization/59124] [4.8/4.9/5/6 Regression] Wrong warnings "array subscript is above array bounds"
  2013-11-14  0:44 [Bug tree-optimization/59124] New: [4.8 Regression] Wrong warnings "array subscript is above array bounds" d.g.gorbachev at gmail dot com
                   ` (13 preceding siblings ...)
  2015-05-26 15:34 ` georgmueller at gmx dot net
@ 2015-06-01 23:49 ` daniel at imperfectcode dot com
  2015-06-23  8:16 ` rguenth at gcc dot gnu.org
                   ` (14 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: daniel at imperfectcode dot com @ 2015-06-01 23:49 UTC (permalink / raw)
  To: gcc-bugs

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

daniel at imperfectcode dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |daniel at imperfectcode dot com

--- Comment #15 from daniel at imperfectcode dot com ---
FYI, I'm seeing a similar error on Arch Linux using 5.1.0.
== Build lib/librte_eal/linuxapp/eal
  CC eal.o
  CC eal_hugepage_info.o
  CC eal_memory.o
.../dpdk-2.0.0/lib/librte_eal/linuxapp/eal/eal_memory.c: In function
‘rte_eal_hugepage_init’:
.../dpdk-2.0.0/lib/librte_eal/linuxapp/eal/eal_memory.c:1193:35: error: array
subscript is above array bounds [-Werror=array-bounds]
      internal_config.hugepage_info[j].hugepage_sz) {
                                   ^
.../dpdk-2.0.0/lib/librte_eal/linuxapp/eal/eal_memory.c:1198:34: error: array
subscript is above array bounds [-Werror=array-bounds]
     internal_config.hugepage_info[j].num_pages[socket]++;
                                  ^
.../dpdk-2.0.0/lib/librte_eal/linuxapp/eal/eal_memory.c:1198:34: error: array
subscript is above array bounds [-Werror=array-bounds]
cc1: all warnings being treated as errors
.../dpdk-2.0.0/mk/internal/rte.compile-pre.mk:126: recipe for target
'eal_memory.o' failed
[...]
>From gcc-bugs-return-487764-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Jun 02 00:11:04 2015
Return-Path: <gcc-bugs-return-487764-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 21290 invoked by alias); 2 Jun 2015 00:11:04 -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 21255 invoked by uid 48); 2 Jun 2015 00:11:00 -0000
From: "chrisloonam at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug objc/66367] Objective-C Variadic Method Not Compiling
Date: Tue, 02 Jun 2015 00:11:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: objc
X-Bugzilla-Version: 5.1.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: enhancement
X-Bugzilla-Who: chrisloonam at gmail dot com
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
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:
Message-ID: <bug-66367-4-FUBoPQwAsq@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-66367-4@http.gcc.gnu.org/bugzilla/>
References: <bug-66367-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: 2015-06/txt/msg00096.txt.bz2
Content-length: 251

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

--- Comment #2 from Chris Loonam <chrisloonam at gmail dot com> ---
I think that being able to use `id` as an argument to va_arg is the expected
behavior, not an extension provided by the compiler.


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

* [Bug tree-optimization/59124] [4.8/4.9/5/6 Regression] Wrong warnings "array subscript is above array bounds"
  2013-11-14  0:44 [Bug tree-optimization/59124] New: [4.8 Regression] Wrong warnings "array subscript is above array bounds" d.g.gorbachev at gmail dot com
                   ` (14 preceding siblings ...)
  2015-06-01 23:49 ` daniel at imperfectcode dot com
@ 2015-06-23  8:16 ` rguenth at gcc dot gnu.org
  2015-06-26 19:53 ` [Bug tree-optimization/59124] [4.9/5/6 " jakub at gcc dot gnu.org
                   ` (13 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-06-23  8:16 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.8.5                       |4.9.3

--- Comment #16 from Richard Biener <rguenth at gcc dot gnu.org> ---
The gcc-4_8-branch is being closed, re-targeting regressions to 4.9.3.


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

* [Bug tree-optimization/59124] [4.9/5/6 Regression] Wrong warnings "array subscript is above array bounds"
  2013-11-14  0:44 [Bug tree-optimization/59124] New: [4.8 Regression] Wrong warnings "array subscript is above array bounds" d.g.gorbachev at gmail dot com
                   ` (15 preceding siblings ...)
  2015-06-23  8:16 ` rguenth at gcc dot gnu.org
@ 2015-06-26 19:53 ` jakub at gcc dot gnu.org
  2015-06-26 20:26 ` jakub at gcc dot gnu.org
                   ` (12 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-06-26 19:53 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #17 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 4.9.3 has been released.


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

* [Bug tree-optimization/59124] [4.9/5/6 Regression] Wrong warnings "array subscript is above array bounds"
  2013-11-14  0:44 [Bug tree-optimization/59124] New: [4.8 Regression] Wrong warnings "array subscript is above array bounds" d.g.gorbachev at gmail dot com
                   ` (16 preceding siblings ...)
  2015-06-26 19:53 ` [Bug tree-optimization/59124] [4.9/5/6 " jakub at gcc dot gnu.org
@ 2015-06-26 20:26 ` jakub at gcc dot gnu.org
  2015-09-10 21:04 ` pangbw at gmail dot com
                   ` (11 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-06-26 20:26 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.9.3                       |4.9.4


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

* [Bug tree-optimization/59124] [4.9/5/6 Regression] Wrong warnings "array subscript is above array bounds"
  2013-11-14  0:44 [Bug tree-optimization/59124] New: [4.8 Regression] Wrong warnings "array subscript is above array bounds" d.g.gorbachev at gmail dot com
                   ` (17 preceding siblings ...)
  2015-06-26 20:26 ` jakub at gcc dot gnu.org
@ 2015-09-10 21:04 ` pangbw at gmail dot com
  2015-09-11  0:29 ` manu at gcc dot gnu.org
                   ` (10 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: pangbw at gmail dot com @ 2015-09-10 21:04 UTC (permalink / raw)
  To: gcc-bugs

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

baoshan <pangbw at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pangbw at gmail dot com

--- Comment #18 from baoshan <pangbw at gmail dot com> ---
I see this issue on 5.2.0 too:

cat test.c
unsigned baz[6];
void test(unsigned *bar, unsigned n) {
     unsigned i, j;
     if (n > 6) {
          n = 6;
     }
     for (i = 1; i < n; i++) {
          for (j = i - 1; j > 0; j--) {
               bar[j - 1] = baz[j - 1];
          }
     }
}
bpg@ala-bpg-lx1$./cross/bin/arm-linux-gnueabi-gcc -c -Wall -O3 test.c
test.c: In function ‘test’:
test.c:9:32: warning: array subscript is above array bounds [-Warray-bounds]
                bar[j - 1] = baz[j - 1];
                                ^
test.c:9:32: warning: array subscript is above array bounds [-Warray-bounds]
bpg@ala-bpg-lx1$./cross/bin/arm-linux-gnueabi-gcc -v
Using built-in specs.
COLLECT_GCC=./cross/bin/arm-linux-gnueabi-gcc
COLLECT_LTO_WRAPPER=/net/ala-rsu-lx1/ala-rsu-lx11/bpg/SHARE/GCC520/X_520/cross/libexec/gcc/arm-linux-gnueabi/5.2.0/lto-wrapper
Target: arm-linux-gnueabi
Configured with: ../gcc-5.2.0/configure
--prefix=/net/ala-rsu-lx1/ala-rsu-lx11/bpg/SHARE/GCC520/X_520/cross
--target=arm-linux-gnueabi --enable-languages=c,c++ --d\
isable-multilib
Thread model: posix
gcc version 5.2.0 (GCC)
>From gcc-bugs-return-496917-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Sep 10 21:05:36 2015
Return-Path: <gcc-bugs-return-496917-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 90131 invoked by alias); 10 Sep 2015 21:05:36 -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 90091 invoked by uid 48); 10 Sep 2015 21:05:33 -0000
From: "fxcoudert at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/67531] FAIL: gfortran.dg/ieee/large_2.f90   -O0  execution test
Date: Thu, 10 Sep 2015 21:05:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: fortran
X-Bugzilla-Version: 6.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: fxcoudert at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
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:
Message-ID: <bug-67531-4-EXKqpq350E@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-67531-4@http.gcc.gnu.org/bugzilla/>
References: <bug-67531-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: 2015-09/txt/msg00895.txt.bz2
Content-length: 852

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

--- Comment #1 from Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> ---
Thanks for the report. So apparently, on powerpc64le-unknown-linux-gnu, long
double division of 1.0L by 3.0L with rounding mode set to "down" is incorrect.

Can you compile and run the following C test case?

$ cat z.c
#include <fenv.h>
#include <stdio.h>

int main (void)
{
  long double x1, x2, x;

  fesetround (FE_UPWARD);
  x1 = 1;
  x = 3;
  x1 = x1 / x;

  fesetround (FE_DOWNWARD);
  x2 = 1;
  x = 3;
  x2 = x2 / x;

  printf ("%.40Lg\n", x1);
  printf ("%.40Lg\n", x2);
}
$ gcc z.c -lm && ./a.out
0.3333333333333333333423683514373792036167
0.3333333333333333333152632971252415927665


Above is the result on x86_64-linux, so the outcome shouldn't be identical, but
the two numbers output should not be equal.


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

* [Bug tree-optimization/59124] [4.9/5/6 Regression] Wrong warnings "array subscript is above array bounds"
  2013-11-14  0:44 [Bug tree-optimization/59124] New: [4.8 Regression] Wrong warnings "array subscript is above array bounds" d.g.gorbachev at gmail dot com
                   ` (18 preceding siblings ...)
  2015-09-10 21:04 ` pangbw at gmail dot com
@ 2015-09-11  0:29 ` manu at gcc dot gnu.org
  2015-09-11 16:13 ` pangbw at gmail dot com
                   ` (9 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: manu at gcc dot gnu.org @ 2015-09-11  0:29 UTC (permalink / raw)
  To: gcc-bugs

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

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |manu at gcc dot gnu.org

--- Comment #20 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
(In reply to baoshan from comment #19)
> We can see the value of up_sub is represented as unsigned int value
> 4294967291 which is really weird to me, it suppose to be a int value -5 here.

All counters are unsigned. You can see what code looks like to GCC at exactly
that moment by using -fdump-tree-all-all-lineno and looking for that line in
test.c.079t.vrp1. 

;;   basic block 10, loop depth 1, count 0, freq 1430, maybe hot
;;   Invalid sum of incoming frequencies 1226, should be 1430
;;    prev block 9, next block 11, flags: (NEW, REACHABLE)
;;    pred:       9 [85.7%]  (TRUE_VALUE,EXECUTABLE)
;;   starting at line 9
  [test.c:9:13] # RANGE [4294967291, 4294967295]
  _51 = i_2 + 4294967290;
  [test.c:9:10] # RANGE [4294967291, 4294967295] NONZERO 4294967295
  _52 = (long unsigned intD.10) _51;
  [test.c:9:10] # RANGE [17179869164, 17179869180] NONZERO 17179869180
  _53 = _52 * 4;
  [test.c:9:10] # PT = nonlocal
  _54 = bar_12(D) + _53;
  [test.c:9:23] # VUSE <.MEM_48>
  _55 = [test.c:9:23] bazD.1755[_51];
  [test.c:9:18] # .MEM_56 = VDEF <.MEM_48>
  [test.c:9:10] *_54 = _55;
  [test.c:9:13] # RANGE [4294967290, 4294967294]
  _59 = i_2 + 4294967289;
  [test.c:9:10] # RANGE [4294967290, 4294967294] NONZERO 4294967295
  _60 = (long unsigned intD.10) _59;
  [test.c:9:10] # RANGE [17179869160, 17179869176] NONZERO 17179869180
  _61 = _60 * 4;
  [test.c:9:10] # PT = nonlocal
  _62 = bar_12(D) + _61;
  [test.c:9:23] # VUSE <.MEM_56>
  _63 = [test.c:9:23] bazD.1755[_59];
  [test.c:9:18] # .MEM_64 = VDEF <.MEM_56>
  [test.c:9:10] *_62 = _63;
;;    succ:       11 [100.0%]  (FALLTHRU,EXECUTABLE)

It seems GCC at some moment unrolls the loop and creates such block with those
ranges. Probably, the block is unreachable, but it would be better to not
create it in the first place. Finding out where and why it is created would
help to figure out a fix.
>From gcc-bugs-return-496932-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Sep 11 02:59:44 2015
Return-Path: <gcc-bugs-return-496932-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 62818 invoked by alias); 11 Sep 2015 02:59:44 -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 62794 invoked by uid 48); 11 Sep 2015 02:59:39 -0000
From: "Casey at Carter dot net" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/67545] New: [concepts] Failure to properly substitute template parameters into requires-clause
Date: Fri, 11 Sep 2015 02:59:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 6.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: Casey at Carter dot net
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
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 target_milestone attachments.created
Message-ID: <bug-67545-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-09/txt/msg00910.txt.bz2
Content-length: 1813

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

            Bug ID: 67545
           Summary: [concepts] Failure to properly substitute template
                    parameters into requires-clause
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: Casey at Carter dot net
  Target Milestone: ---

Created attachment 36323
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36323&action=edit
Preprocessed test case

r227603 fails to compile this correct TU:

#include <stl2/detail/swap.hpp>

struct I {
  int operator*() const;
};

template <class R>
using Ref = decltype(*std::declval<R>());

template <class U = I>
  requires !__stl2::Swappable<Ref<I>, Ref<I>>()
static constexpr bool bar() { return true; }

template <class U = I>
  requires !__stl2::Swappable<Ref<U>, Ref<U>>()
static constexpr bool foo() { return true; }

static_assert(bar()); // Fine
static_assert(foo()); // Error

with error:

~/gcc6/bin/g++ -std=gnu++1z -I ~/cmcstl2/include -I ~/cmcstl2/meta/include
foo.cpp -c
foo.cpp:19:19: error: cannot call function ‘constexpr bool foo() [with U = I]’
 static_assert(foo()); // Error
                   ^
foo.cpp:16:23: note:   constraints not satisfied
 static constexpr bool foo() { return true; }
                       ^
foo.cpp:16:23: note:   ‘! Swappable<Ref<U>, Ref<U> >()’ evaluated to false

Despite the fact that the requirements on foo and bar are functionally
equivalent, the call to bar succeeds whilst the call to `bar` fails to compile.
I conjecture that the substitution of template parameters into foo's requires
clause is not working correctly.
>From gcc-bugs-return-496933-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Sep 11 04:50:47 2015
Return-Path: <gcc-bugs-return-496933-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 49846 invoked by alias); 11 Sep 2015 04:50:46 -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 49778 invoked by uid 48); 11 Sep 2015 04:50:43 -0000
From: "ismail at i10z dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug bootstrap/67363] [6 Regression] r227188 breaks build for mingw-w64
Date: Fri, 11 Sep 2015 04:50:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: bootstrap
X-Bugzilla-Version: 6.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: ismail at i10z dot com
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Resolution: FIXED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: dmalcolm at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 6.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status resolution
Message-ID: <bug-67363-4-ZH6FXoutNM@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-67363-4@http.gcc.gnu.org/bugzilla/>
References: <bug-67363-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-09/txt/msg00911.txt.bz2
Content-length: 542

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

İsmail Dönmez <ismail at i10z dot com> changed:

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

--- Comment #18 from İsmail Dönmez <ismail at i10z dot com> ---
(In reply to John David Anglin from comment #17)
> Fixed on hppa*-*-hpux*.

Also fixes mingw-w64, thank you!
>From gcc-bugs-return-496934-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Sep 11 05:16:19 2015
Return-Path: <gcc-bugs-return-496934-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 74199 invoked by alias); 11 Sep 2015 05:16:19 -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 74136 invoked by uid 48); 11 Sep 2015 05:16:09 -0000
From: "pault at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/66993] Spurious ambiguous symbol error with submodules
Date: Fri, 11 Sep 2015 05:16:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: fortran
X-Bugzilla-Version: unknown
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: pault at gcc dot gnu.org
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Resolution: FIXED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: pault at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status resolution
Message-ID: <bug-66993-4-XzwHyDNMJo@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-66993-4@http.gcc.gnu.org/bugzilla/>
References: <bug-66993-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: 2015-09/txt/msg00912.txt.bz2
Content-length: 558

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

Paul Thomas <pault at gcc dot gnu.org> changed:

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

--- Comment #3 from Paul Thomas <pault at gcc dot gnu.org> ---
Closed on trunk.

Thanks for the report, Mikael! I should have thought of this particular
implication of host association myself....

Cheers

Paul


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

* [Bug tree-optimization/59124] [4.9/5/6 Regression] Wrong warnings "array subscript is above array bounds"
  2013-11-14  0:44 [Bug tree-optimization/59124] New: [4.8 Regression] Wrong warnings "array subscript is above array bounds" d.g.gorbachev at gmail dot com
                   ` (19 preceding siblings ...)
  2015-09-11  0:29 ` manu at gcc dot gnu.org
@ 2015-09-11 16:13 ` pangbw at gmail dot com
  2015-09-11 16:51 ` manu at gcc dot gnu.org
                   ` (8 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: pangbw at gmail dot com @ 2015-09-11 16:13 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #21 from baoshan <pangbw at gmail dot com> ---
(In reply to Manuel López-Ibáñez from comment #20)
> (In reply to baoshan from comment #19)
> > We can see the value of up_sub is represented as unsigned int value
> > 4294967291 which is really weird to me, it suppose to be a int value -5 here.
> 
> All counters are unsigned. You can see what code looks like to GCC at
> exactly that moment by using -fdump-tree-all-all-lineno and looking for that
> line in test.c.079t.vrp1. 
> 
> ;;   basic block 10, loop depth 1, count 0, freq 1430, maybe hot
> ;;   Invalid sum of incoming frequencies 1226, should be 1430
> ;;    prev block 9, next block 11, flags: (NEW, REACHABLE)
> ;;    pred:       9 [85.7%]  (TRUE_VALUE,EXECUTABLE)
> ;;   starting at line 9
>   [test.c:9:13] # RANGE [4294967291, 4294967295]
>   _51 = i_2 + 4294967290;
>   [test.c:9:10] # RANGE [4294967291, 4294967295] NONZERO 4294967295
>   _52 = (long unsigned intD.10) _51;
>   [test.c:9:10] # RANGE [17179869164, 17179869180] NONZERO 17179869180
>   _53 = _52 * 4;
>   [test.c:9:10] # PT = nonlocal
>   _54 = bar_12(D) + _53;
>   [test.c:9:23] # VUSE <.MEM_48>
>   _55 = [test.c:9:23] bazD.1755[_51];
>   [test.c:9:18] # .MEM_56 = VDEF <.MEM_48>
>   [test.c:9:10] *_54 = _55;
>   [test.c:9:13] # RANGE [4294967290, 4294967294]
>   _59 = i_2 + 4294967289;
>   [test.c:9:10] # RANGE [4294967290, 4294967294] NONZERO 4294967295
>   _60 = (long unsigned intD.10) _59;
>   [test.c:9:10] # RANGE [17179869160, 17179869176] NONZERO 17179869180
>   _61 = _60 * 4;
>   [test.c:9:10] # PT = nonlocal
>   _62 = bar_12(D) + _61;
>   [test.c:9:23] # VUSE <.MEM_56>
>   _63 = [test.c:9:23] bazD.1755[_59];
>   [test.c:9:18] # .MEM_64 = VDEF <.MEM_56>
>   [test.c:9:10] *_62 = _63;
> ;;    succ:       11 [100.0%]  (FALLTHRU,EXECUTABLE)
> 
> It seems GCC at some moment unrolls the loop and creates such block with
> those ranges. Probably, the block is unreachable, but it would be better to
> not create it in the first place. Finding out where and why it is created
> would help to figure out a fix.

Don't you think the range value is strange? how it is possible the range value
is so big according the code?
>From gcc-bugs-return-496999-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Sep 11 16:40:00 2015
Return-Path: <gcc-bugs-return-496999-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 109298 invoked by alias); 11 Sep 2015 16:40:00 -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 108937 invoked by uid 48); 11 Sep 2015 16:39:56 -0000
From: "hjl.tools at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug lto/67548] [5/6 Regression] LTO drops weak binding with "ld -r"
Date: Fri, 11 Sep 2015 16:40:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: lto
X-Bugzilla-Version: 6.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: hjl.tools at gmail dot com
X-Bugzilla-Status: NEW
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 5.3
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-67548-4-zTn6NujzED@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-67548-4@http.gcc.gnu.org/bugzilla/>
References: <bug-67548-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: 2015-09/txt/msg00977.txt.bz2
Content-length: 1410

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

--- Comment #3 from H.J. Lu <hjl.tools at gmail dot com> ---
We have

enum ld_plugin_symbol_resolution
{
  LDPR_UNKNOWN = 0,

  /* Symbol is still undefined at this point.  */
  LDPR_UNDEF,

  /* This is the prevailing definition of the symbol, with references from
     regular object code.  */
  LDPR_PREVAILING_DEF,

  /* This is the prevailing definition of the symbol, with no
     references from regular objects.  It is only referenced from IR
     code.  */
  LDPR_PREVAILING_DEF_IRONLY,

  /* This definition was pre-empted by a definition in a regular
     object file.  */
  LDPR_PREEMPTED_REG,

  /* This definition was pre-empted by a definition in another IR file.  */
  LDPR_PREEMPTED_IR,

  /* This symbol was resolved by a definition in another IR file.  */
  LDPR_RESOLVED_IR,

  /* This symbol was resolved by a definition in a regular object
     linked into the main executable.  */
  LDPR_RESOLVED_EXEC,

  /* This symbol was resolved by a definition in a shared object.  */
  LDPR_RESOLVED_DYN,

  /* This is the prevailing definition of the symbol, with no
     references from regular objects.  It is only referenced from IR
     code, but the symbol is exported and may be referenced from
     a dynamic object (not seen at link time).  */
  LDPR_PREVAILING_DEF_IRONLY_EXP
};

None of them is applicable to a weakdef with "ld -r".


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

* [Bug tree-optimization/59124] [4.9/5/6 Regression] Wrong warnings "array subscript is above array bounds"
  2013-11-14  0:44 [Bug tree-optimization/59124] New: [4.8 Regression] Wrong warnings "array subscript is above array bounds" d.g.gorbachev at gmail dot com
                   ` (20 preceding siblings ...)
  2015-09-11 16:13 ` pangbw at gmail dot com
@ 2015-09-11 16:51 ` manu at gcc dot gnu.org
  2015-09-17 18:18 ` pangbw at gmail dot com
                   ` (7 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: manu at gcc dot gnu.org @ 2015-09-11 16:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #22 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
(In reply to baoshan from comment #21)
> Don't you think the range value is strange? how it is possible the range
> value is so big according the code?

j = i - 1 is actually j = i + 4294967295 because of unsigned.

Thus the problematic ranges:

   [test.c:9:13] # RANGE [4294967291, 4294967295]
   _51 = i_2 + 4294967290;

 are actually:

   [test.c:9:13] # RANGE [-5, -1]
   _51 = i_2 - 6;

but this code should have not been generated. Those ranges do seem suspicious.
Finding out how that block ends up with those ranges would be helpful. You
probably need to debug vrp or (using -fopt-info) the point where gcc gives:

test.c:7:3: note: loop turned into non-loop; it never loops.
test.c:7:3: note: loop with 5 iterations completely unrolled
>From gcc-bugs-return-497003-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Sep 11 17:00:30 2015
Return-Path: <gcc-bugs-return-497003-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 68157 invoked by alias); 11 Sep 2015 17:00:30 -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 67049 invoked by uid 48); 11 Sep 2015 17:00:26 -0000
From: "glisse at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/67553] Saturating SSE/AVX instructions do not get optimized
Date: Fri, 11 Sep 2015 17:00:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: rtl-optimization
X-Bugzilla-Version: 5.2.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: enhancement
X-Bugzilla-Who: glisse at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Resolution:
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_status cf_reconfirmed_on component everconfirmed
Message-ID: <bug-67553-4-yHlfx0iEXc@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-67553-4@http.gcc.gnu.org/bugzilla/>
References: <bug-67553-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: 2015-09/txt/msg00981.txt.bz2
Content-length: 606

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

Marc Glisse <glisse at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-09-11
          Component|middle-end                  |rtl-optimization
     Ever confirmed|0                           |1

--- Comment #1 from Marc Glisse <glisse at gcc dot gnu.org> ---
Looks like SS_PLUS and SS_MINUS are missing in the constant folding code...


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

* [Bug tree-optimization/59124] [4.9/5/6 Regression] Wrong warnings "array subscript is above array bounds"
  2013-11-14  0:44 [Bug tree-optimization/59124] New: [4.8 Regression] Wrong warnings "array subscript is above array bounds" d.g.gorbachev at gmail dot com
                   ` (21 preceding siblings ...)
  2015-09-11 16:51 ` manu at gcc dot gnu.org
@ 2015-09-17 18:18 ` pangbw at gmail dot com
  2015-09-17 19:02 ` pangbw at gmail dot com
                   ` (6 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: pangbw at gmail dot com @ 2015-09-17 18:18 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #23 from baoshan <pangbw at gmail dot com> ---
(In reply to Manuel López-Ibáñez from comment #22)
> (In reply to baoshan from comment #21)
> > Don't you think the range value is strange? how it is possible the range
> > value is so big according the code?
> 
> j = i - 1 is actually j = i + 4294967295 because of unsigned.
> 
> Thus the problematic ranges:
> 
>    [test.c:9:13] # RANGE [4294967291, 4294967295]
>    _51 = i_2 + 4294967290;
> 
>  are actually:
> 
>    [test.c:9:13] # RANGE [-5, -1]
>    _51 = i_2 - 6;
> 
> but this code should have not been generated. Those ranges do seem
> suspicious. Finding out how that block ends up with those ranges would be
> helpful. You probably need to debug vrp or (using -fopt-info) the point
> where gcc gives:
> 
> test.c:7:3: note: loop turned into non-loop; it never loops.
> test.c:7:3: note: loop with 5 iterations completely unrolled

I have seen two places that would convert "A-1" to "A+(-1)", and due the type
is unsigned int, it would be converted to "A+4294967295". This looks not right
to me.

The two places are:
1. fold-const.c:10626
      /* A - B -> A + (-B) if B is easily negatable.  */
      if (negate_expr_p (arg1)
          && !TYPE_OVERFLOW_SANITIZED (type)
          && ((FLOAT_TYPE_P (type)
               /* Avoid this transformation if B is a positive REAL_CST.  */
               && (TREE_CODE (arg1) != REAL_CST
                   ||  REAL_VALUE_NEGATIVE (TREE_REAL_CST (arg1))))
              || INTEGRAL_TYPE_P (type)))
=>      return fold_build2_loc (loc, PLUS_EXPR, type,
                            fold_convert_loc (loc, type, arg0),
                            fold_convert_loc (loc, type,
                                              negate_expr (arg1)));

2. c-common.c:4574
  if (resultcode == MINUS_EXPR)
    intop = fold_build1_loc (loc, NEGATE_EXPR, sizetype, intop);
>From gcc-bugs-return-497437-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Sep 17 18:42:56 2015
Return-Path: <gcc-bugs-return-497437-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 28140 invoked by alias); 17 Sep 2015 18:42:56 -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 27910 invoked by uid 48); 17 Sep 2015 18:42:52 -0000
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/59124] [4.9/5/6 Regression] Wrong warnings "array subscript is above array bounds"
Date: Thu, 17 Sep 2015 18:42:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: tree-optimization
X-Bugzilla-Version: 4.8.3
X-Bugzilla-Keywords: diagnostic
X-Bugzilla-Severity: normal
X-Bugzilla-Who: pinskia at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P2
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.9.4
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-59124-4-HQCCX0LESh@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-59124-4@http.gcc.gnu.org/bugzilla/>
References: <bug-59124-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: 2015-09/txt/msg01415.txt.bz2
Content-length: 433

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

--- Comment #24 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to baoshan from comment #23)
> I have seen two places that would convert "A-1" to "A+(-1)", and due the
> type is unsigned int, it would be converted to "A+4294967295". This looks
> not right to me.

Why wrapping is well defined for unsigned types so adding 4294967295 is the
same as subtracting by 1.


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

* [Bug tree-optimization/59124] [4.9/5/6 Regression] Wrong warnings "array subscript is above array bounds"
  2013-11-14  0:44 [Bug tree-optimization/59124] New: [4.8 Regression] Wrong warnings "array subscript is above array bounds" d.g.gorbachev at gmail dot com
                   ` (22 preceding siblings ...)
  2015-09-17 18:18 ` pangbw at gmail dot com
@ 2015-09-17 19:02 ` pangbw at gmail dot com
  2015-09-18 17:59 ` pangbw at gmail dot com
                   ` (5 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: pangbw at gmail dot com @ 2015-09-17 19:02 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #25 from baoshan <pangbw at gmail dot com> ---
(In reply to Andrew Pinski from comment #24)
> (In reply to baoshan from comment #23)
> > I have seen two places that would convert "A-1" to "A+(-1)", and due the
> > type is unsigned int, it would be converted to "A+4294967295". This looks
> > not right to me.
> 
> Why wrapping is well defined for unsigned types so adding 4294967295 is the
> same as subtracting by 1.

What is wrapping? and where it is defined? I don't know this part and I like to
learn it.
Thanks.


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

* [Bug tree-optimization/59124] [4.9/5/6 Regression] Wrong warnings "array subscript is above array bounds"
  2013-11-14  0:44 [Bug tree-optimization/59124] New: [4.8 Regression] Wrong warnings "array subscript is above array bounds" d.g.gorbachev at gmail dot com
                   ` (23 preceding siblings ...)
  2015-09-17 19:02 ` pangbw at gmail dot com
@ 2015-09-18 17:59 ` pangbw at gmail dot com
  2015-09-18 18:32 ` manu at gcc dot gnu.org
                   ` (4 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: pangbw at gmail dot com @ 2015-09-18 17:59 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #27 from baoshan <pangbw at gmail dot com> ---
> It seems GCC at some moment unrolls the loop and creates such block with
> those ranges. Probably, the block is unreachable, but it would be better to
> not create it in the first place. Finding out where and why it is created
> would help to figure out a fix.


At pass "cunrolli", it would unroll the loops according the estimated iterate
times. The problem is at this time it use array ref(infer_loop_bounds_from_ref)
to infer the iterate times which is not accurate. The inaccurate iterate times
result the extra blocks.

I am not sure which way to go at this point. Should we add value range
propagation in/before "cunrolli" so we can get the accurate iterate times? or
We just disable the warning being reported at "vrp" pass?


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

* [Bug tree-optimization/59124] [4.9/5/6 Regression] Wrong warnings "array subscript is above array bounds"
  2013-11-14  0:44 [Bug tree-optimization/59124] New: [4.8 Regression] Wrong warnings "array subscript is above array bounds" d.g.gorbachev at gmail dot com
                   ` (24 preceding siblings ...)
  2015-09-18 17:59 ` pangbw at gmail dot com
@ 2015-09-18 18:32 ` manu at gcc dot gnu.org
  2015-09-18 19:17 ` manu at gcc dot gnu.org
                   ` (3 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: manu at gcc dot gnu.org @ 2015-09-18 18:32 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #28 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
(In reply to baoshan from comment #27)
> > It seems GCC at some moment unrolls the loop and creates such block with
> > those ranges. Probably, the block is unreachable, but it would be better to
> > not create it in the first place. Finding out where and why it is created
> > would help to figure out a fix.
> 
> 
> At pass "cunrolli", it would unroll the loops according the estimated
> iterate times. The problem is at this time it use array
> ref(infer_loop_bounds_from_ref) to infer the iterate times which is not
> accurate. The inaccurate iterate times result the extra blocks.

The question is why is it inaccurate? Note that cunrolli says:


Statement _14 = baz[_9];
 is executed at most 5 (bounded by 5) + 1 times in loop 2.
Loop 2 iterates at most 6 times.
Analyzing # of iterations of loop 2
  exit condition [i_2 + 4294967295, + , 4294967295] != 0
  bounds on difference of bases: -4294967295 ... 0
Applying pattern match.pd:71, generic-match.c:9500
  result:
    # of iterations i_2 + 4294967295, bounded by 4294967295
Estimating sizes for loop 2
 BB: 7, after_exit: 0
  size:   2 if (j_3 != 0)
   Exit condition will be eliminated in last copy.
 BB: 6, after_exit: 1
  size:   1 _9 = j_3 + 4294967295;
  size:   0 _10 = (long unsigned int) _9;
Applying pattern match.pd:71, generic-match.c:9500
Applying pattern match.pd:136, generic-match.c:6019
  size:   1 _11 = _10 * 4;
Applying pattern match.pd:71, generic-match.c:9500
Applying pattern match.pd:136, generic-match.c:6019
  size:   1 _13 = bar_12(D) + _11;
  size:   1 _14 = baz[_9];
  size:   1 *_13 = _14;
size: 7-0, last_iteration: 2-2
  Loop size: 7
  Estimated size after unrolling: 28
pr59124.c:8:5: note: loop turned into non-loop; it never loops.
pr59124.c:8:5: note: loop with 7 iterations completely unrolled
Last iteration exit edge was proved true.
Forced statement unreachable: _14 = baz[_9];


However, it is clear that _14 = baz[_9] is executed only 5 times (not 5 times +
1). Why is this estimate wrong?
>From gcc-bugs-return-497534-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Sep 18 18:53:24 2015
Return-Path: <gcc-bugs-return-497534-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 11657 invoked by alias); 18 Sep 2015 18:53:24 -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 9437 invoked by uid 48); 18 Sep 2015 18:53:20 -0000
From: "pangbw at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/59124] [4.9/5/6 Regression] Wrong warnings "array subscript is above array bounds"
Date: Fri, 18 Sep 2015 18:53:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: tree-optimization
X-Bugzilla-Version: 4.8.3
X-Bugzilla-Keywords: diagnostic
X-Bugzilla-Severity: normal
X-Bugzilla-Who: pangbw at gmail dot com
X-Bugzilla-Status: NEW
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P2
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.9.4
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-59124-4-AF85ZgoiXK@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-59124-4@http.gcc.gnu.org/bugzilla/>
References: <bug-59124-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: 2015-09/txt/msg01512.txt.bz2
Content-length: 378

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

--- Comment #29 from baoshan <pangbw at gmail dot com> ---

> However, it is clear that _14 = baz[_9] is executed only 5 times (not 5
> times + 1). Why is this estimate wrong?

The max value of n is 6, so the max value of i is 5 as "i < n", then the max
value of j is 4 as "j = i - 1" which means the max iterate times is 4.


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

* [Bug tree-optimization/59124] [4.9/5/6 Regression] Wrong warnings "array subscript is above array bounds"
  2013-11-14  0:44 [Bug tree-optimization/59124] New: [4.8 Regression] Wrong warnings "array subscript is above array bounds" d.g.gorbachev at gmail dot com
                   ` (25 preceding siblings ...)
  2015-09-18 18:32 ` manu at gcc dot gnu.org
@ 2015-09-18 19:17 ` manu at gcc dot gnu.org
  2015-09-18 21:11 ` pangbw at gmail dot com
                   ` (2 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: manu at gcc dot gnu.org @ 2015-09-18 19:17 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #30 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
(In reply to baoshan from comment #29)
> > However, it is clear that _14 = baz[_9] is executed only 5 times (not 5
> > times + 1). Why is this estimate wrong?
> 
> The max value of n is 6, so the max value of i is 5 as "i < n", then the max
> value of j is 4 as "j = i - 1" which means the max iterate times is 4.

True! Well, that reinforces my point that something is very wrong in the
estimation. What is it?
>From gcc-bugs-return-497537-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Sep 18 19:30:43 2015
Return-Path: <gcc-bugs-return-497537-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 1552 invoked by alias); 18 Sep 2015 19:30:37 -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 802 invoked by uid 48); 18 Sep 2015 19:30:30 -0000
From: "kargl at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/67615] ICE on using arithmetic if with array instead of scalar
Date: Fri, 18 Sep 2015 19:30:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: fortran
X-Bugzilla-Version: 5.2.1
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: kargl at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Resolution:
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: cc
Message-ID: <bug-67615-4-UM14IuJi2g@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-67615-4@http.gcc.gnu.org/bugzilla/>
References: <bug-67615-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: 2015-09/txt/msg01515.txt.bz2
Content-length: 1210

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

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kargl at gcc dot gnu.org

--- Comment #3 from kargl at gcc dot gnu.org ---
This patch to resolve.c catches the problem.  Watch for
cut-n-paste corruption of tabs.

@@ -10377,12 +10381,11 @@ gfc_resolve_code (gfc_code *code, gfc_na
          }

        case EXEC_ARITHMETIC_IF:
-         if (t
-             && code->expr1->ts.type != BT_INTEGER
-             && code->expr1->ts.type != BT_REAL)
-           gfc_error ("Arithmetic IF statement at %L requires a numeric "
-                      "expression", &code->expr1->where);

+         if (t && (code->expr1->rank > 0 || !gfc_numeric_ts
(&code->expr1->ts)))
+           gfc_error ("Arithmetic IF statement at %L requires a scalar "
+                      "numeric expression", &code->expr1->where);
+
          resolve_branch (code->label1, code);
          resolve_branch (code->label2, code);
          resolve_branch (code->label3, code);

Whoops.  Needs for for BT_COMPLEX.


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

* [Bug tree-optimization/59124] [4.9/5/6 Regression] Wrong warnings "array subscript is above array bounds"
  2013-11-14  0:44 [Bug tree-optimization/59124] New: [4.8 Regression] Wrong warnings "array subscript is above array bounds" d.g.gorbachev at gmail dot com
                   ` (26 preceding siblings ...)
  2015-09-18 19:17 ` manu at gcc dot gnu.org
@ 2015-09-18 21:11 ` pangbw at gmail dot com
  2015-09-22 20:06 ` pangbw at gmail dot com
  2021-01-05  9:14 ` [Bug tree-optimization/59124] [6 " szotsaki at gmail dot com
  29 siblings, 0 replies; 31+ messages in thread
From: pangbw at gmail dot com @ 2015-09-18 21:11 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #31 from baoshan <pangbw at gmail dot com> ---
(In reply to Manuel López-Ibáñez from comment #30)
> (In reply to baoshan from comment #29)
> > > However, it is clear that _14 = baz[_9] is executed only 5 times (not 5
> > > times + 1). Why is this estimate wrong?
> > 
> > The max value of n is 6, so the max value of i is 5 as "i < n", then the max
> > value of j is 4 as "j = i - 1" which means the max iterate times is 4.
> 
> True! Well, that reinforces my point that something is very wrong in the
> estimation. What is it?

At the pass "cunrolli", it infers the iterative times by checking the array's
boundary, as we have "unsigned baz[6];", it would think the max value of
iterative times is 6.
>From gcc-bugs-return-497545-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Sep 18 21:39:25 2015
Return-Path: <gcc-bugs-return-497545-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 28079 invoked by alias); 18 Sep 2015 21:39:25 -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 28053 invoked by uid 48); 18 Sep 2015 21:39:21 -0000
From: "trippels at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/67631] brace initialization bug
Date: Fri, 18 Sep 2015 21:39:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 6.0
X-Bugzilla-Keywords: rejects-valid
X-Bugzilla-Severity: normal
X-Bugzilla-Who: trippels at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Resolution:
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: keywords bug_status cf_reconfirmed_on cc everconfirmed cf_known_to_fail
Message-ID: <bug-67631-4-r1FvW8vlI4@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-67631-4@http.gcc.gnu.org/bugzilla/>
References: <bug-67631-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-09/txt/msg01523.txt.bz2
Content-length: 1233

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

Markus Trippelsdorf <trippels at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-09-18
                 CC|                            |trippels at gcc dot gnu.org
     Ever confirmed|0                           |1
      Known to fail|                            |4.9.2, 5.2.1, 6.0

--- Comment #1 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
markus@x4 tmp % cat bra.ii
class X
{
public:
  X (int);
  explicit operator unsigned ();
};
unsigned
foo ()
{
  return unsigned{ X (0) };
}
markus@x4 tmp % icpc -Wall -Wextra -c -std=c++14 bra.ii
markus@x4 tmp % clang++ -Wall -Wextra -c -std=c++14 bra.ii
markus@x4 tmp % g++ -Wall -Wextra -c -std=c++14 bra.ii
bra.ii: In function ‘unsigned int foo()’:
bra.ii:10:26: error: cannot convert ‘X’ to ‘unsigned int’ in initialization
   return unsigned{ X (0) };
                          ^
>From gcc-bugs-return-497546-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Sep 18 21:48:54 2015
Return-Path: <gcc-bugs-return-497546-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 35629 invoked by alias); 18 Sep 2015 21:48:54 -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 35596 invoked by uid 48); 18 Sep 2015 21:48:50 -0000
From: "trippels at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/67632] explicit instantiation omits copy constructor and others
Date: Fri, 18 Sep 2015 21:48:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 4.9.2
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: trippels at gcc dot gnu.org
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Resolution: WORKSFORME
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_status cc resolution
Message-ID: <bug-67632-4-kfkisqgTv2@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-67632-4@http.gcc.gnu.org/bugzilla/>
References: <bug-67632-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: 2015-09/txt/msg01524.txt.bz2
Content-length: 572

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

Markus Trippelsdorf <trippels at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |trippels at gcc dot gnu.org
         Resolution|---                         |WORKSFORME

--- Comment #1 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
I cannot reproduce this issue with 4.9.3. Please update.


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

* [Bug tree-optimization/59124] [4.9/5/6 Regression] Wrong warnings "array subscript is above array bounds"
  2013-11-14  0:44 [Bug tree-optimization/59124] New: [4.8 Regression] Wrong warnings "array subscript is above array bounds" d.g.gorbachev at gmail dot com
                   ` (27 preceding siblings ...)
  2015-09-18 21:11 ` pangbw at gmail dot com
@ 2015-09-22 20:06 ` pangbw at gmail dot com
  2021-01-05  9:14 ` [Bug tree-optimization/59124] [6 " szotsaki at gmail dot com
  29 siblings, 0 replies; 31+ messages in thread
From: pangbw at gmail dot com @ 2015-09-22 20:06 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #32 from baoshan <pangbw at gmail dot com> ---
(In reply to Manuel López-Ibáñez from comment #30)
> (In reply to baoshan from comment #29)
> > > However, it is clear that _14 = baz[_9] is executed only 5 times (not 5
> > > times + 1). Why is this estimate wrong?
> > 
> > The max value of n is 6, so the max value of i is 5 as "i < n", then the max
> > value of j is 4 as "j = i - 1" which means the max iterate times is 4.
> 
> True! Well, that reinforces my point that something is very wrong in the
> estimation. What is it?

And I think it is not wrong, it's just inaccurate, and it is not making any
wrong result in running time.

Can you point me how to proceed?
>From gcc-bugs-return-497831-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Sep 22 20:44:21 2015
Return-Path: <gcc-bugs-return-497831-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 84558 invoked by alias); 22 Sep 2015 20:44:21 -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 84511 invoked by uid 48); 22 Sep 2015 20:44:17 -0000
From: "manu at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/59124] [4.9/5/6 Regression] Wrong warnings "array subscript is above array bounds"
Date: Tue, 22 Sep 2015 20:44:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: tree-optimization
X-Bugzilla-Version: 4.8.3
X-Bugzilla-Keywords: diagnostic
X-Bugzilla-Severity: normal
X-Bugzilla-Who: manu at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P2
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.9.4
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-59124-4-RdRFSoJP0V@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-59124-4@http.gcc.gnu.org/bugzilla/>
References: <bug-59124-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-09/txt/msg01809.txt.bz2
Content-length: 1028

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

--- Comment #33 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
(In reply to baoshan from comment #32)
> And I think it is not wrong, it's just inaccurate, and it is not making any
> wrong result in running time.
> 
> Can you point me how to proceed?

To be honest, I don't know, since neither loop-unrolling nor VRP are my
speciality. If you can figure out how the estimate can be improved in cunrolli,
that would be great. There are some functions called after that point that seem
to attempt to provide a more accurate estimate. One would need to go through
them carefully in GDB and find out why they fail. 

If itl cannot be fixed here, the info about valid ranges is still inaccurate,
that is, the loop may be unrolled into 6 iterations, but only 4 are ever
executed. There must be a way to teach VRP that this is the case and mark the
blocks as unreachable.

I hope other more knowledgeable devs will chime in, I'm out of ideas.
>From gcc-bugs-return-497832-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Sep 22 21:14:14 2015
Return-Path: <gcc-bugs-return-497832-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 6434 invoked by alias); 22 Sep 2015 21:14:14 -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 6385 invoked by uid 48); 22 Sep 2015 21:14:11 -0000
From: "segher at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/67604] shrink-wrap doesn't allow multiple entries
Date: Tue, 22 Sep 2015 21:14:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: rtl-optimization
X-Bugzilla-Version: unknown
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: segher at gcc dot gnu.org
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Resolution: FIXED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: segher at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status resolution
Message-ID: <bug-67604-4-XbBxPID9l8@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-67604-4@http.gcc.gnu.org/bugzilla/>
References: <bug-67604-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: 2015-09/txt/msg01810.txt.bz2
Content-length: 447

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

Segher Boessenkool <segher at gcc dot gnu.org> changed:

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

--- Comment #2 from Segher Boessenkool <segher at gcc dot gnu.org> ---
Fixed with r228022.


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

* [Bug tree-optimization/59124] [6 Regression] Wrong warnings "array subscript is above array bounds"
  2013-11-14  0:44 [Bug tree-optimization/59124] New: [4.8 Regression] Wrong warnings "array subscript is above array bounds" d.g.gorbachev at gmail dot com
                   ` (28 preceding siblings ...)
  2015-09-22 20:06 ` pangbw at gmail dot com
@ 2021-01-05  9:14 ` szotsaki at gmail dot com
  29 siblings, 0 replies; 31+ messages in thread
From: szotsaki at gmail dot com @ 2021-01-05  9:14 UTC (permalink / raw)
  To: gcc-bugs

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

Szőts Ákos <szotsaki at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |szotsaki at gmail dot com

--- Comment #48 from Szőts Ákos <szotsaki at gmail dot com> ---
An addendum to the true positive test case in Comment 41:

I have tested it with GCC 10.2.1 and it seems the warning is no more emitted,
therefore that specific issue also got fixed.

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

end of thread, other threads:[~2021-01-05  9:14 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-14  0:44 [Bug tree-optimization/59124] New: [4.8 Regression] Wrong warnings "array subscript is above array bounds" d.g.gorbachev at gmail dot com
2013-11-14  9:51 ` [Bug tree-optimization/59124] [4.8/4.9 " rguenth at gcc dot gnu.org
2013-11-14 17:56 ` d.g.gorbachev at gmail dot com
2013-11-21 14:39 ` rguenth at gcc dot gnu.org
2014-03-12 14:33 ` jakub at gcc dot gnu.org
2014-05-22  9:03 ` [Bug tree-optimization/59124] [4.8/4.9/4.10 " rguenth at gcc dot gnu.org
2014-12-19 13:25 ` [Bug tree-optimization/59124] [4.8/4.9/5 " jakub at gcc dot gnu.org
2015-01-27  9:50 ` rguenth at gcc dot gnu.org
2015-01-27 10:59 ` rguenth at gcc dot gnu.org
2015-02-18  2:22 ` solar-gcc at openwall dot com
2015-02-18  4:37 ` solar-gcc at openwall dot com
2015-02-19 14:14 ` rguenth at gcc dot gnu.org
2015-02-24 13:09 ` rguenth at gcc dot gnu.org
2015-04-16 12:14 ` [Bug tree-optimization/59124] [4.8/4.9/5/6 " georgmueller at gmx dot net
2015-05-26 15:34 ` georgmueller at gmx dot net
2015-06-01 23:49 ` daniel at imperfectcode dot com
2015-06-23  8:16 ` rguenth at gcc dot gnu.org
2015-06-26 19:53 ` [Bug tree-optimization/59124] [4.9/5/6 " jakub at gcc dot gnu.org
2015-06-26 20:26 ` jakub at gcc dot gnu.org
2015-09-10 21:04 ` pangbw at gmail dot com
2015-09-11  0:29 ` manu at gcc dot gnu.org
2015-09-11 16:13 ` pangbw at gmail dot com
2015-09-11 16:51 ` manu at gcc dot gnu.org
2015-09-17 18:18 ` pangbw at gmail dot com
2015-09-17 19:02 ` pangbw at gmail dot com
2015-09-18 17:59 ` pangbw at gmail dot com
2015-09-18 18:32 ` manu at gcc dot gnu.org
2015-09-18 19:17 ` manu at gcc dot gnu.org
2015-09-18 21:11 ` pangbw at gmail dot com
2015-09-22 20:06 ` pangbw at gmail dot com
2021-01-05  9:14 ` [Bug tree-optimization/59124] [6 " szotsaki at gmail dot com

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).