Commit 46314d3e by Eric Botcazou Committed by Eric Botcazou

re PR middle-end/44101 (ICE compiling 25_algorithms/fill/4.cc on Tru64 UNIX V5.1B)

	PR middle-end/44101
	* gimplify.c (gimplify_init_constructor): Build a VIEW_CONVERT_EXPR
	around the uniquized constructor if its type requires a conversion.

From-SVN: r159655
parent f99fcb3b
2010-05-21 Eric Botcazou <ebotcazou@adacore.com>
PR middle-end/44101
* gimplify.c (gimplify_init_constructor): Build a VIEW_CONVERT_EXPR
around the uniquized constructor if its type requires a conversion.
2010-05-21 Jakub Jelinek <jakub@redhat.com>
PR debug/44205
......
......@@ -3813,8 +3813,11 @@ gimplify_init_constructor (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
if (notify_temp_creation)
return GS_ERROR;
walk_tree (&ctor, force_labels_r, NULL, NULL);
TREE_OPERAND (*expr_p, 1) = tree_output_constant_def (ctor);
walk_tree (&ctor, force_labels_r, NULL, NULL);
ctor = tree_output_constant_def (ctor);
if (!useless_type_conversion_p (type, TREE_TYPE (ctor)))
ctor = build1 (VIEW_CONVERT_EXPR, type, ctor);
TREE_OPERAND (*expr_p, 1) = ctor;
/* This is no longer an assignment of a CONSTRUCTOR, but
we still may have processing to do on the LHS. So
......
2010-05-21 Eric Botcazou <ebotcazou@adacore.com>
* g++.dg/other/const3.C: New test.
2010-05-20 Daniel Franke <franke.daniel@gmail.com>
PR fortran/38407
......
// PR middle-end/44101
// { dg-do compile }
extern bool equal (int[], int[], const int[]);
extern bool equal (wchar_t[], wchar_t[], const wchar_t[]);
void foo(void)
{
const int A1[] = {3, 3, 3, 3, 3, 3, 3, 3, 3, 3};
const int N1 = sizeof(A1) / sizeof(int);
int i1[N1];
if (equal(i1, i1 + N1, A1))
return;
const wchar_t A3[] = {L'\3', L'\3', L'\3', L'\3', L'\3',
L'\3', L'\3', L'\3', L'\3', L'\3'};
const int N3 = sizeof(A3) / sizeof(wchar_t);
wchar_t i3[N3];
if (equal(i3, i3 + N3, A3))
return;
}
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