PR middle-end/17411
* tree-sra.c (generate_element_zero): Revert recent build_int_cst
change. elt->type may be a floating point type, so use fold_convert.
* g++.dg/opt/pr17411-1.C: New test case.
From-SVN: r87377
+2004-09-11 Roger Sayle <roger@eyesopen.com>
+
+ PR middle-end/17411
+ * tree-sra.c (generate_element_zero): Revert recent build_int_cst
+ change. elt->type may be a floating point type, so use fold_convert.
+
2004-09-11 Geoffrey Keating <geoffk@apple.com>
* config/darwin.c (machopic_validate_stub_or_non_lazy_ptr): Mark
+2004-09-11 Roger Sayle <roger@eyesopen.com>
+
+ PR middle-end/17411
+ * g++.dg/opt/pr17411-1.C: New test case.
+
2004-09-11 Joseph S. Myers <jsm@polyomino.org.uk>
* gcc.dg/declspec-4.c, gcc.dg/declspec-5.c, gcc.dg/declspec-6.c,
--- /dev/null
+// PR middle-end/17411
+// { dg-do compile }
+// { dg-options "-O2" }
+
+struct CalibData {
+ float mean_pedestal;
+};
+
+struct pair
+{
+ CalibData second;
+ pair(const CalibData& __b) : second(__b) { }
+};
+
+void insert(const pair& __x);
+
+void foo()
+{
+ insert(pair(CalibData()));
+}
+
tree t;
gcc_assert (elt->is_scalar);
- t = build_int_cst (elt->type, 0);
+ t = fold_convert (elt->type, integer_zero_node);
t = build (MODIFY_EXPR, void_type_node, elt->replacement, t);
append_to_statement_list (t, list_p);