www.digitalmars.com         C & C++   DMDScript  

D.gnu - [Bug 106] New: [ARM] pragma(mangle) not working if -fsection-anchors

http://bugzilla.gdcproject.org/show_bug.cgi?id=106

             Bug #: 106
           Summary: [ARM] pragma(mangle) not working if -fsection-anchors
                    is enabled
    Classification: Unclassified
           Product: GDC
           Version: development
          Platform: ARM
        OS/Version: All
            Status: NEW
          Severity: minor
          Priority: Normal
         Component: gdc
        AssignedTo: ibuclaw gdcproject.org
        ReportedBy: johannespfau gmail.com


------------------------------
__gshared pragma(mangle, "test_эльфийские_письмена_9") int
test9_1;
__gshared extern pragma(mangle, "test_эльфийские_письмена_9")
int test9_1_e;

void main()
{
    test9_1 = 42;
    assert(test9_1_e == 42);
}
------------------------------
Compile with '-O2'

Problem: GCC references test9_1 via section anchors, test9_1_e is always done
via a linker relocation to test_эльфийские_письмена_9. The
backend then doesn't
realize that test9_1 and test9_1_e are actually the same variable and switches
the order of the assignment and the assert.

The same as a C example:
-----------------------------
int test9_1 asm ("test_эльфийские_письмена_9");
extern int test9_1_e asm ("test_эльфийские_письмена_9");

int main()
{
    test9_1 = 42;
    return test9_1_e == 42;
}
-----------------------------

Works as expected.

-- 
Configure bugmail: http://bugzilla.gdcproject.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.
Feb 15 2014