Thread overview
[Bug 106] [ARM] pragma(mangle) not working if -fsection-anchors is enabled
Feb 15, 2014
Johannes Pfau
Feb 15, 2014
Iain Buclaw
Feb 15, 2014
Iain Buclaw
Feb 15, 2014
Johannes Pfau
Feb 16, 2014
Johannes Pfau
Feb 19, 2014
Johannes Pfau
February 15, 2014
http://bugzilla.gdcproject.org/show_bug.cgi?id=106

Johannes Pfau <johannespfau@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
         AssignedTo|ibuclaw@gdcproject.org      |johannespfau@gmail.com

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

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ibuclaw@gdcproject.org

--- Comment #1 from Iain Buclaw <ibuclaw@gdcproject.org> 2014-02-15 14:42:01 GMT ---
Problem #2:

D main ()
{
  int D.2453;
  struct  D.2452;
  int test_______________________________________9.0;
  int test_______________________________________9.0_1;
  int _2;
}


The DECL_NAME should really be the language name, not the DECL_ASSEMBLER_NAME.

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

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED

--- Comment #2 from Iain Buclaw <ibuclaw@gdcproject.org> 2014-02-15 19:04:51 GMT ---
(In reply to comment #1)
> Problem #2:
> 
> D main ()
> {
>   int D.2453;
>   struct  D.2452;
>   int test_______________________________________9.0;
>   int test_______________________________________9.0_1;
>   int _2;
> }
> 
> 
> The DECL_NAME should really be the language name, not the DECL_ASSEMBLER_NAME.

https://github.com/D-Programming-GDC/GDC/commit/79ebb4c0012485528cbf900b8bc8280423a872ff

Now puts out:

D main ()
{
  int D.2453;
  struct  D.2452;
  int test.test9_1_e.0;
  int test.test9_1_e.0_1;
  int _2;
/* ... */
}


When fixing this, I found that d_comdat_group was calling DECL_ASSEMBLER_NAME before one had been set for var decls, oops.  That is not good if the DECL_NAME has unfriendly symbols in it (eg: "quotes").

https://github.com/D-Programming-GDC/GDC/commit/64b4aa77a5d1e7254f783f9b835df216d85a3f0b

However, the code logic in -fdump-tree-optimized-asmname is still not right:

{
  <bb 2>:
  test_эльфийские_письмена_9 = 42;
  test.test9_1_e.0_1 = test_эльфийские_письмена_9;
  if (test.test9_1_e.0_1 == 42)
}


So finally:

https://github.com/D-Programming-GDC/GDC/commit/942298f595e95cc60d75fa111645498420f6aa2e

{
  <bb 2>:
  *test_эльфийские_письмена_9 = 42;
  test.test9_1_e.0_1 = *test_эльфийские_письмена_9;
  if (test.test9_1_e.0_1 == 42)
}


Fixed!

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

Johannes Pfau <johannespfau@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|FIXED                       |
     Ever Confirmed|1                           |0

--- Comment #3 from Johannes Pfau <johannespfau@gmail.com> 2014-02-15 19:43:59 GMT ---
Great!
I don't doubt those changes were necessary but I managed to reproduce the issue
in C in the meantime so I guess you haven't actually tested these changes on
ARM?

I'm building a new compiler with your changes right now and I'll check if it really completely fixes the problem. I'll have to apologize on the GCC bugtracker then though cause I just filed a bug report about this some minutes ago....

Here's the C test case:
-----------------------------------------------------
int test9_1 asm ("test_эльфийские_письмена_9") = 0;
extern int test9_1_e asm ("test_эльфийские_письмена_9");

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

(note how test9_1 must be initialized for the bug to show up)

-- 
Configure bugmail: http://bugzilla.gdcproject.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.
February 16, 2014
http://bugzilla.gdcproject.org/show_bug.cgi?id=106

Johannes Pfau <johannespfau@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1

--- Comment #4 from Johannes Pfau <johannespfau@gmail.com> 2014-02-16 08:03:57 GMT ---
Unfortunately I can still reproduce this. Here's the URL to the GCC bug: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60214

We could close this as RESOLVED/NOTOURBUG but as people will probably see a failing test case because of this it's probably better to keep it open so it's easier to find this report.

-- 
Configure bugmail: http://bugzilla.gdcproject.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.
February 19, 2014
http://bugzilla.gdcproject.org/show_bug.cgi?id=106

Johannes Pfau <johannespfau@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID

--- Comment #5 from Johannes Pfau <johannespfau@gmail.com> 2014-02-19 18:33:56 GMT ---
Test case fixed in dmd and backported: https://github.com/D-Programming-GDC/GDC/commit/36d078bec94f43c0974057b09f1ca3cff909a2f2

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