This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Bug in tree-sra.c:sra_walk_modify_expr
- From: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- To: rth at redhat dot com
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 1 Nov 04 10:30:51 EST
- Subject: Bug in tree-sra.c:sra_walk_modify_expr
I think the "if (lhs_elt)" and "if (rhs_elt)" blocks have to be put in the
other order. The way it is now is responsible for a group of 9 ACATS tests
that regressed a while ago.
A tiny test case is
PROCEDURE C41103A IS
TYPE R (LENGTH : INTEGER) IS
RECORD
S : STRING (1..LENGTH);
END RECORD;
N5 : R(4) := (LENGTH => 4, S => "ABCD");
BEGIN
IF N5.S(3) /= 'C' THEN
raise Program_Error;
END IF;
END C41103A;
The key statement is this one:
D.423 = VIEW_CONVERT_EXPR<struct c41103a__Tn5S>(D.422);
D.423 and D.422.s are both done by element-copy.
If the LHS is done first, that statement gets replaced by the four copy-out
statements for the replacements of D.423. Then we call sra_walk_expr and do
the copy-in for D.422.s. However, those are placed only before the *last* of
the copy-out statements, not before all of them, as they should be.
Do you agree?