public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/44183] Vectorizer may generate invalid memory access
       [not found] <bug-44183-4@http.gcc.gnu.org/bugzilla/>
@ 2011-01-31 10:28 ` rguenth at gcc dot gnu.org
  2011-01-31 11:36 ` rguenth at gcc dot gnu.org
  1 sibling, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-01-31 10:28 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-01-31 10:06:27 UTC ---
(In reply to comment #6)
> It depends on the specific values of (a) array end alignment and (b) the number
> of bytes read. As long as the array end + number of bytes read can cross a page
> boundary, you're potentially causing SEGV or other errors.

I don't think this can happen.  The access to the out-of-bounds area only
happens if there are pieces inluded in the last (aligned) vector move.
That vector move will be aligned so it can't cross page-boundary.  As
it contains at least one allocated element the access may not trap.


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

* [Bug tree-optimization/44183] Vectorizer may generate invalid memory access
       [not found] <bug-44183-4@http.gcc.gnu.org/bugzilla/>
  2011-01-31 10:28 ` [Bug tree-optimization/44183] Vectorizer may generate invalid memory access rguenth at gcc dot gnu.org
@ 2011-01-31 11:36 ` rguenth at gcc dot gnu.org
  1 sibling, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-01-31 11:36 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #8 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-01-31 10:51:32 UTC ---
This is a non-bug.  The transformation is ok and will never cause a pagefault.


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

* [Bug tree-optimization/44183] Vectorizer may generate invalid memory access
  2010-05-18  1:22 [Bug tree-optimization/44183] New: " hjl dot tools at gmail dot com
                   ` (4 preceding siblings ...)
  2010-05-20 10:24 ` irar at il dot ibm dot com
@ 2010-05-20 11:07 ` mikpe at it dot uu dot se
  5 siblings, 0 replies; 8+ messages in thread
From: mikpe at it dot uu dot se @ 2010-05-20 11:07 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from mikpe at it dot uu dot se  2010-05-20 11:05 -------
It depends on the specific values of (a) array end alignment and (b) the number
of bytes read. As long as the array end + number of bytes read can cross a page
boundary, you're potentially causing SEGV or other errors.


-- 


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


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

* [Bug tree-optimization/44183] Vectorizer may generate invalid memory access
  2010-05-18  1:22 [Bug tree-optimization/44183] New: " hjl dot tools at gmail dot com
                   ` (3 preceding siblings ...)
  2010-05-20 10:18 ` mikpe at it dot uu dot se
@ 2010-05-20 10:24 ` irar at il dot ibm dot com
  2010-05-20 11:07 ` mikpe at it dot uu dot se
  5 siblings, 0 replies; 8+ messages in thread
From: irar at il dot ibm dot com @ 2010-05-20 10:24 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from irar at il dot ibm dot com  2010-05-20 10:24 -------
Even if we are talking about less than vector size from array boundary? And
that boundary is not (vector) aligned.


-- 


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


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

* [Bug tree-optimization/44183] Vectorizer may generate invalid memory access
  2010-05-18  1:22 [Bug tree-optimization/44183] New: " hjl dot tools at gmail dot com
                   ` (2 preceding siblings ...)
  2010-05-20 10:05 ` irar at il dot ibm dot com
@ 2010-05-20 10:18 ` mikpe at it dot uu dot se
  2010-05-20 10:24 ` irar at il dot ibm dot com
  2010-05-20 11:07 ` mikpe at it dot uu dot se
  5 siblings, 0 replies; 8+ messages in thread
From: mikpe at it dot uu dot se @ 2010-05-20 10:18 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from mikpe at it dot uu dot se  2010-05-20 10:18 -------
(In reply to comment #3)
> I am curious what is the problem with that? These elements are not used, they
> are just loaded... 

An out-of-bounds read can result in a SEGV if the memory is unmapped. Worse
things can happen if the memory is "special" (think kernels and MMIO).


-- 


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


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

* [Bug tree-optimization/44183] Vectorizer may generate invalid memory access
  2010-05-18  1:22 [Bug tree-optimization/44183] New: " hjl dot tools at gmail dot com
  2010-05-20  7:14 ` [Bug tree-optimization/44183] " irar at il dot ibm dot com
  2010-05-20  8:51 ` hjl dot tools at gmail dot com
@ 2010-05-20 10:05 ` irar at il dot ibm dot com
  2010-05-20 10:18 ` mikpe at it dot uu dot se
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: irar at il dot ibm dot com @ 2010-05-20 10:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from irar at il dot ibm dot com  2010-05-20 10:04 -------
I am curious what is the problem with that? These elements are not used, they
are just loaded... 


-- 


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


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

* [Bug tree-optimization/44183] Vectorizer may generate invalid memory access
  2010-05-18  1:22 [Bug tree-optimization/44183] New: " hjl dot tools at gmail dot com
  2010-05-20  7:14 ` [Bug tree-optimization/44183] " irar at il dot ibm dot com
@ 2010-05-20  8:51 ` hjl dot tools at gmail dot com
  2010-05-20 10:05 ` irar at il dot ibm dot com
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: hjl dot tools at gmail dot com @ 2010-05-20  8:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from hjl dot tools at gmail dot com  2010-05-20 08:50 -------
(In reply to comment #1)
> Do you mean that extract_even implementation does something illegal with this
> last element? Misaligned load also accesses elements outside the array, but the
> problem is in extract_even?

Vectorizer generates

vect_var_.12_25 = M*vect_pb.7_23{misalignment: 32};
vect_var_.13_27 = M*vect_pb.7_26{misalignment: 32};

Those may read beyond the end of array. Vectorizer
should check that vect_pb.7_23/vect_pb.7_26 + vector
size < end of array.


-- 


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


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

* [Bug tree-optimization/44183] Vectorizer may generate invalid memory access
  2010-05-18  1:22 [Bug tree-optimization/44183] New: " hjl dot tools at gmail dot com
@ 2010-05-20  7:14 ` irar at il dot ibm dot com
  2010-05-20  8:51 ` hjl dot tools at gmail dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: irar at il dot ibm dot com @ 2010-05-20  7:14 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from irar at il dot ibm dot com  2010-05-20 07:13 -------
Do you mean that extract_even implementation does something illegal with this
last element? Misaligned load also accesses elements outside the array, but the
problem is in extract_even?

Other than doing something in the backend, we can reduce the number of vector
iterations in cases that may access elements outside array bounds for specific
targets...


-- 


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


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

end of thread, other threads:[~2011-01-31 10:51 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-44183-4@http.gcc.gnu.org/bugzilla/>
2011-01-31 10:28 ` [Bug tree-optimization/44183] Vectorizer may generate invalid memory access rguenth at gcc dot gnu.org
2011-01-31 11:36 ` rguenth at gcc dot gnu.org
2010-05-18  1:22 [Bug tree-optimization/44183] New: " hjl dot tools at gmail dot com
2010-05-20  7:14 ` [Bug tree-optimization/44183] " irar at il dot ibm dot com
2010-05-20  8:51 ` hjl dot tools at gmail dot com
2010-05-20 10:05 ` irar at il dot ibm dot com
2010-05-20 10:18 ` mikpe at it dot uu dot se
2010-05-20 10:24 ` irar at il dot ibm dot com
2010-05-20 11:07 ` mikpe at it dot uu dot se

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