public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/25881]  New: unsigned int loop indices are not accepted by the vectorizer
@ 2006-01-20 17:11 David dot Monniaux at ens dot fr
  2006-01-20 17:32 ` [Bug tree-optimization/25881] " pinskia at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: David dot Monniaux at ens dot fr @ 2006-01-20 17:11 UTC (permalink / raw)
  To: gcc-bugs

void vector_add(int n,
                double * __restrict__ r,
                double * __restrict__ a,
                double * __restrict__ b) {
  int i;
  for(i=0; i<n; i++) {
    r[i] = a[i] + b[i];
  }
}

gets vectorized.

If i is of type 'unsigned int', the loop does not get vectorized.


-- 
           Summary: unsigned int loop indices are not accepted by the
                    vectorizer
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: David dot Monniaux at ens dot fr
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


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


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

* [Bug tree-optimization/25881] unsigned int loop indices are not accepted by the vectorizer
  2006-01-20 17:11 [Bug tree-optimization/25881] New: unsigned int loop indices are not accepted by the vectorizer David dot Monniaux at ens dot fr
@ 2006-01-20 17:32 ` pinskia at gcc dot gnu dot org
  2006-01-20 20:43 ` [Bug tree-optimization/25881] unsigned int loop indices don't optimize as good as int or __SIZE_TYPE__ for 64bit targets pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-20 17:32 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement
  GCC build triplet|x86_64-unknown-linux-gnu    |
   GCC host triplet|x86_64-unknown-linux-gnu    |
 GCC target triplet|x86_64-unknown-linux-gnu    |64bits targets


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


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

* [Bug tree-optimization/25881] unsigned int loop indices don't optimize as good as int or __SIZE_TYPE__ for 64bit targets
  2006-01-20 17:11 [Bug tree-optimization/25881] New: unsigned int loop indices are not accepted by the vectorizer David dot Monniaux at ens dot fr
  2006-01-20 17:32 ` [Bug tree-optimization/25881] " pinskia at gcc dot gnu dot org
@ 2006-01-20 20:43 ` pinskia at gcc dot gnu dot org
  2006-01-29 10:10 ` irar at il dot ibm dot com
  2006-10-30  2:46 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-20 20:43 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2006-01-20 20:43 -------
Confirmed, I thought I had saw another bug about this but no luck,  anyways
confirmed.

Hmm, using unsigned short on 32bit targets cause the same issue:
void vector_add(unsigned short n,
                double * __restrict__ r,
                double * __restrict__ a,
                double * __restrict__ b) {
  unsigned short i;
  for(i=0; i<n; i++) {
    r[i] = a[i] + b[i];
  }
}

There more likely other issues like this too.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |missed-optimization
   Last reconfirmed|0000-00-00 00:00:00         |2006-01-20 20:43:27
               date|                            |


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


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

* [Bug tree-optimization/25881] unsigned int loop indices don't optimize as good as int or __SIZE_TYPE__ for 64bit targets
  2006-01-20 17:11 [Bug tree-optimization/25881] New: unsigned int loop indices are not accepted by the vectorizer David dot Monniaux at ens dot fr
  2006-01-20 17:32 ` [Bug tree-optimization/25881] " pinskia at gcc dot gnu dot org
  2006-01-20 20:43 ` [Bug tree-optimization/25881] unsigned int loop indices don't optimize as good as int or __SIZE_TYPE__ for 64bit targets pinskia at gcc dot gnu dot org
@ 2006-01-29 10:10 ` irar at il dot ibm dot com
  2006-10-30  2:46 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: irar at il dot ibm dot com @ 2006-01-29 10:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from irar at il dot ibm dot com  2006-01-29 10:10 -------
Changing double to float, the scalar evolution analyzer returns access function
(float *) ((unsigned int) {0, +, 1}_1 * 4) + (float *) a_12, 
since it fails in type conversion:
(failed conversion:
  type: unsigned int
  base: 0
  step: 
  estimated_nb_iterations: scev_not_known
)
(Without type conversion we get {(float *) a_14, +, 4B}_1).

Data-refs analysis fails to analyze the access pattern, therefore the loop does
not get vectorized.


-- 

irar at il dot ibm dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sebastian dot pop at cri dot
                   |                            |ensmp dot fr, irar at il dot
                   |                            |ibm dot com
   Last reconfirmed|2006-01-20 20:43:27         |2006-01-29 10:10:55
               date|                            |


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


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

* [Bug tree-optimization/25881] unsigned int loop indices don't optimize as good as int or __SIZE_TYPE__ for 64bit targets
  2006-01-20 17:11 [Bug tree-optimization/25881] New: unsigned int loop indices are not accepted by the vectorizer David dot Monniaux at ens dot fr
                   ` (2 preceding siblings ...)
  2006-01-29 10:10 ` irar at il dot ibm dot com
@ 2006-10-30  2:46 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-10-30  2:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pinskia at gcc dot gnu dot org  2006-10-30 02:46 -------
Fixed in 4.2.0.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.2.0


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


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

end of thread, other threads:[~2006-10-30  2:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-20 17:11 [Bug tree-optimization/25881] New: unsigned int loop indices are not accepted by the vectorizer David dot Monniaux at ens dot fr
2006-01-20 17:32 ` [Bug tree-optimization/25881] " pinskia at gcc dot gnu dot org
2006-01-20 20:43 ` [Bug tree-optimization/25881] unsigned int loop indices don't optimize as good as int or __SIZE_TYPE__ for 64bit targets pinskia at gcc dot gnu dot org
2006-01-29 10:10 ` irar at il dot ibm dot com
2006-10-30  2:46 ` pinskia 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).