[llvm-commits] [llvm-gcc-4.2] r46670 - in /llvm-gcc-4.2/trunk/gcc: llvm-backend.cpp llvm-convert.cpp
Duncan Sands
baldrick at free.fr
Sat Feb 2 12:23:28 PST 2008
Author: baldrick
Date: Sat Feb 2 14:23:27 2008
New Revision: 46670
URL: http://llvm.org/viewvc/llvm-project?rev=46670&view=rev
Log:
Use alignment zero if the gcc alignment is less
than the ABI alignment, not just when it is equal
to it.
Modified:
llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp
llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
Modified: llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp?rev=46670&r1=46669&r2=46670&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp Sat Feb 2 14:23:27 2008
@@ -969,7 +969,7 @@
unsigned TargetAlign =
getTargetData().getABITypeAlignment(GV->getType()->getElementType());
if (DECL_USER_ALIGN(decl) ||
- TargetAlign != (unsigned)DECL_ALIGN_UNIT(decl))
+ TargetAlign < (unsigned)DECL_ALIGN_UNIT(decl))
GV->setAlignment(DECL_ALIGN_UNIT(decl));
}
Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=46670&r1=46669&r2=46670&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Sat Feb 2 14:23:27 2008
@@ -1589,7 +1589,7 @@
// 2) DECL_ALIGN is set by user.
if (DECL_ALIGN_UNIT(decl)) {
unsigned TargetAlign = getTargetData().getABITypeAlignment(Ty);
- if (DECL_USER_ALIGN(decl) || TargetAlign != (unsigned)DECL_ALIGN_UNIT(decl))
+ if (DECL_USER_ALIGN(decl) || TargetAlign < (unsigned)DECL_ALIGN_UNIT(decl))
Alignment = DECL_ALIGN_UNIT(decl);
}
More information about the llvm-commits
mailing list