Bug 23711 - [4.1 regression] [s390] bootstrap error in libjava (ICE in fixup_eh_region_note)
Summary: [4.1 regression] [s390] bootstrap error in libjava (ICE in fixup_eh_region_note)
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.1.0
: P2 normal
Target Milestone: 4.1.0
Assignee: Not yet assigned to anyone
URL:
Keywords: build, ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2005-09-03 07:15 UTC by Debian GCC Maintainers
Modified: 2005-09-07 14:03 UTC (History)
1 user (show)

See Also:
Host:
Target: s390-linux
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-09-05 14:51:35


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Debian GCC Maintainers 2005-09-03 07:15:09 UTC
CVS HEAD 20050901, complete build log at
http://buildd.debian.org/fetch.php?&pkg=gcc-snapshot&ver=20050901-1&arch=s390&stamp=1125582332&file=log&as=raw

if /bin/sh ./libtool --mode=compile
/build/buildd/gcc-snapshot-20050901/build/./gcc/xgcc -shared-libgcc
-B/build/buildd/gcc-snapshot-20050901/build/./gcc -nostdinc++
-L/build/buildd/gcc-snapshot-20050901/build/s390-linux-gnu/libstdc++-v3/src
-L/build/buildd/gcc-snapshot-20050901/build/s390-linux-gnu/libstdc++-v3/src/.libs
-B/usr/lib/gcc-snapshot/s390-linux-gnu/bin/
-B/usr/lib/gcc-snapshot/s390-linux-gnu/lib/ -isystem
/usr/lib/gcc-snapshot/s390-linux-gnu/include -isystem
/usr/lib/gcc-snapshot/s390-linux-gnu/sys-include -DHAVE_CONFIG_H -I.
-I../../../src/libjava -I./include -I./gcj  -I../../../src/libjava -Iinclude
-I../../../src/libjava/include -I../../../src/libjava/classpath/include
-I../../../src/libjava/classpath/native/fdlibm
-I../../../src/libjava/../boehm-gc/include -I../boehm-gc/include 
-I../../../src/libjava/libltdl -I../../../src/libjava/libltdl
-I../../../src/libjava/.././libjava/../gcc -I../../../src/libjava/../zlib
-I../../../src/libjava/../libffi/include -I../libffi/include  -fno-rtti
-fnon-call-exceptions  -fdollars-in-identifiers -Wswitch-enum
-D_FILE_OFFSET_BITS=64 -Wextra -Wall -D_GNU_SOURCE
-DPREFIX="\"/usr/lib/gcc-snapshot\"" -DLIBDIR="\"/usr/lib/gcc-snapshot/lib\""
-DJAVA_HOME="\"/usr/lib/gcc-snapshot/jre\""
-DBOOT_CLASS_PATH="\"/usr/lib/gcc-snapshot/jre/lib/rt.jar\""
-DJAVA_EXT_DIRS="\"/usr/lib/gcc-snapshot/share/java/ext\""
-DGCJ_ENDORSED_DIRS="\"/usr/lib/gcc-snapshot/share/java/gcj-endorsed\""
-DLIBGCJ_DEFAULT_DATABASE="\"/usr/lib/gcc-snapshot/lib/gcj-4.1.0/classmap.db\""
-DLIBGCJ_DEFAULT_DATABASE_PATH_TAIL="\"gcj-4.1.0/classmap.db\""
-DTOOLEXECLIBDIR="\"/usr/lib/gcc-snapshot/lib\"" -g -O2  -D_GNU_SOURCE -MT
jni.lo -MD -MP -MF "$depbase.Tpo" -c -o jni.lo ../../../src/libjava/jni.cc; \
then mv -f "$depbase.Tpo" "$depbase.Plo"; else rm -f "$depbase.Tpo"; exit 1; fi
/build/buildd/gcc-snapshot-20050901/build/./gcc/xgcc -shared-libgcc
-B/build/buildd/gcc-snapshot-20050901/build/./gcc -nostdinc++
-L/build/buildd/gcc-snapshot-20050901/build/s390-linux-gnu/libstdc++-v3/src
-L/build/buildd/gcc-snapshot-20050901/build/s390-linux-gnu/libstdc++-v3/src/.libs
-B/usr/lib/gcc-snapshot/s390-linux-gnu/bin/
-B/usr/lib/gcc-snapshot/s390-linux-gnu/lib/ -isystem
/usr/lib/gcc-snapshot/s390-linux-gnu/include -isystem
/usr/lib/gcc-snapshot/s390-linux-gnu/sys-include -DHAVE_CONFIG_H -I.
-I../../../src/libjava -I./include -I./gcj -I../../../src/libjava -Iinclude
-I../../../src/libjava/include -I../../../src/libjava/classpath/include
-I../../../src/libjava/classpath/native/fdlibm
-I../../../src/libjava/../boehm-gc/include -I../boehm-gc/include
-I../../../src/libjava/libltdl -I../../../src/libjava/libltdl
-I../../../src/libjava/.././libjava/../gcc -I../../../src/libjava/../zlib
-I../../../src/libjava/../libffi/include -I../libffi/include -fno-rtti
-fnon-call-exceptions -fdollars-in-identifiers -Wswitch-enum
-D_FILE_OFFSET_BITS=64 -Wextra -Wall -D_GNU_SOURCE
-DPREFIX=\"/usr/lib/gcc-snapshot\" -DLIBDIR=\"/usr/lib/gcc-snapshot/lib\"
-DJAVA_HOME=\"/usr/lib/gcc-snapshot/jre\"
-DBOOT_CLASS_PATH=\"/usr/lib/gcc-snapshot/jre/lib/rt.jar\"
-DJAVA_EXT_DIRS=\"/usr/lib/gcc-snapshot/share/java/ext\"
-DGCJ_ENDORSED_DIRS=\"/usr/lib/gcc-snapshot/share/java/gcj-endorsed\"
-DLIBGCJ_DEFAULT_DATABASE=\"/usr/lib/gcc-snapshot/lib/gcj-4.1.0/classmap.db\"
-DLIBGCJ_DEFAULT_DATABASE_PATH_TAIL=\"gcj-4.1.0/classmap.db\"
-DTOOLEXECLIBDIR=\"/usr/lib/gcc-snapshot/lib\" -g -O2 -D_GNU_SOURCE -MT jni.lo
-MD -MP -MF .deps/jni.Tpo -c ../../../src/libjava/jni.cc  -fPIC -DPIC -o .libs/jni.o
../../../src/libjava/jni.cc: In function 'void
_Jv_JNI_GetStringUTFRegion(JNIEnv*, java::lang::String*, jsize, jsize, char*)':
../../../src/libjava/jni.cc:1396: internal compiler error: in
fixup_eh_region_note, at reload1.c:3808
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
make[5]: *** [jni.lo] Error 1
make[5]: Leaving directory
`/build/buildd/gcc-snapshot-20050901/build/s390-linux-gnu/libjava'
Comment 1 Andrew Pinski 2005-09-03 12:03:30 UTC
This is most likely a target problem.
For the target maintainer see <http://gcc.gnu.org/ml/gcc-patches/2005-09/msg00053.html> for 
more information.
Comment 2 Andrew Pinski 2005-09-05 14:51:35 UTC
See <http://gcc.gnu.org/ml/gcc/2005-09/msg00087.html> for more information about this issue.
Comment 3 Andrew Pinski 2005-09-06 00:59:43 UTC
Reducing.
Comment 4 Andrew Pinski 2005-09-06 01:03:48 UTC
I am starting to think this is not a reload issue but an issue somewhere else which combines the 
instructions into one movsi. 
Comment 5 Andrew Pinski 2005-09-06 01:48:34 UTC
Reduced testcase:
extern "Java" {
  namespace java   {
    namespace lang     {
      class Class;
      class Throwable;
    }
  }
}
typedef class java::lang::Class* jclass;
typedef class java::lang::Throwable* jthrowable;
typedef struct _Jv_JNIEnv JNIEnv;
struct _Jv_JNIEnv {
  jthrowable ex;
};
class java::lang::Throwable {
  
  static ::java::lang::Class class$;
};
void f(void);
void g (JNIEnv *env)
{
  try     {
    f();
  }
  catch (jthrowable t)     {
    env->ex = t;
  }
}


But I think we have a C++ or exand bug:
<bb 0>:
  f ();
  goto <bb 2> (<L1>);

<L0>:;
  D.1724 = (struct Throwable * *) <<<exception object>>>;
  env->ex = *(D.1724 - 4);

that is what we get.
notice how the load/store is in the same BB which means the load is marked as NO_THROW.
Comment 6 Andrew Pinski 2005-09-06 01:57:38 UTC
I am starting to think this is a front-end bug.  We do have a mismatch types here.
Comment 7 Andrew Pinski 2005-09-06 01:58:02 UTC
Let me fix the type mismatch and see if that fixes it.
Comment 8 Andrew Pinski 2005-09-06 02:21:11 UTC
Hmm, with -fno-tree-ter, we don't get an ICE but I this is a middle-end bug with respect of lowering eh 
constructs.
Comment 9 Andrew Pinski 2005-09-06 03:40:31 UTC
Looks like the issue is that reload's assert should be checking about internal_throw when it is checking 
the trap_count.

See <http://gcc.gnu.org/ml/gcc/2005-09/msg00107.html> for the patch which could be tested.
Comment 10 Andrew Pinski 2005-09-07 14:03:14 UTC
Fixed by:
2005-09-07  Andreas Krebbel  <krebbel1@de.ibm.com>

        * reload1.c (fixup_eh_region_note): Remove assertion.
        (fixup_abnormal_edges): Reverted removal of call to
        find_many_sub_basic_blocks made on 2005-08-31.