August 09, 2014
http://bugzilla.gdcproject.org/show_bug.cgi?id=148

            Bug ID: 148
           Summary: gcc inline asm instruction template must be a constant
                    char string regression
           Product: GDC
           Version: 4.9.x
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: Normal
         Component: gdc
          Assignee: ibuclaw@gdcproject.org
          Reporter: art.08.09@gmail.com

void main() {
   asm {""~"" ; } // => instruction template must be a constant char string
}

Just tried to recompile some programs that used to build with an old GDC version, and found this. It's a regression; at least string concatenation used to work w/ 'gdc 0.31 - r748:ab99d67f04c2, using dmd 2.057'. Now it seems the compiler doesn't like anything other than a string literal. Which means that generating asms inside templates, based on type and size became impossible, at least directly. (The original code that triggered this was selecting op suffixes based on size)


Would it be possible to accept any expression that can be evaluated at CT and returns a string? Eg

   enum E = ""~"";
   asm {E ; }  // => unimplemented: D inline assembler statements are not
supported in GDC.
   asm {mixin(""~"") ; } // ditto

(These two did NOT work previously, so this, unlike the example above, would be
an enhancement)

-- 
You are receiving this mail because:
You are watching all bug changes.