diff options
author | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2025-09-02 15:58:26 -0700 |
---|---|---|
committer | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2025-09-02 15:58:26 -0700 |
commit | 071b4126c613881f4cb25b4e5c39032964827f88 (patch) | |
tree | 7ed805786566918630d1d617b1ed8f7310f5fd8e /gcc/testsuite/gcc.dg/pr89828.c | |
parent | 845d23f3ea08ba873197c275a8857eee7edad996 (diff) | |
parent | caa1c2f42691d68af4d894a5c3e700ecd2dba080 (diff) | |
download | gcc-devel/gfortran-test.zip gcc-devel/gfortran-test.tar.gz gcc-devel/gfortran-test.tar.bz2 |
Merge branch 'master' into gfortran-testdevel/gfortran-test
Diffstat (limited to 'gcc/testsuite/gcc.dg/pr89828.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/pr89828.c | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pr89828.c b/gcc/testsuite/gcc.dg/pr89828.c new file mode 100644 index 0000000..d41fbae --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr89828.c @@ -0,0 +1,49 @@ +/* { dg-do compile { target rx-*-* } } */ +/* { dg-options "-O2 -g -fno-omit-frame-pointer" } */ +struct baz; +struct foo { + struct baz *c; + unsigned int flags; +}; +struct bar { + const struct bar *b; + void (*func)(struct foo *a, struct baz *c, int flags); +}; +struct baz { + int flag; + const struct bar *b; +}; +static inline +__attribute__((always_inline)) +__attribute__((no_instrument_function)) void inline1(struct foo *a) +{ + a->flags |= 1; +} +static inline +__attribute__((always_inline)) +__attribute__((no_instrument_function)) int inline2(struct baz *c) +{ + return c->flag == 1; +} +extern const struct bar _bar; +extern void func(struct foo *a); +void pr89828(struct foo *a, struct baz *c, int flags) +{ + const struct bar *b; + + if (c->b == a->c->b) { + a->c->b->func(a, c, flags); + } else { + for (b = (&_bar); b; b = b->b) { + if (b == a->c->b) + break; + if (b == c->b) { + func(a); + break; + } + } + } + + if (inline2(a->c)) + inline1(a); +} |