www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12798] New: constant folding should optimize subsequent


          Issue ID: 12798
           Summary: constant folding should optimize subsequent
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: performance
          Severity: major
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: k.hara.pg gmail.com

This is front-end optimizer issue.

Preceding concatenations of string literals will be optimized to one long

string x;

string y = "a" ~ "b" ~ x;   // optimized to "ab" ~ x

But subsequent one doesn't.

string z = x ~ "a" ~ "b";   // not optimized to x ~ "ab"

May 24 2014