re PR tree-optimization/42714 (ICE in create_tmp_var, at gimplify.c:504)
2010-01-14 Martin Jambor <mjambor@suse.cz> PR tree-optimization/42714 * tree-sra.c (sra_ipa_modify_assign): Handle incompatible-type constructors specially. * gcc/testsuite/g++.dg/torture/pr42714.C: New test. From-SVN: r155905
This commit is contained in:
parent
a0463099e7
commit
92e97cdd7d
@ -1,3 +1,9 @@
|
|||||||
|
2010-01-14 Martin Jambor <mjambor@suse.cz>
|
||||||
|
|
||||||
|
PR tree-optimization/42714
|
||||||
|
* tree-sra.c (sra_ipa_modify_assign): Handle incompatible-type
|
||||||
|
constructors specially.
|
||||||
|
|
||||||
2010-01-14 Andi Kleen <ak@linux.intel.com>
|
2010-01-14 Andi Kleen <ak@linux.intel.com>
|
||||||
|
|
||||||
* config/i386/drivers-i386.c (detect_caches_intel):
|
* config/i386/drivers-i386.c (detect_caches_intel):
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
2010-01-14 Martin Jambor <mjambor@suse.cz>
|
||||||
|
|
||||||
|
PR tree-optimization/42714
|
||||||
|
* gcc/testsuite/g++.dg/torture/pr42714.C: New test.
|
||||||
|
|
||||||
2010-01-14 Alexander Monakov <amonakov@ispras.ru>
|
2010-01-14 Alexander Monakov <amonakov@ispras.ru>
|
||||||
|
|
||||||
PR rtl-optimization/42246
|
PR rtl-optimization/42246
|
||||||
|
37
gcc/testsuite/g++.dg/torture/pr42714.C
Normal file
37
gcc/testsuite/g++.dg/torture/pr42714.C
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
struct QVectorData {
|
||||||
|
static QVectorData shared_null;
|
||||||
|
};
|
||||||
|
template <typename T> class QVector {
|
||||||
|
union {
|
||||||
|
QVectorData *d;
|
||||||
|
};
|
||||||
|
public:
|
||||||
|
inline QVector() : d(&QVectorData::shared_null) { }
|
||||||
|
inline QVector(const QVector<T> &v) : d(v.d) { }
|
||||||
|
};
|
||||||
|
class QXmlStreamAttribute { };
|
||||||
|
class QXmlStreamAttributes : public QVector<QXmlStreamAttribute> { };
|
||||||
|
class __attribute__ ((visibility("default"))) Smoke {
|
||||||
|
public:
|
||||||
|
union StackItem;
|
||||||
|
typedef StackItem* Stack;
|
||||||
|
typedef short Index;
|
||||||
|
};
|
||||||
|
class SmokeBinding { };
|
||||||
|
namespace __smokeqt {
|
||||||
|
class x_QXmlStreamAttributes : public QXmlStreamAttributes {
|
||||||
|
SmokeBinding* _binding;
|
||||||
|
public:
|
||||||
|
static void x_11(Smoke::Stack x) {
|
||||||
|
x_QXmlStreamAttributes* xret = new x_QXmlStreamAttributes();
|
||||||
|
}
|
||||||
|
explicit x_QXmlStreamAttributes() : QXmlStreamAttributes() { }
|
||||||
|
};
|
||||||
|
void xcall_QXmlStreamAttributes(Smoke::Index xi, void *obj,
|
||||||
|
Smoke::Stack args)
|
||||||
|
{
|
||||||
|
switch(xi) {
|
||||||
|
case 11: x_QXmlStreamAttributes::x_11(args);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -3712,8 +3712,20 @@ sra_ipa_modify_assign (gimple *stmt_ptr, gimple_stmt_iterator *gsi, void *data)
|
|||||||
tree new_rhs = NULL_TREE;
|
tree new_rhs = NULL_TREE;
|
||||||
|
|
||||||
if (!useless_type_conversion_p (TREE_TYPE (*lhs_p), TREE_TYPE (*rhs_p)))
|
if (!useless_type_conversion_p (TREE_TYPE (*lhs_p), TREE_TYPE (*rhs_p)))
|
||||||
new_rhs = fold_build1_loc (gimple_location (stmt), VIEW_CONVERT_EXPR,
|
{
|
||||||
TREE_TYPE (*lhs_p), *rhs_p);
|
if (TREE_CODE (*rhs_p) == CONSTRUCTOR)
|
||||||
|
{
|
||||||
|
/* V_C_Es of constructors can cause trouble (PR 42714). */
|
||||||
|
if (is_gimple_reg_type (TREE_TYPE (*lhs_p)))
|
||||||
|
*rhs_p = fold_convert (TREE_TYPE (*lhs_p), integer_zero_node);
|
||||||
|
else
|
||||||
|
*rhs_p = build_constructor (TREE_TYPE (*lhs_p), 0);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
new_rhs = fold_build1_loc (gimple_location (stmt),
|
||||||
|
VIEW_CONVERT_EXPR, TREE_TYPE (*lhs_p),
|
||||||
|
*rhs_p);
|
||||||
|
}
|
||||||
else if (REFERENCE_CLASS_P (*rhs_p)
|
else if (REFERENCE_CLASS_P (*rhs_p)
|
||||||
&& is_gimple_reg_type (TREE_TYPE (*lhs_p))
|
&& is_gimple_reg_type (TREE_TYPE (*lhs_p))
|
||||||
&& !is_gimple_reg (*lhs_p))
|
&& !is_gimple_reg (*lhs_p))
|
||||||
|
Loading…
Reference in New Issue
Block a user