[Bug fortran/21622] New: ICE on assumed-shape array with lower bound given by a dummy argument

2005-05-17 Thread dubos at lmd dot polytechnique dot fr
SUBROUTINE Eval(mind,p)
  INTEGER  :: mind
  REAL, DIMENSION(mind:)   :: p
  p(mind)=0
END SUBROUTINE Eval

Works with g95
Fails with : GNU Fortran 95 (GCC 4.1.0 20050517 (experimental)) 
downloaded from http://gcc.gnu.org/wiki/GFortranBinaries

-- 
   Summary: ICE on assumed-shape array with lower bound given by a
dummy argument
   Product: gcc
   Version: 4.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: dubos at lmd dot polytechnique dot fr
CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: gcc version 4.1.0 20050517
  GCC host triplet: i386-linux
GCC target triplet: i386-linux


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


[Bug c++/26654] New: pointers to 16-byte aligned ints are rejected in member functions

2006-03-12 Thread dubos at lmd dot polytechnique dot fr
Compilation of the attached code (adapted from
http://gcc.gnu.org/projects/tree-ssa/vectorization.html
example3) 

* works and vectorizes with gcc-4.0.1
  g++ -O -msse -ftree-vectorizer -c vect.cpp
* works with gcc-4.1.0 and 4.2.0-20060311 if one of the above options is
omitted
  (but does not or not fully vectorize...)
* fails with gcc-4.1.0 and 4.2.0-20060311
  g++ -O -msse -ftree-vectorizer -c vect.cpp
  [...] "alignment of array elements is greater than element size"

I have more examples. I tried on PentiumIV and AMD64. The error is triggered
when a pointer to a 16-byte aligned int (or double, or float) is used as class
member or as a local variable or argument in a member function. It seems that
pointers in member functions are treated as arrays. 

I think this is a bug, since the same code in a C-style function does not
trigger the error. It essentially prevents the use of SSE alignment with C++
and severely limits opportunities for auto-vectorization.

/* begin vect.cpp */
typedef int aint __attribute__ ((__aligned__(16)));

void foo (int n, aint * __restrict__ p, aint * __restrict q) 
{   while (n--) *p++ = *q++;   }

struct toto {
  static void foo (int n, aint * __restrict__ p, aint * __restrict q) 
  {   while (n--)  *p++ = *q++;  }
};

void tata(int n, aint * __restrict__ p, aint * __restrict q)
{
  toto x;
  x.foo(n,p,q);
}
/* end vect.cpp */


-- 
   Summary: pointers to 16-byte aligned ints are rejected in member
functions
   Product: gcc
   Version: 4.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: dubos at lmd dot polytechnique dot fr
  GCC host triplet: i686-pc-linux-gnu


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



[Bug c++/26654] pointers to 16-byte aligned ints are rejected in member functions

2006-03-12 Thread dubos at lmd dot polytechnique dot fr


--- Comment #2 from dubos at lmd dot polytechnique dot fr  2006-03-12 18:42 
---
(In reply to comment #1)
> This comes down to PR 19893.
> 

Thanks for commenting on this. I fully agree that arrays of aint should be
rejected. The point is that there are no arrays here, only pointers.

The error would not come up if arrays of aint were accepted, but this would
only be a workaround. The real question is (well, as far as I understand) : why
does g++ complain about illegal arrays, while in fact there are only pointers
here ?


-- 


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