ahatanak wrote:

It's not clear to me whether we should do this only when NRVO is false.

$ cat test.cpp
```
struct S {
  S();
  int a[4];
};

#ifdef DONTPROTECT1
__attribute__((no_stack_protector))
#endif
S foo1() {
#ifdef DONTPROTECT2
  __attribute__((no_stack_protector))
#endif
  S s;
  return s;
}
```

Should stack protection get disabled in both cases?

$ clang++ -std=c++11 -S -o - -Os f9.cpp -fstack-protector-strong 
-DDONTPROTECT1=1
$ clang++ -std=c++11 -S -o - -Os f9.cpp -fstack-protector-strong 
-DDONTPROTECT2=1

https://github.com/llvm/llvm-project/pull/173311
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to