[llvm-bugs] [Bug 37539] New: Segmentation fault in NaryReassociate pass

via llvm-bugs llvm-bugs at lists.llvm.org
Mon May 21 04:40:27 PDT 2018


https://bugs.llvm.org/show_bug.cgi?id=37539

            Bug ID: 37539
           Summary: Segmentation fault in NaryReassociate pass
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: karl-johan.karlsson at ericsson.com
                CC: llvm-bugs at lists.llvm.org

When running the testcase:
-------------------------------------------------
; RUN: opt < %S -nary-reassociate -S -o /dev/null

define void @f1() {
  br label %bb1

bb1:                                              ; preds = %bb1, %0
  %1 = phi i16 [ 0, %0 ], [ %3, %bb1 ]
  %2 = phi i16 [ 0, %0 ], [ %4, %bb1 ]
  %scevgep.offs = add i16 2, 0
  %3 = add i16 %1, %scevgep.offs
  %scevgep.offs5 = add i16 2, 0
  %4 = add i16 %2, %scevgep.offs5
  br i1 false, label %bb1, label %bb7

bb7:                                              ; preds = %bb1
  ret void
}
-------------------------------------------------
you end up with a segv.

$ ./opt -nary-reassociate -S -o - foo.ll
Stack dump:
0.      Program arguments: ./opt -nary-reassociate -S -o - foo.ll 
1.      Running pass 'Function Pass Manager' on module 'foo.ll'.
2.      Running pass 'Nary reassociation' on function '@f1'
#0 0x0000000002186074 PrintStackTraceSignalHandler(void*) (./opt+0x2186074)
#1 0x0000000002184350 llvm::sys::RunSignalHandlers() (./opt+0x2184350)
#2 0x00000000021863d8 SignalHandler(int) (./opt+0x21863d8)
#3 0x00007f707bea5330 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x10330)
#4 0x0000000002037ecd
llvm::NaryReassociatePass::doOneIteration(llvm::Function&) (./opt+0x2037ecd)
#5 0x000000000203ac08 (anonymous
namespace)::NaryReassociateLegacyPass::runOnFunction(llvm::Function&)
(./opt+0x203ac08)
#6 0x0000000001c19928 llvm::FPPassManager::runOnFunction(llvm::Function&)
(./opt+0x1c19928)
#7 0x0000000001c19b68 llvm::FPPassManager::runOnModule(llvm::Module&)
(./opt+0x1c19b68)
#8 0x0000000001c1a045 llvm::legacy::PassManagerImpl::run(llvm::Module&)
(./opt+0x1c1a045)
#9 0x000000000077658c main (./opt+0x77658c)
#10 0x00007f707aa7ff45 __libc_start_main
/build/eglibc-ripdx6/eglibc-2.19/csu/libc-start.c:321:0
#11 0x000000000075fabd _start (./opt+0x75fabd)
Segmentation fault (core dumped)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180521/8c116d62/attachment.html>


More information about the llvm-bugs mailing list