public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/40927] Code fails to vectorize in g++ but does vectorize in gcc.
       [not found] <bug-40927-4@http.gcc.gnu.org/bugzilla/>
@ 2011-11-05 23:45 ` paolo.carlini at oracle dot com
  0 siblings, 0 replies; 2+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-11-05 23:45 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|gcc-bugs at gcc dot gnu.org |
      Known to work|                            |4.6.2, 4.7.0
         Resolution|                            |FIXED

--- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-11-05 23:44:51 UTC ---
Apparently fixed a lot of time ago, in 4.5.x. Otherwise, please re-open,
thanks.


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

* [Bug c++/40927] Code fails to vectorize in g++ but does vectorize in gcc.
  2009-08-01  0:26 [Bug c++/40927] New: " public at dgmo dot org
@ 2009-08-01 14:58 ` rguenth at gcc dot gnu dot org
  0 siblings, 0 replies; 2+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-08-01 14:58 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from rguenth at gcc dot gnu dot org  2009-08-01 14:58 -------
This is because of the differences in the IL C vs. C++.

C has

    r0 = (short unsigned int) *pcr - (short unsigned int) *ppr;
    r1 = (short unsigned int) *pcg - (short unsigned int) *ppg;
    r2 = (short unsigned int) *pcb - (short unsigned int) *ppb;
    r0 = (r0 >> 8 | 65280) & r0;
    r1 = (r1 >> 8 | 65280) & r1;
    r2 = (r2 >> 8 | 65280) & r2;
        short unsigned int r = (r0 + r1) + r2;
    *n = (*n + r) - (*n >> 5);
    *o = (unsigned char) r;

while C++ does (EH stuff stripped):

r0 = (short unsigned int) *(unsigned char *) pcr - (short unsigned int)
*(unsigned char *) ppr;
r1 = (short unsigned int) *(unsigned char *) pcg - (short unsigned int)
*(unsigned char *) ppg;
r2 = (short unsigned int) *(unsigned char *) pcb - (short unsigned int)
*(unsigned char *) ppb;
r0 = (short unsigned int) (((short int) ((int) r0 >> 8) | -256) & (short int)
r0);
r1 = (short unsigned int) (((short int) ((int) r1 >> 8) | -256) & (short int)
r1);
r2 = (short unsigned int) (((short int) ((int) r2 >> 8) | -256) & (short int)
r2);
r = (r0 + r1) + r2;
*(short unsigned int *) n = (*(short unsigned int *) n + r) - (short unsigned
int) ((int) *(short unsigned int *) n >> 5);
*(unsigned char *) o = (unsigned char) r;

which looks unfolded compared to what C ends up with (the C FE shortens
the BIT_IOR_EXPR to unsigned short, something fold should do instead).


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2009-08-01 14:58:34
               date|                            |


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


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

end of thread, other threads:[~2011-11-05 23:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-40927-4@http.gcc.gnu.org/bugzilla/>
2011-11-05 23:45 ` [Bug c++/40927] Code fails to vectorize in g++ but does vectorize in gcc paolo.carlini at oracle dot com
2009-08-01  0:26 [Bug c++/40927] New: " public at dgmo dot org
2009-08-01 14:58 ` [Bug c++/40927] " rguenth at gcc dot gnu dot 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).