[LLVMbugs] [Bug 14210] New: SROA.cpp:2506 Assertion `LI.getType()->getIntegerBitWidth() == TD.getTypeSizeInBits(OldAI.getAllocatedType()) && "Only alloca-wide loads can be split and recomposed"' failed.

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Oct 30 02:55:40 PDT 2012


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

             Bug #: 14210
           Summary: SROA.cpp:2506 Assertion
                    `LI.getType()->getIntegerBitWidth() ==
                    TD.getTypeSizeInBits(OldAI.getAllocatedType()) &&
                    "Only alloca-wide loads can be split and recomposed"'
                    failed.
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: glider at google.com
                CC: chandlerc at gmail.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Created attachment 9457
  --> http://llvm.org/bugs/attachment.cgi?id=9457
reproducer for the SROA assertion failure

$ clang --versionclang version 3.2 (trunk 167008)
Target: x86_64-unknown-linux-gnu
Thread model: posix

$ clang -cc1 -triple x86_64-unknown-linux-gnu  -O2  -emit-obj   -o RS.o -x c++
RS.ii
RS.ii:8:35: warning: control reaches end of non-void function
  Color backgroundColor() const { }
                                  ^
RS.ii:9:46: warning: control reaches end of non-void function
  Color visitedLinkBackgroundColor() const { }
                                             ^
RS.ii:10:46: warning: control reaches end of non-void function
  Color visitedLinkBorderLeftColor() const { }
                                             ^
clang:
/usr/local/google/asan/asan-llvm-trunk/llvm/lib/Transforms/Scalar/SROA.cpp:2506:
bool<unnamed>::AllocaPartitionRewriter::visitLoadInst(llvm::LoadInst&):
Assertion `LI.getType()->getIntegerBitWidth() ==
TD.getTypeSizeInBits(OldAI.getAllocatedType()) && "Only alloca-wide loads can
be split and recomposed"' failed.
0  clang           0x00000000020a2f9f
1  clang           0x00000000020a4f1a
2  libpthread.so.0 0x00007f178bd918f0
3  libc.so.6       0x00007f178b07da75 gsignal + 53
4  libc.so.6       0x00007f178b0815c0 abort + 384
5  libc.so.6       0x00007f178b076941 __assert_fail + 241
6  clang           0x0000000001cbd9b9
7  clang           0x0000000001cbfa01
8  clang           0x0000000001cc4051
9  clang           0x0000000001cc5a45
10 clang           0x0000000001cc6841
11 clang           0x000000000203e7ed
llvm::FPPassManager::runOnFunction(llvm::Function&) + 557
12 clang           0x0000000001db6e9e
13 clang           0x0000000001db7738
14 clang           0x000000000203e361
llvm::MPPassManager::runOnModule(llvm::Module&) + 497
15 clang           0x000000000203e4db llvm::PassManagerImpl::run(llvm::Module&)
+ 171
16 clang           0x000000000083ba31
clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::CodeGenOptions
const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::Module*,
clang::BackendAction, llvm::raw_ostream*) + 1505
17 clang           0x0000000000839009
18 clang           0x00000000009ae4ce clang::ParseAST(clang::Sema&, bool, bool)
+ 398
19 clang           0x0000000000837a14 clang::CodeGenAction::ExecuteAction() +
68
20 clang           0x00000000006c3e41 clang::FrontendAction::Execute() + 145
21 clang           0x000000000069d401
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 337
22 clang           0x0000000000685bf4
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1700
23 clang           0x000000000067ae28 cc1_main(char const**, char const**, char
const*, void*) + 1288
24 clang           0x00000000006845f7 main + 7431
25 libc.so.6       0x00007f178b068c4d __libc_start_main + 253
26 clang           0x0000000000678bb9
Stack dump:
0.    Program arguments:
/usr/local/google/asan/asan-llvm-trunk/llvm/build/Release+Asserts/bin/clang
-cc1 -triple x86_64-unknown-linux-gnu -O2 -emit-obj -o RS.o -x c++ RS.ii 
1.    <eof> parser at end of file
2.    Per-module optimization passes
3.    Running pass 'CallGraph Pass Manager' on module 'RS.ii'.
4.    Running pass 'SROA' on function
'@_ZNK11RenderStyle22colorIncludingFallbackEib'
Aborted

$ cat RS.ii
struct Color {
  Color() : m_color(0), m_valid(false) { }
  unsigned m_color;
  bool m_valid;
};

struct RenderStyle {
  Color backgroundColor() const { }
  Color visitedLinkBackgroundColor() const { }
  Color visitedLinkBorderLeftColor() const { }
  Color colorIncludingFallback(int colorProperty, bool visitedLink) const;
};

Color RenderStyle::colorIncludingFallback(int colorProperty, bool visitedLink)
const {
  Color result;
  switch (colorProperty) {
     case 1024:  return visitedLink ? visitedLinkBackgroundColor() :
backgroundColor();
     case 1050:  result = visitedLink ? visitedLinkBorderLeftColor() :
backgroundColor();
  }
  return result;
}

-- 
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