New user self-registration is disabled due to spam. For an account please email bugs-admin@lists.llvm.org with your e-mail address and full name.

Bug 46759 - [PowerPC] frame_layout in test-suite fails if compiled with -fstack-clash-protection on powerpc64le machine
Summary: [PowerPC] frame_layout in test-suite fails if compiled with -fstack-clash-pro...
Status: RESOLVED FIXED
Alias: None
Product: libraries
Classification: Unclassified
Component: Backend: PowerPC (show other bugs)
Version: trunk
Hardware: PC Linux
: P release blocker
Assignee: Kai Luo
URL:
Keywords:
Depends on:
Blocks: release-11.0.0
  Show dependency tree
 
Reported: 2020-07-17 00:29 PDT by Kai Luo
Modified: 2020-07-22 16:20 PDT (History)
8 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kai Luo 2020-07-17 00:29:39 PDT
llvm-test-suite compiled with CFLAGS="-fstack-clash-protection" CXX="-fstack-clash-protection" on a powerpc64le machine, test
```
MultiSource/UnitTests/C++11/frame_layout/frame_layout.test
```
fails.

Reduced IR
```
; ModuleID = 'bugpoint-reduced-simplified.bc'
source_filename = "../../MultiSource/UnitTests/C++11/frame_layout/frame_layout.cpp"
target datalayout = "e-m:e-i64:64-n32:64"
target triple = "powerpc64le-unknown-linux-gnu"

$_Z10test_frameILj4096ELb1ELj2048ELb0ELb0EJEEvDpT4_jPKcP13trace_elementd = comdat any

define dso_local void @_Z10test_frameILj4096ELb1ELj2048ELb0ELb0EJEEvDpT4_jPKcP13trace_elementd(i32 %vla_size) local_unnamed_addr #0 comdat {
entry:
  %0 = zext i32 %vla_size to i64
  %vla = alloca i8, i64 %0, align 2048
  %1 = load volatile i8, i8* %vla, align 2048
  ret void
}

attributes #0 = { "probe-stack"="inline-asm" }
```
Comment 1 Kai Luo 2020-07-22 00:04:51 PDT
Hi Hans, could you help merge
```
commit 8912252252c87d8ef6623ecf9fdde444560ee4b9
Author: Kai Luo <lkail@cn.ibm.com>
Date:   Wed Jul 22 04:13:18 2020 +0000

    [PowerPC] Fix wrong codegen when stack pointer has to realign in prologue
```
and
```
commit c3f9697f1f227296818fbaf1a770a29842ea454c
Author: Kai Luo <lkail@cn.ibm.com>
Date:   Wed Jul 22 04:16:20 2020 +0000

    [PowerPC] Fix wrong codegen when stack pointer has to realign performing dynalloc

```
into release/11.x, thanks!
Comment 2 Hans Wennborg 2020-07-22 07:22:29 PDT
Pushed those and the test case in 817767abe to 11.x as ba5bbd4bd00f8aacf379cdcb738b149a1f63166a e95e071b6b68929527570cb830e5f3bc8b992e04 
 c522fd02da1b0dcadeae041d12fe35e52ce0973f.
Comment 3 Kai Luo 2020-07-22 16:20:17 PDT
Oops, I forgot the precommitted test. Thanks Hans.