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

Reid Spencer rspencer at reidspencer.com
Mon Oct 9 12:33:16 PDT 2006


Andrew, 
...
On Mon, 2006-10-09 at 14:05 -0500, Andrew Lenharth wrote:
> 
> Changes in directory llvm/include/llvm/ADT:
> 
> SmallVector.h updated: 1.19 -> 1.20
> ---
> Log message:
> 
> Fix build error in gcc 3.4 and make more this general

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

> 
> ---
> Diffs of the changes:  (+1 -1)
> 
>  SmallVector.h |    2 +-
>  1 files changed, 1 insertion(+), 1 deletion(-)
> 
> 
> Index: llvm/include/llvm/ADT/SmallVector.h
> diff -u llvm/include/llvm/ADT/SmallVector.h:1.19 llvm/include/llvm/ADT/SmallVector.h:1.20
> --- llvm/include/llvm/ADT/SmallVector.h:1.19	Sun Oct  8 17:28:34 2006
> +++ llvm/include/llvm/ADT/SmallVector.h	Mon Oct  9 14:05:44 2006
> @@ -35,7 +35,7 @@
>  protected:
>  #ifdef __GNUC__
>    typedef char U;
> -  U FirstEl __attribute__((aligned(__alignof__(double))));
> +  U FirstEl __attribute__((aligned));

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?

Reid.

>  #else
>    union U {
>      double D;
> 
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list