[llvm-commits] CVS: llvm/include/llvm/ADT/SmallVector.h

Andrew Lenharth andrewl at lenharth.org
Mon Oct 9 12:56:40 PDT 2006


> This compiled on my 3.4.6 compiler on Linux just fine before the patch.
> What was the error you were trying to fix?

"Allignment Value not constant" was the error. This was gcc 3.4.4

> Are you sure this is right?  In section 5.31 of the GCC Manual it
> indicates that if an alignment size is not given with the aligned
> attribute keyword then it defaults to:
>
> "the maximum useful alignment for the target machine you are compiling
> for. Whenever you leave out the alignment factor in an `aligned'
> attribute specification, the compiler automatically sets the alignment
> for the declared variable or field to the largest alignment which is
> ever used for any data type on the target machine you are compiling
> for".
>
> Is this what we want here?

I believe so.  The alignment of that field needs to be sufficient for
any data type put there.  The non-gcc version does that with a union.
My reading of the gcc manual is that without a value, this attribute
does exactly that (and since doubles are not always the most
constrained types, vectors tend to be, this is more general, though I
doubt altivec vectors are going to be used directly by LLVM in small
vectors anytime soon).

Andrew



More information about the llvm-commits mailing list