java/5876: jc1 crashes when targeting mingw32

adam@xwt.org adam@xwt.org
Thu Mar 7 14:06:00 GMT 2002


>Number:         5876
>Category:       java
>Synopsis:       jc1 crashes when targeting mingw32
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Mar 07 14:06:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Adam Megacz
>Release:        CVS as of 01-Mar-2002
>Organization:
>Environment:
Host: Linux, Target: mingw32
>Description:
jc1 segfaults thusly when targeting mingw32:

>How-To-Repeat:
Check out a fresh copy of gcc from CVS (01-Mar-2002 is known to contain the bug; that would be a good starting point). Configure with the following command, and 'make all-target-libjava'. The build will crash at some point.

../gcc/configure \
                 --prefix=$PREFIX \
                 --target=i686-pc-mingw32 \
                 --host=i686-pc-linux-gnu \
                 --enable-languages=c,c++,java \
                 --disable-nls \
                 --with-as=$PREFIX/i686-pc-mingw32/bin/as \
                 --with-ld=$PREFIX/i686-pc-mingw32/bin/ld \
                 --with-gnu-ld \
                 --with-gnu-as \
                 --enable-libgcj \
                 --enable-gc-type=boehm \
                 --disable-shared \
                 --enable-threads=win32 \
                 --disable-hash-synchronization \
                 --disable-interpreter \
                 --enable-sjlj-exceptions



>Fix:
Here's a patch from Jeff which was rejected by RTH because (according to him) "this is wrong, find out why."

*** winnt.c   2001/12/03 19:13:32     1.27
--- winnt.c   2002/02/02 16:39:32
***************
*** 110,116 ****

    /* In the C++ frontend, DECL_CONTEXT for a method doesn't actually refer
       to the containing class.  So we look at the 'this' arg.  */
!   if (TREE_CODE (TREE_TYPE (decl)) == METHOD_TYPE)
      {
        /* Artificial methods are not affected by the import/export status of
       their class unless they are virtual.  */
--- 110,117 ----

    /* In the C++ frontend, DECL_CONTEXT for a method doesn't actually refer
       to the containing class.  So we look at the 'this' arg.  */
!   if (TREE_TYPE (decl)
!       && TREE_CODE (TREE_TYPE (decl)) == METHOD_TYPE)
      {
        /* Artificial methods are not affected by the import/export status of
       their class unless they are virtual.  */
***************
*** 381,387 ****
        SYMBOL_REF_FLAG (XEXP (rtl, 0)) = 1;
      }

!   if (TREE_CODE (decl) == FUNCTION_DECL)
      if (lookup_attribute ("stdcall",
                        TYPE_ATTRIBUTES (TREE_TYPE (decl))))
        XEXP (DECL_RTL (decl), 0) =
--- 382,389 ----
        SYMBOL_REF_FLAG (XEXP (rtl, 0)) = 1;
      }

!   if (TREE_CODE (decl) == FUNCTION_DECL
!       && TREE_TYPE (decl))
      if (lookup_attribute ("stdcall",
                        TYPE_ATTRIBUTES (TREE_TYPE (decl))))
        XEXP (DECL_RTL (decl), 0) =


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Java-prs mailing list