D Front End for GCC - Release 1f
Last update: April 22, 2004
Supported Systems

    * GCC 3.3.x, 3.4 snapshots
    * Linux (Red Hat 8)
    * Mac OS X 10.3.2
    * FreeBSD 5.2.1
    * Cygwin

Similar versions should work and other Unix platforms may work.
Although the compiler will probably work on most 32-bit architectures,
the D runtime library will still need to be updated to support them.
Downloads

    * Main package (Front end sources and runtime library)
      http://home.earthlink.net/~dvdfrdmn/d/d-for-gcc-r1f.tgz
    * Build Instructions
      http://home.earthlink.net/~dvdfrdmn/d/INSTALL.html
      (or see INSTALL included in the main package)

Links

    * This Project -- http://home.earthlink.net/~dvdfrdmn/d
    * The D Programming Language -- http://www.digitalmars.com/d/
    * The D.gnu newsgroup -- news://news.digitalmars.com/D.gnu
    * The GNU Compiler Collection -- http://gcc.gnu.org/

Contact
David Friedman
e-mail: d3rdclsmail <at> earthlink.net

Status
What's Working

    * All types, most expressions and statements
    * Exception handling
    * Phobos runtime library

What's not Working

    * Inline assembler

Gray Area / Known Issues

    * Don't be surprised if you get internal compiler errors.
    * Debugging information isn't working completely.  Things are a little better with DWARF2.  Probably need to add D name demangling support to the debugger.
    * Templates on Mac OS X.  The stock compiler doesn't support one-only linkage.  Apple's version does support it, but this release will not work with that.  Here is a work-around:
         1. Compile modules with the -fno-emit-templates flag.
         2. Put all needed template instances in a separate module (alias MyTemplate!(MyType) some_random_name;) and compile that normally.
         3. Link.
         4. Yay! It's C++ template madness all over again!
    * Complex floating point operations may not work the same as DMD.
    * Integer operations may not have the correct signed/unsigned mode.
    * Registers are not saved on the stack before garbage collection.
    * The 80-bit real type is not supported on Mac OS X and is replaced by the 64-bit double type.
    * Some math functions behave differently due to the 80-bit real issue and not being able to access x86 floating-point hardware.  The std.math unit tests will fail because of this.
    * Some hex floating point literals can crash the strtod() function on Mac OS X!  These have been commented out.
    * In order to prevent nested synchronized statements from deadlocking, pthread recursive mutexes are used.  This can cause starvation problems on Linux.  I will try the "error-checking" type mutex.
    * Volatile statements probably don't do the right thing.
    * Thrown exceptions probably leak memory.
    * Compiling a file with a hyphen in the file name will fail.
    * Delegates that refer to nested functions are not valid after the parent function returns.

Known Differences from DMD

    * This front end implements unaligned bit-slices.  The D specs don't discuss this.  Besides returning different data, the potential pitfall is that a bit slice may not point the same data as the original.

      The following is and example to show the difference.

import std.c.stdio;
int main() {
  static bit[] a = [ 0, 0, 0, 0,/**/, 0, 0, 0, 1,
                     1, 1, 0, 1,/**/, 1, 1, 0, 0 ];
  bit[] b = a[1..9];
  for (uint i = 0; i < a.length; i++) {
   printf("a[%d] = %d\n", i, a[i]);
  }
  for (uint i = 0; i < b.length; i++) {
   printf("b[%d] = %d\n", i, b[i]);
  }
  return 0;
}

    * Private functions are not exported from the object file.
    * delete on a pointer to a struct with a custom deallocator calls the deallocator.  DMD doesn't seem to do this... The compiler prints a warning if delete is used on anything other than a class (you'll see this while compiling Phobos ;-).

Usage
The compiler driver is named 'gdc' and accepts the standard GCC options.  There is also a script named 'dmd' which has the same interface as the original dmd.

The mapping from DMD options to GCC is as follows:
-c
	-c
-d
	-fdeprecated
-debug[=<arg>]
	-fdebug[=<arg>]
-gt
	(see GCC manual for profiling options)
-inline
	-finline-functions
-I<path>
	-I <path>
-L<path>
	-L <path>
-O
	-O2 (may not be the equivalent level)
-od<dir>
	no equivalent; use the wrapper script
-of<file>
	-o <file>
-op<dir>
	no equivalent; use the wrapper script
-release
	-frelease
-unittest
	-funittest
-version=<arg>
	-fversion=<arg>

Other options:
-f[no-]bounds-check
	Controls array bounds checking
-f[no-]emit-templates
	Controls whether or not template code is emitted
-fall-sources
	For each source file on the command line, semantically process
	each file preceding it.  Use this if compilation errors occur
	due to complicated circular module references.  This will slow
	compilation noticeably.  Changes 1f:

    * Fixes
          o Compilation and linking problems when overriding some, but
            not all interface methods
          o Support all comparison operators for arrays
          o Static initializers for structs with anonymous unions of
            anonymous structs
          o Continue in foreach statements
          o Increment key in foreach statements
          o ICE when storing to bit variables and for some boolean
            expression (for GCC 3.3)
          o Critical sections without an object
          o Semantics of casting to/from void[]
          o Problems with unaligned bit slices
          o Use -fdebug= properly
          o Bit array assumings in GC code
          o Build problems due to missing long double support on the
	    host system.
    * Improvements
          o Update to DMD 0.82
          o Use parts of the Boehm garbage collector to determine the
            stack and data extents.  This does not change the behavior
            of the D garbage collector.
          o Support semantic processing of all source files on the
            command line before generating code.
          o Added the 'dmd' wrapper script.
          o Automatically generate support for the target Unix, math,
            and C library configuration.

1e:

    * Removed debug code from std.thread
    * Auto-generate Unix definitions
    * Intrinsics implemented in D code
    * Correct iteration bounds for foreach on a static array
    * Fix ICE when using an assignment expressions as a boolean value
    * Fix ICE for new <struct>

1d:

    * ICE when a struct was used before its definition
    * Segfault on empty scope statements
    * ICE for associative array properties
    * Segfault on typedef'd floating point constants
    * Handle calls to super
    * Fix assignment ops on bit arrays
    * Fix layout of struct stat for darwin

1c:

    * Add missing objects and recls to libphobos.a
    * Make some build fixes for recls.
    * Add "ULL" to 64-bit constants
    * Don't try to include bits/*.h
    * Add install commands to the Phobos makefile

1b:

    * Fix crasher bug in driver when extra libraries are specified
    * Make 'phobos/gcc' a real directory and not a symlink
    * Update phobos install instructions.


    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

