aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms
diff options
context:
space:
mode:
authorAndrew Lenharth <andrewl@lenharth.org>2007-11-08 17:39:28 +0000
committerAndrew Lenharth <andrewl@lenharth.org>2007-11-08 17:39:28 +0000
commitab9338eb9f18a1303e271ed144f78c29a48ff011 (patch)
tree34a4fb94460ed88beae37fbb30db87e9f76c54a7 /lib/Transforms
parente0cb36b9fb1e1b0de9b46eafd8dc3802122b2e73 (diff)
Fix PR1780
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43893 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/Scalar/InstructionCombining.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp
index 41485b203e..c8d03be2c0 100644
--- a/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -7582,7 +7582,7 @@ static unsigned GetOrEnforceKnownAlignment(Value *V, TargetData *TD,
unsigned PrefAlign = 0) {
if (GlobalVariable *GV = dyn_cast<GlobalVariable>(V)) {
unsigned Align = GV->getAlignment();
- if (Align == 0 && TD)
+ if (Align == 0 && TD && !isa<OpaqueType>(GV->getType()->getElementType()))
Align = TD->getPrefTypeAlignment(GV->getType()->getElementType());
// If there is a large requested alignment and we can, bump up the alignment