I got internal compile error when compiling vtk. The flowing ccPOF0j6.cxx is preprocessed file while compiling with sh4 native gcc. Then I confirm it using gcc-4_3_branch cross compiler. $ ~/x-tools/sh4-unknown-linux-gnu/bin/sh4-unknown-linux-gnu-gcc -g -O2 -fPIC ccPOF0j6.cxx /builddir/build/BUILD/VTK/Rendering/vtkFreeTypeUtilities.cxx: In function 'int vtkFreeTypeUtilitiesRenderString(vtkFreeTypeUtilities*, vtkTextProperty*, const char*, int, int, vtkImageData*, T*, int) [with T = vtkFreeTypeUtilities::RenderString::VTK_TT]': /builddir/build/BUILD/VTK/Rendering/vtkFreeTypeUtilities.cxx:1190: internal compiler error: in fixup_mova, at config/sh/sh.c:3756 Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. $ ~/x-tools/sh4-unknown-linux-gnu/bin/sh4-unknown-linux-gnu-gcc --version sh4-unknown-linux-gnu-gcc (crosstool-NG-1.2.0+svn_trunk@1080) 4.3.3 20081022 (prerelease)
Created attachment 16537 [details] ccPOF0j6.out
I've confirmed that it fails on the trunk and the reduced test case fails on 4.2.4.
Created attachment 16540 [details] a reduced test case The reduced test case fails on 4.2/4.3.
sh_reorg might insert a new mova in SH_FIXUP_PCLOAD phase. When untangle_mova looks this mova insn, it may not be associated with the insn address yet but the current code takes its undefined address. It seems that this mova should be skipped there because it will be handled later. I'm testing the attached patch. -- * config/sh/sh.c (untangle_mova): Return -1 when NEW_MOVA has no address. --- ORIG/trunk/gcc/config/sh/sh.c 2008-10-22 09:11:15.000000000 +0900 +++ LOCAL/trunk/gcc/config/sh/sh.c 2008-10-26 10:36:59.000000000 +0900 @@ -3826,6 +3826,10 @@ untangle_mova (int *num_mova, rtx *first if (optimize) { + /* If NEW_MOVA has no address yet, it will be handled later. */ + if (INSN_ADDRESSES_SIZE() <= (unsigned) INSN_UID (new_mova)) + return -1; + n_addr = INSN_ADDRESSES (INSN_UID (new_mova)); n_target = INSN_ADDRESSES (INSN_UID (XEXP (MOVA_LABELREF (new_mova), 0))); if (n_addr > n_target || n_addr + 1022 < n_target)
Subject: Bug 37909 Author: kkojima Date: Wed Oct 29 23:54:35 2008 New Revision: 141452 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=141452 Log: PR target/37909 * config/sh/sh.c (untangle_mova): Return -1 when NEW_MOVA has no address. Modified: trunk/gcc/ChangeLog trunk/gcc/config/sh/sh.c
Subject: Bug 37909 Author: kkojima Date: Fri Oct 31 03:43:20 2008 New Revision: 141486 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=141486 Log: PR target/37909 Backport from mainline: * config/sh/sh.c (untangle_mova): Return -1 when NEW_MOVA has no address. Modified: branches/gcc-4_3-branch/gcc/ChangeLog branches/gcc-4_3-branch/gcc/config/sh/sh.c
Subject: Bug 37909 Author: kkojima Date: Fri Oct 31 03:50:02 2008 New Revision: 141487 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=141487 Log: PR target/37909 Backport from mainline: * config/sh/sh.c (untangle_mova): Return -1 when NEW_MOVA has no address. Modified: branches/gcc-4_2-branch/gcc/ChangeLog branches/gcc-4_2-branch/gcc/config/sh/sh.c
Fixed.