diff options
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/fold-const.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/ext/builtin11.C | 9 |
4 files changed, 20 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e1cb410..e00a388 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2010-02-03 Jason Merrill <jason@redhat.com> + + PR c++/40138 + * fold-const.c (operand_equal_p): Handle erroneous types. + 2010-02-01 Kaushik Phatak <kaushik.phatak@kpitcummins.com> * config/h8300/h8300.md (can_delay): Fix attibute condition. diff --git a/gcc/fold-const.c b/gcc/fold-const.c index e7a4b8c..292b89f 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -3165,7 +3165,9 @@ int operand_equal_p (const_tree arg0, const_tree arg1, unsigned int flags) { /* If either is ERROR_MARK, they aren't equal. */ - if (TREE_CODE (arg0) == ERROR_MARK || TREE_CODE (arg1) == ERROR_MARK) + if (TREE_CODE (arg0) == ERROR_MARK || TREE_CODE (arg1) == ERROR_MARK + || TREE_TYPE (arg0) == error_mark_node + || TREE_TYPE (arg1) == error_mark_node) return 0; /* Check equality of integer constants before bailing out due to diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b3fef29..fd84e5e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2010-02-03 Jason Merrill <jason@redhat.com> + PR c++/40138 + * g++.dg/ext/builtin11.C: New. + PR c++/4926 PR c++/38600 * g++.dg/abi/mangle35.C: New. diff --git a/gcc/testsuite/g++.dg/ext/builtin11.C b/gcc/testsuite/g++.dg/ext/builtin11.C new file mode 100644 index 0000000..2749671 --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/builtin11.C @@ -0,0 +1,9 @@ +// PR c++/40138 +// { dg-options "-Wall" } + +void foo(int i, ...) +{ + V v; // { dg-error "not declared|expected" } + __builtin_va_start(v, i); // { dg-error "not declared" } + i = __builtin_va_arg(v, int); +} |