http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56975

             Bug #: 56975
           Summary: [regression] dllimport broken on i686-pc-cygwin
    Classification: Unclassified
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: da...@gcc.gnu.org


Created attachment 29880
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29880
preprocessed testcase

Attempting to reference a dllimported symbol with current HEAD causes an ICE
with an unrecognized insn.  This breaks bootstrap at stage1 building libgcc. 
Here's a testcase using stage1 cc1.exe from a failed build dir:

$ cat foo.i

void *foo (void);

__attribute__((dllimport)) void * __attribute__((__stdcall__)) bar(const char *
lpModuleName);

void *
foo (void)
{
  void *ptr = bar ((const char *)0);
  return ptr;
}

DKAdmin@ubik /gnu/gcc/obj/i686-pc-cygwin/libgcc
$ /gnu/gcc/obj/./gcc/cc1.exe -fpreprocessed foo.i -quiet  -mtune=generic
-march=i686 -auxbase-strip crtbegin.o -g -g -g0 -O2 -O2 -O2 -Wextra -Wall
-Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes
-Wmissing-prototypes -Wold-style-definition -version -finhibit-size-directive
-fno-inline -fno-exceptions -fno-zero-initialized-in-bss -fno-toplevel-reorder
-fno-tree-vectorize -fno-stack-protector -fno-omit-frame-pointer -o foo.s
GNU C (GCC) version 4.9.0 20130416 (experimental) (i686-pc-cygwin)
        compiled by GNU C version 4.7.2, GMP version 4.3.2, MPFR version
3.0.1-p4, MPC version 0.8
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
GNU C (GCC) version 4.9.0 20130416 (experimental) (i686-pc-cygwin)
        compiled by GNU C version 4.7.2, GMP version 4.3.2, MPFR version
3.0.1-p4, MPC version 0.8
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: 31da135ea647c81f0b254283fbd2bab6
foo.i: In function ‘foo’:
foo.i:11:1: error: unrecognizable insn:
 }
 ^
(insn 6 5 7 2 (set (reg:SI 61)
        (symbol_ref:SI ("bar@4") [flags 0x441] <function_decl 0x7fdf9c00 bar>))
foo.i:9 -1
     (nil))
foo.i:11:1: internal compiler error: in extract_insn, at recog.c:2150

foo.i:11:1: internal compiler error: Aborted
Aborted (core dumped)

DKAdmin@ubik /gnu/gcc/obj/i686-pc-cygwin/libgcc
$

Reply via email to