<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/58612>58612</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Store to non-first element of vector of less than byte sized integers triggers stack check
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          Vexu
      </td>
    </tr>
</table>

<pre>
    ```llvm
; Function Attrs: nounwind sspstrong
define fastcc void @main() {
Entry:
  %StackGuardSlot = alloca ptr, align 8
  %StackGuard = load volatile ptr, ptr addrspace(257) inttoptr (i32 40 to ptr addrspace(257)), align 8
  call void @llvm.stackprotector(ptr %StackGuard, ptr %StackGuardSlot)
  %0 = alloca <2 x i1>, align 1
  %1 = getelementptr inbounds <2 x i1>, ptr %0, i32 0, i64 1
  store i1 true, ptr %1, align 1
  %StackGuard1 = load volatile ptr, ptr addrspace(257) inttoptr (i32 40 to ptr addrspace(257)), align 8
  %2 = load volatile ptr, ptr %StackGuardSlot, align 8
  %3 = icmp eq ptr %StackGuard1, %2
  br i1 %3, label %SP_return, label %CallStackCheckFailBlk

SP_return:                                        ; preds = %Entry
  ret void

CallStackCheckFailBlk:                            ; preds = %Entry
  call void @__stack_chk_fail()
  unreachable
}

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackprotector(ptr, ptr) #11

declare void @__stack_chk_fail()
```

```sh-session
$ clang a.ll
$ ./a.out
*** stack smashing detected ***: terminated
Aborted (core dumped)
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzFVcFy2yAQ_Rp0YeKRkGVbBx2SuOm1M5np1YNgJdFgcAElTb--C5Jrp3bS3uphzAK7-96y7Kq18rUhq3waWj_vSb4l-S0p7-jDaERQ1tDbEJwn5S01djQvykjq_cEHZ00_aUvolAHacR-EoM9WSUqW-Z4rQ9iGsJq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