Commit 97a170cd by Richard Guenther Committed by Richard Biener

re PR c++/38908 (Unexplained "'<anonymous>' is used uninitialized in this…

re PR c++/38908 (Unexplained "'<anonymous>' is used uninitialized in this function" warning in cc1plus -m64)

2009-01-28  Richard Guenther  <rguenther@suse.de>

	PR middle-end/38908
	* tree-ssa.c (warn_uninitialized_var): Do not warn for seemingly
	uninitialized aggregate uses in call arguments.

	* g++.dg/warn/Wuninitialized-2.C: New testcase.

From-SVN: r143722
parent 89ebafc6
2009-01-28 Richard Guenther <rguenther@suse.de>
PR middle-end/38908
* tree-ssa.c (warn_uninitialized_var): Do not warn for seemingly
uninitialized aggregate uses in call arguments.
2009-01-28 Paolo Bonzini <bonzini@gnu.org>
PR tree-optimization/38984
......
2009-01-28 Richard Guenther <rguenther@suse.de>
PR middle-end/38908
* g++.dg/warn/Wuninitialized-2.C: New testcase.
2009-01-28 Paolo Bonzini <bonzini@gnu.org>
PR tree-optimization/38984
......
/* { dg-do compile } */
/* { dg-options "-O -Wuninitialized" } */
struct S8 { template<typename T> S8(T) { } };
template<typename T> struct S10;
template<typename T> struct S10<T()> { typedef T S12; typedef S8 S1(); };
template<typename T> struct S3 { };
template<typename T> struct S11 { S11(S3<T>); };
struct S2
{
template<typename T> operator S11<T>() { return S11<T>(S5<T>()); }
template<typename T> struct S5:public S3<T>
{
virtual typename S10<T>::S12 S13() {
return 0;
}
};
};
template<typename T> S11<T> S6(S3<T>) { return S11<T>(S3<T>()); }
template<typename S12> struct S7 { typedef S12 S15(); };
struct S4
{
template<typename T> operator S11<T>()
{
struct S14:public S3<T>
{
S14(S2 x):S11_(x) { }
S11<typename S7<typename S10<T>::S12>::S15> S11_;
};
return S6(S14(S11_));
}
S2 S11_;
};
struct S9
{
template<typename F> operator S11<F>() { return S11<F>(S14<F>(S11_)); }
template<typename F> struct S14:public S3<F>
{
S14(S4 x):S11_(x) { }
S11<typename S10<F>::S1> S11_;
};
S4 S11_;
};
void S15(S11<void()>);
void S16() { S9 x; S15(x); }
......@@ -1496,9 +1496,13 @@ warn_uninitialized_var (tree *tp, int *walk_subtrees, void *data_)
|| !gimple_aliases_computed_p (cfun))
return NULL_TREE;
/* If the load happens as part of a call do not warn about it. */
if (is_gimple_call (data->stmt))
return NULL_TREE;
vuse = SINGLE_SSA_USE_OPERAND (data->stmt, SSA_OP_VUSE);
if (vuse == NULL_USE_OPERAND_P)
return NULL_TREE;
return NULL_TREE;
op = USE_FROM_PTR (vuse);
if (t != SSA_NAME_VAR (op)
......
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