diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-01-04 15:56:41 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-01-04 15:56:41 +0000 |
commit | cd3f90e25efd15a06db7a4a7d3aa51552987982b (patch) | |
tree | b5fe9fbbe6e89d6fae4bc8453d5d165723a585b6 /gcc/testsuite/gcc.c-torture | |
parent | ef42a627ede307595053965f41b9925ab158e74d (diff) | |
download | gcc-cd3f90e25efd15a06db7a4a7d3aa51552987982b.tar.gz |
2008-01-04 Richard Guenther <rguenther@suse.de>
PR middle-end/34029
* tree-cfg.c (verify_expr): Do not look inside ADDR_EXPRs
for verifying purposes if they are is_gimple_min_invariant.
* gcc.c-torture/compile/pr34029-1.c: New testcase.
* gcc.c-torture/compile/pr34029-2.c: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@131325 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.c-torture')
-rw-r--r-- | gcc/testsuite/gcc.c-torture/compile/pr34029-1.c | 22 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/compile/pr34029-2.c | 12 |
2 files changed, 34 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr34029-1.c b/gcc/testsuite/gcc.c-torture/compile/pr34029-1.c new file mode 100644 index 00000000000..526112974b2 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr34029-1.c @@ -0,0 +1,22 @@ +static const char s[] = "ab.cd.efghijk"; + +int +foo (const char *x) +{ + const char *a; + int b = 0; + + a = __builtin_strchr (s, '.'); + if (a == 0) + b = 1; + else if ((a = __builtin_strchr (a + 1, '.')) == 0) + b = 1; + else if (__builtin_strncmp (s, x, a - s)) + b = 1; + else if (__builtin_strncmp (a + 1, x + (a - s + 1), 4) < 0) + b = 1; + + if (b) + return 4; + return 0; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/pr34029-2.c b/gcc/testsuite/gcc.c-torture/compile/pr34029-2.c new file mode 100644 index 00000000000..9ec49ec97fa --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr34029-2.c @@ -0,0 +1,12 @@ +static const char s[] = "ab.cd.efghijk"; +static const char t[] = "abcde"; + +long +foo (const char *x) +{ + const char *a; + long b = 0; + + a = __builtin_strchr (s, '.'); + return ((long) a) + (1 - (long) t); +} |