diff options
author | Richard Biener <rguenther@suse.de> | 2024-06-17 09:23:25 +0200 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2024-06-17 14:39:30 +0200 |
commit | 95bfc6abf378a32e502dca0e2938f94d5b0ab094 (patch) | |
tree | 15f53e1f82829e521d79cfcf7b26daebb6a03692 | |
parent | b100488bfca3c3ca67e9e807d6e4e03dd0e3f6db (diff) | |
download | gcc-95bfc6abf378a32e502dca0e2938f94d5b0ab094.zip gcc-95bfc6abf378a32e502dca0e2938f94d5b0ab094.tar.gz gcc-95bfc6abf378a32e502dca0e2938f94d5b0ab094.tar.bz2 |
Testcase for PR115492
This adds a testcase for the PR fixed with reversal of
r15-204-g7c469a9fc78550.
PR tree-optimization/115492
* gcc.dg/torture/pr115492.c: New testcase.
-rw-r--r-- | gcc/testsuite/gcc.dg/torture/pr115492.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/torture/pr115492.c b/gcc/testsuite/gcc.dg/torture/pr115492.c new file mode 100644 index 0000000..4ecc060 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr115492.c @@ -0,0 +1,19 @@ +/* { dg-do run } */ + +int a = 2, b=0, *c = &a, *d = &a, e=0; +[[gnu::noipa]] +void f(int) {} +[[gnu::noipa]] +int h(int *k) { + int ***j; + if (b) { + *j = &k; // Note the unintialized j is used here + // but since it is conditional and b is always zero, there should no + // effect otherwise. + ***j; + } + f(*k); + *d = e; + return *k; +} +int main() { if (h(c)) __builtin_abort(); } |