<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - LLC crash caused by the naked function attribute"
   href="https://bugs.llvm.org/show_bug.cgi?id=52399">52399</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>LLC crash caused by the naked function attribute
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>new bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>b2.temp@gmx.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>## IR

---
; ModuleID = '<stdin>'
source_filename = "r"

; Function Attrs: noinline
define i32 @r.slow(i32 %0, i32 %1, i32 %2) #0 {
entry:
  %3 = alloca [2 x i32], align 4
  %4 = getelementptr [2 x i32], [2 x i32]* %3, i32 0, i32 0
  store i32 %1, i32* %4, align 4
  %5 = getelementptr [2 x i32], [2 x i32]* %3, i32 0, i32 1
  store i32 %2, i32* %5, align 4
  %6 = load [2 x i32], [2 x i32]* %3, align 4
  store [2 x i32] %6, [2 x i32]* %3, align 4
  %7 = getelementptr [2 x i32], [2 x i32]* %3, i32 0, i32 0
  %8 = and i32 %0, 1
  %9 = getelementptr i32, i32* %7, i32 %8
  %10 = load i32, i32* %9, align 4
  ret i32 %10
}

attributes #0 = { naked }
---

## backtrace

---
Output of llc (trunk) (Compiler #1)
PLEASE submit a bug report to <a href="https://bugs.llvm.org/">https://bugs.llvm.org/</a> and include the crash
backtrace.
Stack dump:
0.      Program arguments: /opt/compiler-explorer/clang-trunk/bin/llc -o
/app/output.s -x86-asm-syntax=intel <source>
1.      Running pass 'Function Pass Manager' on module '<source>'.
2.      Running pass 'X86 DAG->DAG Instruction Selection' on function '@r.slow'
 #0 0x00005647c8cf429f PrintStackTraceSignalHandler(void*) Signals.cpp:0:0
 #1 0x00005647c8cf1b4d SignalHandler(int) Signals.cpp:0:0
 #2 0x00007fd5a77ce3c0 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x153c0)
 #3 0x00005647c6c71710 isBitfieldExtractOp(llvm::SelectionDAG*, llvm::SDNode*,
unsigned int&, llvm::SDValue&, unsigned int&, unsigned int&, unsigned int,
bool) (.part.271) AArch64ISelDAGToDAG.cpp:0:0
 #4 0x00005647c8b3debe
llvm::TargetLowering::SimplifyDemandedBits(llvm::SDValue, llvm::APInt const&,
llvm::APInt const&, llvm::KnownBits&, llvm::TargetLowering::TargetLoweringOpt&,
unsigned int, bool) const
(/opt/compiler-explorer/clang-trunk/bin/llc+0x293debe)
 #5 0x00005647c8b40b99
llvm::TargetLowering::SimplifyDemandedBits(llvm::SDValue, llvm::APInt const&,
llvm::APInt const&, llvm::KnownBits&, llvm::TargetLowering::TargetLoweringOpt&,
unsigned int, bool) const
(/opt/compiler-explorer/clang-trunk/bin/llc+0x2940b99)
 #6 0x00005647c8b42118
llvm::TargetLowering::SimplifyDemandedBits(llvm::SDValue, llvm::APInt const&,
llvm::APInt const&, llvm::KnownBits&, llvm::TargetLowering::TargetLoweringOpt&,
unsigned int, bool) const
(/opt/compiler-explorer/clang-trunk/bin/llc+0x2942118)
 #7 0x00005647c8b4603f
llvm::TargetLowering::SimplifyDemandedBits(llvm::SDValue, llvm::APInt const&,
llvm::KnownBits&, llvm::TargetLowering::TargetLoweringOpt&, unsigned int, bool)
const (/opt/compiler-explorer/clang-trunk/bin/llc+0x294603f)
 #8 0x00005647c89ec769 (anonymous
namespace)::DAGCombiner::SimplifyDemandedBits(llvm::SDValue) (.constprop.1056)
DAGCombiner.cpp:0:0
 #9 0x00005647c89f9a66 (anonymous
namespace)::DAGCombiner::visitADDLike(llvm::SDNode*) DAGCombiner.cpp:0:0
#10 0x00005647c89fabb5 (anonymous
namespace)::DAGCombiner::visitADD(llvm::SDNode*) DAGCombiner.cpp:0:0
#11 0x00005647c8a21c9c (anonymous namespace)::DAGCombiner::visit(llvm::SDNode*)
DAGCombiner.cpp:0:0
#12 0x00005647c8a235bd (anonymous
namespace)::DAGCombiner::combine(llvm::SDNode*) DAGCombiner.cpp:0:0
#13 0x00005647c8a24e9c llvm::SelectionDAG::Combine(llvm::CombineLevel,
llvm::AAResults*, llvm::CodeGenOpt::Level)
(/opt/compiler-explorer/clang-trunk/bin/llc+0x2824e9c)
#14 0x00005647c8b1d60f llvm::SelectionDAGISel::CodeGenAndEmitDAG()
(/opt/compiler-explorer/clang-trunk/bin/llc+0x291d60f)
#15 0x00005647c8b20d64
llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&)
(/opt/compiler-explorer/clang-trunk/bin/llc+0x2920d64)
#16 0x00005647c8b22ff2
llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&)
(.part.885) SelectionDAGISel.cpp:0:0
#17 0x00005647c78ad3f0 (anonymous
namespace)::X86DAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&)
X86ISelDAGToDAG.cpp:0:0
#18 0x00005647c8136208
llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
(/opt/compiler-explorer/clang-trunk/bin/llc+0x1f36208)
#19 0x00005647c85679d9 llvm::FPPassManager::runOnFunction(llvm::Function&)
(/opt/compiler-explorer/clang-trunk/bin/llc+0x23679d9)
#20 0x00005647c8567c71 llvm::FPPassManager::runOnModule(llvm::Module&)
(/opt/compiler-explorer/clang-trunk/bin/llc+0x2367c71)
#21 0x00005647c8568ee7 llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/opt/compiler-explorer/clang-trunk/bin/llc+0x2368ee7)
#22 0x00005647c6aa71c1 compileModule(char**, llvm::LLVMContext&) llc.cpp:0:0
#23 0x00005647c69d5e5e main
(/opt/compiler-explorer/clang-trunk/bin/llc+0x7d5e5e)
#24 0x00007fd5a727e0b3 __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x270b3)
#25 0x00005647c6a9edfa _start
(/opt/compiler-explorer/clang-trunk/bin/llc+0x89edfa)
Compiler returned: 139
---

## notes

while the naked attribute is missused, (since there's an alloca), llc should
not crash</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>