[LLVMbugs] [Bug 1780] instcombine crash

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Thu Nov 8 09:40:58 PST 2007


http://llvm.org/bugs/show_bug.cgi?id=1780


Andrew Lenharth <alenhar2 at uiuc.edu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




--- Comment #3 from Andrew Lenharth <alenhar2 at uiuc.edu>  2007-11-08 11:40:57 ---
Thanks for the further reduction.

I think your patch is overkill.

--- lib/Transforms/Scalar/InstructionCombining.cpp      (revision 43891)
+++ lib/Transforms/Scalar/InstructionCombining.cpp      (working copy)
@@ -7582,7 +7582,7 @@
                                            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

Should do it.

Since align is already 0 and there is no initializer, it will return zero with
just that change.

closed.

http://llvm.org/viewvc/llvm-project?rev=43893&view=rev


-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list