[LLVMbugs] [Bug 2112] New: LoopAligner pass fallout on Sparc/Solaris

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Fri Feb 29 03:59:14 PST 2008


           Summary: LoopAligner pass fallout on Sparc/Solaris
           Product: new-bugs
           Version: unspecified
          Platform: Sun
        OS/Version: Solaris
            Status: NEW
          Severity: normal
          Priority: P2
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: ggreif at gmail.com
                CC: llvmbugs at cs.uiuc.edu

I get this crash on SPARCv8:

(gdb) run ggg.bc -f
Starting program: .../llvm/Debug/bin/llc ggg.bc -f
warning: Temporarily disabling breakpoints for unloaded shared library
warning: Lowest section in /lib/libpthread.so.1 is .dynamic at 00000074

Program received signal SIGSEGV, Segmentation fault.
0x0095fd68 in llvm::TargetLowering::getPrefLoopAlignment (this=0x0)
    at .../llvm/include/llvm/Target/TargetLowering.h:566
566       return PrefLoopAlignment;
(gdb) bt
#0  0x0095fd68 in llvm::TargetLowering::getPrefLoopAlignment (this=0x0)
    at .../llvm/include/llvm/Target/TargetLowering.h:566
#1  0x0095f67c in (anonymous namespace)::LoopAligner::runOnMachineFunction
(this=0xd387f0, MF=@0xd42e90)
    at LoopAligner.cpp:54
#2  0x00481e28 in llvm::MachineFunctionPass::runOnFunction (this=0xd387f0,
    at .../llvm/include/llvm/CodeGen/MachineFunctionPass.h:41
#3  0x00ba4a70 in llvm::FPPassManager::runOnFunction (this=0xd3a8c8,
F=@0xd3b150) at PassManager.cpp:1170
#4  0x00ba4704 in llvm::FunctionPassManagerImpl::run (this=0xd3a5e0,
F=@0xd3b150) at PassManager.cpp:1128
#5  0x00ba4590 in llvm::FunctionPassManager::run (this=0xffbff400, F=@0xd3b150)
at PassManager.cpp:1073
#6  0x00413e9c in main (argc=3, argv=0xffbff4bc) at llc.cpp:296
(gdb) up
#1  0x0095f67c in (anonymous namespace)::LoopAligner::runOnMachineFunction
(this=0xd387f0, MF=@0xd42e90)
    at LoopAligner.cpp:54
54      unsigned Align =

It appears that on Sparc no TargetLowering object is allocated and LoopAligner
does not guard against this condition.

Three solution attempts come to my mind:

1) Install a TargetLowering for Sparc too.
2) Guard against TargetLowering == NULL in LoopAligner
3) Do not register with LoopAligner when there is no TargetLowering installed.

1) looks best to me, but other people may prefer 3). 2) probably makes little

Ah, the test in question is CodeGen/Generic/GC/alloc_loop.ll
but many others fail too.

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