String optimization bug

Imported from http://bugzilla.roxen.com/bugzilla/show_bug.cgi?id=7780

Reported by Jonas Wallden jonasw@roxen.com

I see unexpected string handling in 8.0.290 compared to 7.8. Test program:

void main()
{
  string s1 = "aaaaa";
  string s2 = "BBBBBBBB";
  werror("#1: %s\n", (s2 + s1)[..sizeof(s1) - 1]);
  s2 = (s2 + s1)[..sizeof(s1) - 1];
  werror("#2: %s\n", s2);
}

Output from 7.8:

#1: BBBBB
#2: BBBBB

Output from 8.0.290:

#1: BBBBB
#2: BBBBBBBBaaaaa