diff options
author | Richard Guenther <rguenther@suse.de> | 2008-11-01 12:47:38 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2008-11-01 12:47:38 +0000 |
commit | 002bd9f0ac7a90a1c0ed1488033505758df6c8df (patch) | |
tree | 4ad324688f65dd4385b0bf31bf9f7e9fe3ddd83c /gcc | |
parent | 8dd5e93af60784985b22b8af909469d57ee6abdb (diff) | |
download | gcc-002bd9f0ac7a90a1c0ed1488033505758df6c8df.zip gcc-002bd9f0ac7a90a1c0ed1488033505758df6c8df.tar.gz gcc-002bd9f0ac7a90a1c0ed1488033505758df6c8df.tar.bz2 |
re PR middle-end/37976 (ICE in insert_into_preds_of_block)
2008-11-01 Richard Guenther <rguenther@suse.de>
PR middle-end/37976
* builtins.c (fold_builtin_strspn): Return a size_t.
(fold_builtin_strcspn): Likewise.
* gcc.c-torture/compile/pr37976.c: New testcase.
From-SVN: r141514
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/builtins.c | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/compile/pr37976.c | 6 |
4 files changed, 20 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4807a04..b811061 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2008-11-01 Richard Guenther <rguenther@suse.de> + + PR middle-end/37976 + * builtins.c (fold_builtin_strspn): Return a size_t. + (fold_builtin_strcspn): Likewise. + 2008-10-31 Nathan Froyd <froydnj@codesourcery.com> * config/rs6000/rs6000.c (rs6000_file_start): Output gnu diff --git a/gcc/builtins.c b/gcc/builtins.c index 85d61b5..a1bba0d 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -11398,7 +11398,7 @@ fold_builtin_strspn (tree s1, tree s2) if ((p1 && *p1 == '\0') || (p2 && *p2 == '\0')) /* Evaluate and ignore both arguments in case either one has side-effects. */ - return omit_two_operands (integer_type_node, integer_zero_node, + return omit_two_operands (size_type_node, size_zero_node, s1, s2); return NULL_TREE; } @@ -11444,8 +11444,8 @@ fold_builtin_strcspn (tree s1, tree s2) { /* Evaluate and ignore argument s2 in case it has side-effects. */ - return omit_one_operand (integer_type_node, - integer_zero_node, s2); + return omit_one_operand (size_type_node, + size_zero_node, s2); } /* If the second argument is "", return __builtin_strlen(s1). */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index db83bac..020d589 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2008-11-01 Richard Guenther <rguenther@suse.de> + + PR middle-end/37976 + * gcc.c-torture/compile/pr37976.c: New testcase. + 2008-11-01 Dennis Wassel <dennis.wassel@gmail.com> PR fortran/37159 diff --git a/gcc/testsuite/gcc.c-torture/compile/pr37976.c b/gcc/testsuite/gcc.c-torture/compile/pr37976.c new file mode 100644 index 0000000..6b2ba63 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr37976.c @@ -0,0 +1,6 @@ +void percent_x(int ch, char *p, char* ok_chars) +{ + char *cp = ch == 'a' ? p : ""; + for (;*(cp += __builtin_strspn (cp, ok_chars));) + ; +} |