Thread overview
[Bug 108] ICE using @attribute("forceinline")
Mar 16, 2014
Mike
Mar 16, 2014
Iain Buclaw
Mar 16, 2014
Iain Buclaw
March 16, 2014
http://bugzilla.gdcproject.org/show_bug.cgi?id=108

Mike <slavo5150@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Hardware|ARM                         |All
                 OS|Other                       |All

--- Comment #1 from Mike <slavo5150@yahoo.com> ---
The following test on Arch Linux 64 results in the same error.  Changing platform attribute to 'All'

************* Code to reproduce **************
import std.stdio;
import gcc.attribute;

@attribute("forceinline") static void test()
{
   writeln("here");
}

void main()
{
   test();
}

gdc --version
gdc (GCC) 4.8.2 20130725 (prerelease)

compiled with simply 'gdc main.d'

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


March 16, 2014
http://bugzilla.gdcproject.org/show_bug.cgi?id=108

--- Comment #2 from Iain Buclaw <ibuclaw@gdcproject.org> ---
Looks like the frontend devs changed the behaviours of optimize/interpret, again.  This'll need adding to the testsuite to catch any future changes.

*PATCH*
diff --git a/gcc/d/d-codegen.cc b/gcc/d/d-codegen.cc
index b0a50a4..a7acb92 100644
--- a/gcc/d/d-codegen.cc
+++ b/gcc/d/d-codegen.cc
@@ -830,8 +826,10 @@ build_attributes (Expressions *in_attrs)
   for (size_t i = 0; i < in_attrs->dim; i++)
     {
       Expression *attr = (*in_attrs)[i]->optimize (WANTexpand);
-      Dsymbol *sym = attr->type->toDsymbol (0);
+      if (attr->op == TOKcall)
+       attr = attr->ctfeInterpret();

+      Dsymbol *sym = attr->type->toDsymbol (0);
       if (!sym)
        continue;

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


March 16, 2014
http://bugzilla.gdcproject.org/show_bug.cgi?id=108

Iain Buclaw <ibuclaw@gdcproject.org> changed:

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

--- Comment #3 from Iain Buclaw <ibuclaw@gdcproject.org> ---
https://github.com/D-Programming-GDC/GDC/commit/b38af3d869fd7af5c83254febce92e5f39d796e6

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