public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/57579] New: Problem with vectorization
@ 2013-06-10 18:26 federico.carminati at cern dot ch
  2013-06-10 19:35 ` [Bug tree-optimization/57579] " paolo.carlini at oracle dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: federico.carminati at cern dot ch @ 2013-06-10 18:26 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 57579
           Summary: Problem with vectorization
           Product: gcc
           Version: 4.8.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: federico.carminati at cern dot ch

Good evening,
   all my apologises if this is a stupid question, however I have a terribly
simple loop


include <math.h>

typedef struct
{
   double x,y,z;
   double dummy;
} P;


void foo(const P * __restrict__ points, double * __restrict__ d)
{
   for(int i=0;i<100;++i) {
      d[i]=points[i].x*points[i].x*points[i].x*points[i].x+
     points[i].y*points[i].y*points[i].y+
     points[i].z*points[i].z*points[i].z;
   }
}

if I compile with

/opt/gcc-4.8.1/bin/g++ -c -std=c++0x -O3 -msse4.1 -Wall -Wstrict-aliasing=2
-ftree-vectorizer-verbose=2

I obtain the diagnostic at the bottom of the page. Is there a place where I can
find an explanation for the g++ vectorizer diagnostic messages? I frankly do
not understand what it is talking about and google does not seem to be willing
to help me this time. Any help in deciphering these messages would be greatly
appreciated. Thanks and sorry for the bother

Analyzing loop at testvec1.cxx:12

testvec1.cxx:12: note: Data access with gaps requires scalar epilogue loop
testvec1.cxx:12: note: vector alignment may not be reachable
testvec1.cxx:12: note: virtual phi. skip.
testvec1.cxx:12: note: not ssa-name.
testvec1.cxx:12: note: use not simple.
testvec1.cxx:12: note: not ssa-name.
testvec1.cxx:12: note: use not simple.
testvec1.cxx:12: note: no array mode for V2DF[4]
testvec1.cxx:12: note: not ssa-name.
testvec1.cxx:12: note: use not simple.
testvec1.cxx:12: note: not ssa-name.
testvec1.cxx:12: note: use not simple.
testvec1.cxx:12: note: no array mode for V2DF[4]
testvec1.cxx:12: note: not ssa-name.
testvec1.cxx:12: note: use not simple.
testvec1.cxx:12: note: not ssa-name.
testvec1.cxx:12: note: use not simple.
testvec1.cxx:12: note: no array mode for V2DF[4]

Vectorizing loop at testvec1.cxx:12

testvec1.cxx:12: note: virtual phi. skip.
testvec1.cxx:12: note: no array mode for V2DF[4]
testvec1.cxx:12: note: no array mode for V2DF[4]
testvec1.cxx:12: note: no array mode for V2DF[4]
testvec1.cxx:10: note: vectorized 1 loops in function.

testvec1.cxx:10: note: not vectorized: not enough data-refs in basic block.

testvec1.cxx:13: note: not vectorized: no vectype for stmt: vect_var_.10_29 =
MEM[(const struct P *)vect_ppoints.6_31];
 scalar_type: const vector(2) double
testvec1.cxx:13: note: Failed to SLP the basic block.
testvec1.cxx:13: note: not vectorized: failed to find SLP opportunities in
basic block.

testvec1.cxx:13: note: Build SLP failed: grouped loads have gaps _59 = _60->x;

testvec1.cxx:13: note: Failed to SLP the basic block.
testvec1.cxx:13: note: not vectorized: failed to find SLP opportunities in
basic block.

testvec1.cxx:10: note: not vectorized: not enough data-refs in basic block.


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

* [Bug tree-optimization/57579] Problem with vectorization
  2013-06-10 18:26 [Bug c++/57579] New: Problem with vectorization federico.carminati at cern dot ch
@ 2013-06-10 19:35 ` paolo.carlini at oracle dot com
  2013-06-11  8:49 ` rguenth at gcc dot gnu.org
  2013-06-11  8:59 ` federico.carminati at cern dot ch
  2 siblings, 0 replies; 4+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-06-10 19:35 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|federico.carminati at cern dot ch  |
          Component|c++                         |tree-optimization

--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> ---
In any case, doesn't look like a C++ front end issue


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

* [Bug tree-optimization/57579] Problem with vectorization
  2013-06-10 18:26 [Bug c++/57579] New: Problem with vectorization federico.carminati at cern dot ch
  2013-06-10 19:35 ` [Bug tree-optimization/57579] " paolo.carlini at oracle dot com
@ 2013-06-11  8:49 ` rguenth at gcc dot gnu.org
  2013-06-11  8:59 ` federico.carminati at cern dot ch
  2 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-06-11  8:49 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Federico Carminati from comment #0)
> Good evening,
>    all my apologises if this is a stupid question, however I have a terribly
> simple loop
> 
> 
> include <math.h>
> 
> typedef struct
> {
>    double x,y,z;
>    double dummy;
> } P;
> 
> 
> void foo(const P * __restrict__ points, double * __restrict__ d)
> {
>    for(int i=0;i<100;++i) {
>       d[i]=points[i].x*points[i].x*points[i].x*points[i].x+
> 	 points[i].y*points[i].y*points[i].y+
> 	 points[i].z*points[i].z*points[i].z;
>    }
> }
>  
> if I compile with
> 
> /opt/gcc-4.8.1/bin/g++ -c -std=c++0x -O3 -msse4.1 -Wall -Wstrict-aliasing=2
> -ftree-vectorizer-verbose=2
> 
> I obtain the diagnostic at the bottom of the page. Is there a place where I
> can find an explanation for the g++ vectorizer diagnostic messages? I
> frankly do not understand what it is talking about and google does not seem
> to be willing to help me this time. Any help in deciphering these messages
> would be greatly appreciated. Thanks and sorry for the bother
> 
> Analyzing loop at testvec1.cxx:12
> 
> testvec1.cxx:12: note: Data access with gaps requires scalar epilogue loop
> testvec1.cxx:12: note: vector alignment may not be reachable
> testvec1.cxx:12: note: virtual phi. skip.
> testvec1.cxx:12: note: not ssa-name.
> testvec1.cxx:12: note: use not simple.
> testvec1.cxx:12: note: not ssa-name.
> testvec1.cxx:12: note: use not simple.
> testvec1.cxx:12: note: no array mode for V2DF[4]
> testvec1.cxx:12: note: not ssa-name.
> testvec1.cxx:12: note: use not simple.
> testvec1.cxx:12: note: not ssa-name.
> testvec1.cxx:12: note: use not simple.
> testvec1.cxx:12: note: no array mode for V2DF[4]
> testvec1.cxx:12: note: not ssa-name.
> testvec1.cxx:12: note: use not simple.
> testvec1.cxx:12: note: not ssa-name.
> testvec1.cxx:12: note: use not simple.
> testvec1.cxx:12: note: no array mode for V2DF[4]
> 
> Vectorizing loop at testvec1.cxx:12

^^^^

the loop is vectorized.

> testvec1.cxx:12: note: virtual phi. skip.
> testvec1.cxx:12: note: no array mode for V2DF[4]
> testvec1.cxx:12: note: no array mode for V2DF[4]
> testvec1.cxx:12: note: no array mode for V2DF[4]
> testvec1.cxx:10: note: vectorized 1 loops in function.
> 
> testvec1.cxx:10: note: not vectorized: not enough data-refs in basic block.
> 
> testvec1.cxx:13: note: not vectorized: no vectype for stmt: vect_var_.10_29
> = MEM[(const struct P *)vect_ppoints.6_31];
>  scalar_type: const vector(2) double
> testvec1.cxx:13: note: Failed to SLP the basic block.
> testvec1.cxx:13: note: not vectorized: failed to find SLP opportunities in
> basic block.
> 
> testvec1.cxx:13: note: Build SLP failed: grouped loads have gaps _59 =
> _60->x;
> 
> testvec1.cxx:13: note: Failed to SLP the basic block.
> testvec1.cxx:13: note: not vectorized: failed to find SLP opportunities in
> basic block.
> 
> testvec1.cxx:10: note: not vectorized: not enough data-refs in basic block.

the rest of the "complaints" are from basic-block vectorization trying to
vectorize the loop body again.  Which of course fails, it is already
vectorized.
>From gcc-bugs-return-424144-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Jun 11 08:52:44 2013
Return-Path: <gcc-bugs-return-424144-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 21372 invoked by alias); 11 Jun 2013 08:52: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 21329 invoked by uid 48); 11 Jun 2013 08:52:38 -0000
From: "nmm1 at cam dot ac.uk" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/57582] New: clone is effectively reserved by <iostream> and should not be
Date: Tue, 11 Jun 2013 08:52:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: libstdc++
X-Bugzilla-Version: unknown
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: nmm1 at cam dot ac.uk
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter
Message-ID: <bug-57582-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: 2013-06/txt/msg00523.txt.bz2
Content-length: 951

http://gcc.gnu.org/bugzilla/show_bug.cgi?idW582

            Bug ID: 57582
           Summary: clone is effectively reserved by <iostream> and should
                    not be
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nmm1 at cam dot ac.uk

This is probably java leaking into C++, or something of that nature.
The word "clone" does not occur in the C++ standard.

Under OpenSUSE 11.1, gcc 4.8.0 fails on the following code:

/home/nmm/GCC/bin/g++ -std=c++11 -Wall -Wextra -c -O3 junk.cpp

#include <iostream>
using namespace std;

class run;
class clone;

class cell {
    cell (clone * c, run * r) {}
};

junk.cpp:8:17: error: expected ')' before '*' token
     cell (clone * c, run * r) {}

Changing clone to clown and removing <iostream> both cure it.


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

* [Bug tree-optimization/57579] Problem with vectorization
  2013-06-10 18:26 [Bug c++/57579] New: Problem with vectorization federico.carminati at cern dot ch
  2013-06-10 19:35 ` [Bug tree-optimization/57579] " paolo.carlini at oracle dot com
  2013-06-11  8:49 ` rguenth at gcc dot gnu.org
@ 2013-06-11  8:59 ` federico.carminati at cern dot ch
  2 siblings, 0 replies; 4+ messages in thread
From: federico.carminati at cern dot ch @ 2013-06-11  8:59 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Federico Carminati <federico.carminati at cern dot ch> ---
Hello Richard,
   thanks a lot!! I would have never figured this out by myself. However let me
repeat my question, is there a place where this can be learnt without relying
on kind (and knowledgeable) souls like you? Thanks!


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

end of thread, other threads:[~2013-06-11  8:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-10 18:26 [Bug c++/57579] New: Problem with vectorization federico.carminati at cern dot ch
2013-06-10 19:35 ` [Bug tree-optimization/57579] " paolo.carlini at oracle dot com
2013-06-11  8:49 ` rguenth at gcc dot gnu.org
2013-06-11  8:59 ` federico.carminati at cern dot ch

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