<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/61112>61112</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
missing parameter
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
kerravon86
</td>
</tr>
</table>
<pre>
This looks like a compiler bug to me.
Function mystart takes 2 parameters. I can see the second parameter:
movl %eax, 4(%esp)
but I don't see the first parameter, which I expect to be inserted
at 0(%esp)
This is linstart.s:
_start: # @_start
# %bb.0:
pushl %esi
subl $8, %esp
leal 12(%esp), %eax
movl %eax, paul
leal 16(%esp), %eax
movl %eax, 4(%esp)
calll __mystart
movl %eax, %esi
movl %eax, (%esp)
calll __exita
movl %esi, %eax
addl $8, %esp
popl %esi
retl
mystart (in start.s) is expecting that first (missing) parameter:
__mystart: # @__mystart
# %bb.0:
pushl %ebp
pushl %ebx
pushl %edi
pushl %esi
subl $76, %esp
movl 96(%esp), %esi
The offset 96 is correct:
movl 96(%esp), %esi
(after the various stack manipulations, plus the return address)
The value in %esi is tested to make sure it is 1, and because it isn't, it freezes.
cmpl $1, %esi
jne .LBB0_8
.LBB0_8:
movl $.L.str, (%esp)
calll printf
.p2align 4, 0x90
.LBB0_9: # =>This Inner Loop Header: Depth=1
jmp .LBB0_9
.L.str:
.asciz "argc is not 1 - freezing\n"
Here is the version information:
.ident "Android (7714059, based on r416183c1) clang version 12.0.8 (https://android.googlesource.com/toolchain/llvm-project c935d99d7cf2016289302412d708641d52d2f7ee)"
Being compiled with:
-c -O2 -fno-builtin -DUSE_MEMMGR -I . -m32 -fno-stack-protector
[clangprm.zip](https://github.com/llvm/llvm-project/files/10867702/clangprm.zip)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVk1v2zgQ_TX0ZWCBor4PPiR1vQ3QYoHd7jmgyJHFhiIFkkrT_voFZcV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