This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]