------- Comment #7 from tkoenig at gcc dot gnu dot org 2010-08-07 11:17 ------- (In reply to comment #6)
Hi Dominique, > It turns out that the test in comment #0 was not fixed by the patch in comment > #5, but by revision 162966. However with the slight change > > a(4:23:3) = a(4:22:3) > > a temporary is still created. The patch in comment #5 avoid temporaries in > situations such as > > a(4:19:3) = a(7:22:3) > a(4:20:3) = a(7:22:3) > a(4:19:3) = a(7:23:3) > nl = 4 > nu = 20 > a(1:16:3) = a(4:nu:3) > a(1:16:3) = a(nl:20:3) > > but not for > > a(1:16:3) = a(nl:nu:3) the only unnecessary temporary still created with current trunk is your first example. I am more in favor of changing the upper bound to its actual value, probably during resolution. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44235