public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/60505] New: Warning caused by GCC vectorizer.
@ 2014-03-11 22:01 congh at google dot com
  2014-03-11 22:27 ` [Bug tree-optimization/60505] " congh at google dot com
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: congh at google dot com @ 2014-03-11 22:01 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 60505
           Summary: Warning caused by GCC vectorizer.
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: congh at google dot com

The compilation on the code below fails with options "-Wall  -Werror -O2
-ftree-loop-vectorize". The reason is that the epilogue generated by the
vectorizer tries to access the memory outside of ovec[16] and the the vrp pass
emits the warning "array subscript is above array bounds" for the access to
ovec[i]. The vectorizer should not generate the epilogue for this loop.



void foo(char *in, char *out, int num)
{
 int i;
 unsigned char ovec[16] = {0};

 for(i=0; i < num ; ++i)
   out[i] = (ovec[i] = in[i]);
 out[num] = ovec[num/2];
}


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

* [Bug tree-optimization/60505] Warning caused by GCC vectorizer.
  2014-03-11 22:01 [Bug tree-optimization/60505] New: Warning caused by GCC vectorizer congh at google dot com
@ 2014-03-11 22:27 ` congh at google dot com
  2014-03-12  9:21 ` rguenth at gcc dot gnu.org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: congh at google dot com @ 2014-03-11 22:27 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Cong Hou <congh at google dot com> ---
Google ref: b/13403465


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

* [Bug tree-optimization/60505] Warning caused by GCC vectorizer.
  2014-03-11 22:01 [Bug tree-optimization/60505] New: Warning caused by GCC vectorizer congh at google dot com
  2014-03-11 22:27 ` [Bug tree-optimization/60505] " congh at google dot com
@ 2014-03-12  9:21 ` rguenth at gcc dot gnu.org
  2014-03-12 10:03 ` jakub at gcc dot gnu.org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-03-12  9:21 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-03-12
     Ever confirmed|0                           |1

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed for the warning.  Note that  'out[num] = ovec[num/2];' at the
end means that num < 16(!) and thus the vectorized loop is never entered
(which means we likely warn for in practice dead code).


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

* [Bug tree-optimization/60505] Warning caused by GCC vectorizer.
  2014-03-11 22:01 [Bug tree-optimization/60505] New: Warning caused by GCC vectorizer congh at google dot com
  2014-03-11 22:27 ` [Bug tree-optimization/60505] " congh at google dot com
  2014-03-12  9:21 ` rguenth at gcc dot gnu.org
@ 2014-03-12 10:03 ` jakub at gcc dot gnu.org
  2014-03-31  8:01 ` [Bug tree-optimization/60505] [4.8/4.9 Regression] " rguenth at gcc dot gnu.org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-03-12 10:03 UTC (permalink / raw)
  To: gcc-bugs

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

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> ---
Why would out[num] = ovec[num/2]; imply num < 16?  The loop implies num <= 16,
and out[num] = ovec[num/2]; just implies num >= 0 && num <= 31.


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

* [Bug tree-optimization/60505] [4.8/4.9 Regression] Warning caused by GCC vectorizer.
  2014-03-11 22:01 [Bug tree-optimization/60505] New: Warning caused by GCC vectorizer congh at google dot com
                   ` (2 preceding siblings ...)
  2014-03-12 10:03 ` jakub at gcc dot gnu.org
@ 2014-03-31  8:01 ` rguenth at gcc dot gnu.org
  2014-03-31  9:43 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-03-31  8:01 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic,
                   |                            |missed-optimization
      Known to work|                            |4.7.3
   Target Milestone|---                         |4.8.3
            Summary|Warning caused by GCC       |[4.8/4.9 Regression]
                   |vectorizer.                 |Warning caused by GCC
                   |                            |vectorizer.


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

* [Bug tree-optimization/60505] [4.8/4.9 Regression] Warning caused by GCC vectorizer.
  2014-03-11 22:01 [Bug tree-optimization/60505] New: Warning caused by GCC vectorizer congh at google dot com
                   ` (3 preceding siblings ...)
  2014-03-31  8:01 ` [Bug tree-optimization/60505] [4.8/4.9 Regression] " rguenth at gcc dot gnu.org
@ 2014-03-31  9:43 ` rguenth at gcc dot gnu.org
  2014-04-03 23:06 ` congh at gcc dot gnu.org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-03-31  9:43 UTC (permalink / raw)
  To: gcc-bugs

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

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

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


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

* [Bug tree-optimization/60505] [4.8/4.9 Regression] Warning caused by GCC vectorizer.
  2014-03-11 22:01 [Bug tree-optimization/60505] New: Warning caused by GCC vectorizer congh at google dot com
                   ` (4 preceding siblings ...)
  2014-03-31  9:43 ` rguenth at gcc dot gnu.org
@ 2014-04-03 23:06 ` congh at gcc dot gnu.org
  2014-04-09 12:36 ` [Bug tree-optimization/60505] [4.8 " jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: congh at gcc dot gnu.org @ 2014-04-03 23:06 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Cong Hou <congh at gcc dot gnu.org> ---
Author: congh
Date: Thu Apr  3 23:05:42 2014
New Revision: 209065

URL: http://gcc.gnu.org/viewcvs?rev=209065&root=gcc&view=rev
Log:
2014-04-03  Cong Hou  <congh@google.com>

PR tree-optimization/60505
    * tree-vectorizer.h (struct _stmt_vec_info): Add th field as the
    threshold of number of iterations below which no vectorization will be
    done.
    * tree-vect-loop.c (new_loop_vec_info):
    Initialize LOOP_VINFO_COST_MODEL_THRESHOLD.
    * tree-vect-loop.c (vect_analyze_loop_operations):
    Set LOOP_VINFO_COST_MODEL_THRESHOLD.
    * tree-vect-loop.c (vect_transform_loop):
    Use LOOP_VINFO_COST_MODEL_THRESHOLD.
    * tree-vect-loop.c (vect_analyze_loop_2): Check the maximum number
    of iterations of the loop and see if we should build the epilogue.

2014-04-03  Cong Hou  <congh@google.com>

    PR tree-optimization/60505
    * gcc.dg/vect/pr60505.c: New test.


Added:
    trunk/gcc/testsuite/gcc.dg/vect/pr60505.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-vect-loop.c
    trunk/gcc/tree-vectorizer.h


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

* [Bug tree-optimization/60505] [4.8 Regression] Warning caused by GCC vectorizer.
  2014-03-11 22:01 [Bug tree-optimization/60505] New: Warning caused by GCC vectorizer congh at google dot com
                   ` (5 preceding siblings ...)
  2014-04-03 23:06 ` congh at gcc dot gnu.org
@ 2014-04-09 12:36 ` jakub at gcc dot gnu.org
  2014-05-22  9:02 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-04-09 12:36 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |4.9.0
            Summary|[4.8/4.9 Regression]        |[4.8 Regression] Warning
                   |Warning caused by GCC       |caused by GCC vectorizer.
                   |vectorizer.                 |
      Known to fail|                            |4.8.2

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed on the trunk.


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

* [Bug tree-optimization/60505] [4.8 Regression] Warning caused by GCC vectorizer.
  2014-03-11 22:01 [Bug tree-optimization/60505] New: Warning caused by GCC vectorizer congh at google dot com
                   ` (6 preceding siblings ...)
  2014-04-09 12:36 ` [Bug tree-optimization/60505] [4.8 " jakub at gcc dot gnu.org
@ 2014-05-22  9:02 ` rguenth at gcc dot gnu.org
  2014-12-19 13:30 ` jakub at gcc dot gnu.org
  2015-06-23  8:48 ` rguenth at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-05-22  9:02 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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


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

* [Bug tree-optimization/60505] [4.8 Regression] Warning caused by GCC vectorizer.
  2014-03-11 22:01 [Bug tree-optimization/60505] New: Warning caused by GCC vectorizer congh at google dot com
                   ` (7 preceding siblings ...)
  2014-05-22  9:02 ` rguenth at gcc dot gnu.org
@ 2014-12-19 13:30 ` jakub at gcc dot gnu.org
  2015-06-23  8:48 ` rguenth at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-12-19 13:30 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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


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

* [Bug tree-optimization/60505] [4.8 Regression] Warning caused by GCC vectorizer.
  2014-03-11 22:01 [Bug tree-optimization/60505] New: Warning caused by GCC vectorizer congh at google dot com
                   ` (8 preceding siblings ...)
  2014-12-19 13:30 ` jakub at gcc dot gnu.org
@ 2015-06-23  8:48 ` rguenth at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-06-23  8:48 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|4.8.5                       |4.9.0
      Known to fail|                            |4.8.5

--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed for 4.9.0.


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

end of thread, other threads:[~2015-06-23  8:48 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-11 22:01 [Bug tree-optimization/60505] New: Warning caused by GCC vectorizer congh at google dot com
2014-03-11 22:27 ` [Bug tree-optimization/60505] " congh at google dot com
2014-03-12  9:21 ` rguenth at gcc dot gnu.org
2014-03-12 10:03 ` jakub at gcc dot gnu.org
2014-03-31  8:01 ` [Bug tree-optimization/60505] [4.8/4.9 Regression] " rguenth at gcc dot gnu.org
2014-03-31  9:43 ` rguenth at gcc dot gnu.org
2014-04-03 23:06 ` congh at gcc dot gnu.org
2014-04-09 12:36 ` [Bug tree-optimization/60505] [4.8 " jakub at gcc dot gnu.org
2014-05-22  9:02 ` rguenth at gcc dot gnu.org
2014-12-19 13:30 ` jakub at gcc dot gnu.org
2015-06-23  8:48 ` rguenth at gcc dot gnu.org

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