re PR c++/70084 (va_arg ((ap), int) regression on s390*-*)
PR c++/70084 * tree-inline.c (copy_tree_body_r): When cancelling ADDR_EXPR of INDIRECT_REF and ADDR_EXPR changed type, fold_convert it to the right type. * g++.dg/expr/stdarg3.C: New test. From-SVN: r234004
This commit is contained in:
parent
7d461295b8
commit
df762bb20a
@ -1,3 +1,10 @@
|
||||
2016-03-05 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR c++/70084
|
||||
* tree-inline.c (copy_tree_body_r): When cancelling ADDR_EXPR
|
||||
of INDIRECT_REF and ADDR_EXPR changed type, fold_convert it
|
||||
to the right type.
|
||||
|
||||
2016-03-04 Bernd Schmidt <bschmidt@redhat.com>
|
||||
|
||||
PR c/69973
|
||||
|
@ -1,3 +1,8 @@
|
||||
2016-03-05 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR c++/70084
|
||||
* g++.dg/expr/stdarg3.C: New test.
|
||||
|
||||
2016-03-04 Jeff Law <law@redhat.com>
|
||||
|
||||
PR tree-optimization/69196
|
||||
|
18
gcc/testsuite/g++.dg/expr/stdarg3.C
Normal file
18
gcc/testsuite/g++.dg/expr/stdarg3.C
Normal file
@ -0,0 +1,18 @@
|
||||
// PR c++/70084
|
||||
// { dg-do compile }
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
struct A
|
||||
{
|
||||
A (const char *f, ...);
|
||||
};
|
||||
|
||||
A::A (const char *f, ...)
|
||||
{
|
||||
va_list ap;
|
||||
va_start (ap, f);
|
||||
int i = va_arg (ap, int); // { dg-bogus "first argument to 'va_arg' not of type 'va_list'" }
|
||||
int j = va_arg ((ap), int); // { dg-bogus "first argument to 'va_arg' not of type 'va_list'" }
|
||||
va_end (ap);
|
||||
}
|
@ -1266,7 +1266,12 @@ copy_tree_body_r (tree *tp, int *walk_subtrees, void *data)
|
||||
/* Handle the case where we substituted an INDIRECT_REF
|
||||
into the operand of the ADDR_EXPR. */
|
||||
if (TREE_CODE (TREE_OPERAND (*tp, 0)) == INDIRECT_REF)
|
||||
*tp = TREE_OPERAND (TREE_OPERAND (*tp, 0), 0);
|
||||
{
|
||||
tree t = TREE_OPERAND (TREE_OPERAND (*tp, 0), 0);
|
||||
if (TREE_TYPE (t) != TREE_TYPE (*tp))
|
||||
t = fold_convert (remap_type (TREE_TYPE (*tp), id), t);
|
||||
*tp = t;
|
||||
}
|
||||
else
|
||||
recompute_tree_invariant_for_addr_expr (*tp);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user