public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/49795] New: vectorization of conditional code happens only on local variables
@ 2011-07-20 11:46 vincenzo.innocente at cern dot ch
  2011-07-20 11:58 ` [Bug tree-optimization/49795] " jakub at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: vincenzo.innocente at cern dot ch @ 2011-07-20 11:46 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: vectorization of conditional code happens only on
                    local variables
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: vincenzo.innocente@cern.ch


in this example loop1 does not vectorize, loop2 does 
const int N=64;
float c[N];
float d[N];

void loop1() {
  for (int i=0; i!=N; ++i) {
    if (c[i]<0) d[i] = -d[i];
  }
}

void loop2() {
  for (int i=0; i!=N; ++i) {
    float tmp = d[i];
    if (c[i]<0) tmp = -tmp;
    d[i]=tmp;
  }
}


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

end of thread, other threads:[~2023-08-24  7:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-20 11:46 [Bug tree-optimization/49795] New: vectorization of conditional code happens only on local variables vincenzo.innocente at cern dot ch
2011-07-20 11:58 ` [Bug tree-optimization/49795] " jakub at gcc dot gnu.org
2011-07-20 12:01 ` paolo.carlini at oracle dot com
2011-07-20 12:32 ` vincenzo.innocente at cern dot ch
2011-07-20 12:41 ` jakub at gcc dot gnu.org
2011-07-20 14:54 ` rguenth at gcc dot gnu.org
2011-07-20 17:00 ` vincenzo.innocente at cern dot ch
2023-08-24  7:44 ` pinskia 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).