repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
re PR tree-optimization/79578 (Unnecessary instructions in generated code)
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
tree-ssa
/
ssa-dse-3.C
blob
fe8f309ac22988437e542532f60553c9460e6d16
1
/* { dg-do compile } */
2
/* { dg-options "-std=c++14 -O3 -fdump-tree-dse1-details" } */
3
4
#include <new>
5
#include <cstdint>
6
7
struct A
8
{
9
std::uint16_t a, b;
10
};
11
12
A* f(char* b) __attribute__((noinline));
13
14
A* f(char* b) {
15
auto a = new(b) A{};
16
a->a = 1;
17
a->b = 2;
18
return a;
19
}
20
21
int main() {
22
char b[sizeof(A)] alignas(A);
23
f(b);
24
}
25
26
27
/* { dg-final { scan-tree-dump "Deleted dead store: " "dse1" } } */
28