diff options
author | Diego Novillo <dnovillo@redhat.com> | 2002-11-02 22:58:54 +0000 |
---|---|---|
committer | Diego Novillo <dnovillo@gcc.gnu.org> | 2002-11-02 17:58:54 -0500 |
commit | 8cd4a359745cb180986028579d31254d9f380817 (patch) | |
tree | 84d5049553f2da1d044441e45fa2941316170a1f /gcc | |
parent | dff9f1b69e16f9ba752590a8c0a1daf906dbb8e5 (diff) | |
download | gcc-8cd4a359745cb180986028579d31254d9f380817.zip gcc-8cd4a359745cb180986028579d31254d9f380817.tar.gz gcc-8cd4a359745cb180986028579d31254d9f380817.tar.bz2 |
re PR rtl-optimization/8423 (CSE1 not propagating __builtin_constant_p enough)
PR optimization/8423
* gcc.c-torture/execute/builtin-constant.c: New test.
From-SVN: r58760
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/builtin-constant.c | 26 |
2 files changed, 31 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 2b88c1f..be1e602 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2002-11-02 Diego Novillo <dnovillo@redhat.com> + + PR optimization/8423 + * gcc.c-torture/execute/builtin-constant.c: New test. + 2002-11-01 Zack Weinberg <zack@codesourcery.com> * g++.dg/ext/typedef-init.C, gcc.dg/typedef-init.C: diff --git a/gcc/testsuite/gcc.c-torture/execute/builtin-constant.c b/gcc/testsuite/gcc.c-torture/execute/builtin-constant.c new file mode 100644 index 0000000..9e5bfb8 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/builtin-constant.c @@ -0,0 +1,26 @@ +/* PR optimization/8423. */ + +#define btest(x) __builtin_constant_p(x) ? "1" : "0" + +#ifdef __OPTIMIZE__ +void +foo (char *i) +{ + if (*i == '0') + abort (); +} +#else +void +foo (char *i) +{ +} +#endif + +int +main (void) +{ + int size = sizeof (int); + foo (btest (size)); + foo (btest (size)); + exit (0); +} |