Commit 2aac1924 by Jason Merrill Committed by Jason Merrill

re PR c++/40138 (ICE with invalid va_arg)

	PR c++/40138
	* fold-const.c (operand_equal_p): Handle erroneous types.

From-SVN: r156483
parent f000c6a7
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> 2010-02-01 Kaushik Phatak <kaushik.phatak@kpitcummins.com>
* config/h8300/h8300.md (can_delay): Fix attibute condition. * config/h8300/h8300.md (can_delay): Fix attibute condition.
......
...@@ -3165,7 +3165,9 @@ int ...@@ -3165,7 +3165,9 @@ int
operand_equal_p (const_tree arg0, const_tree arg1, unsigned int flags) operand_equal_p (const_tree arg0, const_tree arg1, unsigned int flags)
{ {
/* If either is ERROR_MARK, they aren't equal. */ /* 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; return 0;
/* Check equality of integer constants before bailing out due to /* Check equality of integer constants before bailing out due to
......
2010-02-03 Jason Merrill <jason@redhat.com> 2010-02-03 Jason Merrill <jason@redhat.com>
PR c++/40138
* g++.dg/ext/builtin11.C: New.
PR c++/4926 PR c++/4926
PR c++/38600 PR c++/38600
* g++.dg/abi/mangle35.C: New. * g++.dg/abi/mangle35.C: New.
......
// 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);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment