www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1470] New: "extern (C)" inside function crashes gdc

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1470

           Summary: "extern (C)" inside function crashes gdc
           Product: D
           Version: 2.004
          Platform: Macintosh
        OS/Version: Mac OS X
            Status: NEW
          Severity: normal
          Priority: P3
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: u.singer gmx.net


Hi,

I am using the  D compiler on Mac OS X 10.4 ("gdc-0.24-mac-10.4.dmg" from
sourceforge.net).
The following code crashes my gdc:

long atol (string str)
{
    extern (C) long atoll(char *nptr);
    return atoll(cast(char *)(str));
}

When running gdc, it says:

crash.d: In function ‘atol’:
crash.d:5: internal compiler error: Bus error
Please submit a full bug report ...

If I put the "extern (C)" declaration out of the function, the bus error goes
away.


-- 
Sep 02 2007
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1470


u.singer gmx.net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|2.004                       |1.020





As an issue tracker newbie, I first got the "Component" & "Version" fields
wrong. Meantime, I corrected the "Version" to 1.020 following the output of the
"gdc -v" command:

Using built-in specs.
Target: powerpc-apple-darwin8
Configured with: /usr/local/staging/r24rc1/gcc-5363/build/obj/src/configure
--disable-checking -enable-werror --prefix=/usr --mandir=/share/man
--enable-languages=c,c++,d --program-transform-name=/^[cg][^.-]*$/s/$/-4.0/
--with-gxx-include-dir=/include/c++/4.0.0 --with-slibdir=/usr/lib
--build=i686-apple-darwin8 --program-prefix= --host=powerpc-apple-darwin8
--target=powerpc-apple-darwin8
Thread model: posix
gcc version 4.0.1 (Apple Computer, Inc. build 5363) (gdc 0.24, using dmd 1.020)

Also, I gained the impression that the actual failing component is the gcc
backend, not gdc itself. Nevertheless, the builders of gdc / dmd will be far
better capable than myself of determining the cause of the crash...


-- 
Sep 04 2007