Bug 69012 - gcc-6.0.0 internal compiler error building libgfortran for mips64el target
Summary: gcc-6.0.0 internal compiler error building libgfortran for mips64el target
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 6.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: build, ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2015-12-22 12:13 UTC by Paul Hua
Modified: 2016-08-06 05:24 UTC (History)
1 user (show)

See Also:
Host:
Target: mips64el-*-linux
Build:
Known to work: 4.9.3, 5.3.0
Known to fail:
Last reconfirmed: 2015-12-25 00:00:00


Attachments
preprocessed source for maxval_r4.c (18.35 KB, text/plain)
2015-12-23 10:10 UTC, Paul Hua
Details
building command (2.27 KB, text/plain)
2015-12-23 10:12 UTC, Paul Hua
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Hua 2015-12-22 12:13:13 UTC
I compiled the gcc version trunk@231140  under platform mips64el. The flowning error occurred.

../../../../gcc-653b0b0/libgfortran/generated/maxval_r4.c: In function ‘maxval_r4’:
../../../../gcc-653b0b0/libgfortran/generated/maxval_r4.c:200:1: error: unrecognizable insn:
 }
 ^

(insn 706 705 708 2 (parallel [
            (set (mem/c:SI (plus:SI (reg/f:SI 29 $sp)
                        (const_int 16 [0x10])) [11  S4 A32])
                (unspec:SI [
                        (const_int 16 [0x10])
                        (reg:SI 28 $28)
                    ] UNSPEC_POTENTIAL_CPRESTORE))
            (clobber (scratch:SI))   
        ]) ../../../../gcc-653b0b0/libgfortran/generated/maxval_r4.c:42 -1
     (expr_list:REG_DEAD (reg:SI 28 $28)
        (nil)))
../../../../gcc-653b0b0/libgfortran/generated/maxval_r4.c:200:1: internal compiler error: in get_attr_got, at config/mips/mips.md:694
0x1205cf5bf _fatal_insn(char const*, rtx_def const*, char const*, int, char const*)
        ../../gcc-653b0b0/gcc/rtl-error.c:108
0x1205cf61f _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
        ../../gcc-653b0b0/gcc/rtl-error.c:116
0x1209f062b get_attr_got(rtx_insn*)
        ../../gcc-653b0b0/gcc/config/mips/mips.md:694
0x120925bbf mips_insn_has_flexible_gp_ref_p
        ../../gcc-653b0b0/gcc/config/mips/mips.c:9927
0x120913813 mips_find_gp_ref
        ../../gcc-653b0b0/gcc/config/mips/mips.c:9858
0x120923c5f mips_global_pointer
        ../../gcc-653b0b0/gcc/config/mips/mips.c:9979
0x120923c5f mips_compute_frame_info  
        ../../gcc-653b0b0/gcc/config/mips/mips.c:10350
0x1209322c7 mips_initial_elimination_offset(int, int)
        ../../gcc-653b0b0/gcc/config/mips/mips.c:10591
0x1205d156b get_initial_register_offset
        ../../gcc-653b0b0/gcc/rtlanal.c:383
0x1205d1a2b rtx_addr_can_trap_p_1
        ../../gcc-653b0b0/gcc/rtlanal.c:618
0x1205d18bb rtx_addr_can_trap_p_1
        ../../gcc-653b0b0/gcc/rtlanal.c:679
0x1205d72cf may_trap_p_1(rtx_def const*, unsigned int)
        ../../gcc-653b0b0/gcc/rtlanal.c:2819
0x1202a1c47 can_move_insns_across(rtx_insn*, rtx_insn*, rtx_insn*, rtx_insn*, basic_block_def*, bitmap_head*, bitmap_head*, rtx_insn**)
        ../../gcc-653b0b0/gcc/df-problems.c:4156
0x120b25bab dead_or_predicable
        ../../gcc-653b0b0/gcc/ifcvt.c:5099
0x120b2aca7 find_if_case_1
        ../../gcc-653b0b0/gcc/ifcvt.c:4791
0x120b2aca7 find_if_header
        ../../gcc-653b0b0/gcc/ifcvt.c:4194
0x120b2aca7 if_convert
        ../../gcc-653b0b0/gcc/ifcvt.c:5325
0x120b2bcbf execute
        ../../gcc-653b0b0/gcc/ifcvt.c:5515
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://bugs.loongnix.org/> for instructions.

The trunk@231896 occurred as same.

The cmd are :
/home/xuchenghua/GCC/gcc_git_trunk_231896_obj/./gcc/xgcc -B/home/xuchenghua/GCC/gcc_git_trunk_231896_obj/./gcc/ -B/home/xuchenghua/toolchain/gcc-trunk-231896/mips6
4el-redhat-linux/bin/ -B/home/xuchenghua/toolchain/gcc-trunk-231896/mips64el-redhat-linux/lib/ -isystem /home/xuchenghua/toolchain/gcc-trunk-231896/mips64el-redhat-linux/include -isystem /home/xuc
henghua/toolchain/gcc-trunk-231896/mips64el-redhat-linux/sys-include -mabi=32 -DHAVE_CONFIG_H -I. -I../../../../gcc_git_trunk/libgfortran -iquote../../../../gcc_git_trunk/libgfortran/io -I../../..
/../gcc_git_trunk/libgfortran/../gcc -I../../../../gcc_git_trunk/libgfortran/../gcc/config -I../../.././gcc -I../../../../gcc_git_trunk/libgfortran/../libgcc -I../../libgcc -I../../../../gcc_git_t
runk/libgfortran/../libbacktrace -I../../libbacktrace -I../libbacktrace -std=gnu11 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wextra -Wwrite-strings -Werror=implicit-fu
nction-declaration -Werror=vla -fcx-fortran-rules -ffunction-sections -fdata-sections -std=gnu11 -g -O2 -minterlink-mips16 -Wunknown-pragmas -MT maxval_r4.lo -MD -MP -MF .deps/maxval_r4.Tpo -c ../
../../../gcc_git_trunk/libgfortran/generated/maxval_r4.c -o maxval_r4.o

Configured with:
  $ ../gcc_git_trunk/configure --prefix=/home/xuchenghua/toolchain/gcc-trunk-231896 --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib--with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --enable-languages=c,c++,objc,obj-c++,fortran,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-arch=mips64r2 --with-abi=64 --with-multilib-list=32,n32,64 --enable-gnu-indirect-function --with-long-double-128 --build=mips64el-redhat-linux --with-pkgversion=gcc 20151222 commit: gcc-trunk-231896
Comment 1 Paul Hua 2015-12-23 03:11:10 UTC
The cross compile also crashed ...

/home/xuchenghua/GCC/mips/gcc-trunk-231896-o32_obj/./gcc/xgcc -B/home/xuchenghua/GCC/mips/gcc-trunk-231896-o32_obj/./gcc/ -B/home/xuchenghua/toolchain/cross-tool
s/gcc-o32/usr/mipsel-redhat-linux/bin/ -B/home/xuchenghua/toolchain/cross-tools/gcc-o32/usr/mipsel-redhat-linux/lib/ -isystem /home/xuchenghua/toolchain/cross-tools/gcc-o32/usr/mipsel-redhat-linux
/include -isystem /home/xuchenghua/toolchain/cross-tools/gcc-o32/usr/mipsel-redhat-linux/sys-include -DHAVE_CONFIG_H -I. -I../../../../gcc_git_trunk/libgfortran -iquote../../../../gcc_git_trunk/li
bgfortran/io -I../../../../gcc_git_trunk/libgfortran/../gcc -I../../../../gcc_git_trunk/libgfortran/../gcc/config -I../.././gcc -I../../../../gcc_git_trunk/libgfortran/../libgcc -I../libgcc -I../.
./../../gcc_git_trunk/libgfortran/../libbacktrace -I../libbacktrace -I../libbacktrace -std=gnu11 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wextra -Wwrite-strings -Werr
or=implicit-function-declaration -Werror=vla -fcx-fortran-rules -ffunction-sections -fdata-sections -std=gnu11 -g -O2 -minterlink-mips16 -Wunknown-pragmas -MT maxval_r4.lo -MD -MP -MF .deps/maxval
_r4.Tpo -c ../../../../gcc_git_trunk/libgfortran/generated/maxval_r4.c -o maxval_r4.o
../../../../gcc_git_trunk/libgfortran/generated/maxval_r4.c: In function 'maxval_r4':
../../../../gcc_git_trunk/libgfortran/generated/maxval_r4.c:200:1: error: unrecognizable insn:
 }
 ^

(insn 688 687 690 2 (parallel [
            (set (mem/c:SI (plus:SI (reg/f:SI 29 $sp)
                        (const_int 16 [0x10])) [11  S4 A32])
                (unspec:SI [
                        (const_int 16 [0x10])
                        (reg:SI 28 $28)
                    ] UNSPEC_POTENTIAL_CPRESTORE))
            (clobber (scratch:SI))
        ]) ../../../../gcc_git_trunk/libgfortran/generated/maxval_r4.c:42 -1
     (expr_list:REG_DEAD (reg:SI 28 $28)
        (nil)))
../../../../gcc_git_trunk/libgfortran/generated/maxval_r4.c:200:1: internal compiler error: in get_attr_got, at config/mips/mips.md:694

Host:x86_64-redhat-linux
Target:mipsel-redhat-linux

The cross compile configured with:
  $ ../../gcc_git_trunk/configure --prefix=/home/xuchenghua/toolchain/cross-tools/gcc-o32/usr --with-sysroot=/home/xuchenghua/toolchain/cross-tools/gcc-o32/usr/mipsel-redhat-linux/sysroot --target=mipsel-redhat-linux --with-arch=mips64r2 --with-abi=32 --with-gmp=/home/xuchenghua/toolchain/cross-tools/gcc-o32/usr/ --with-mpfr=/home/xuchenghua/toolchain/cross-tools/gcc-o32/usr/ --with-mpc=/home/xuchenghua/toolchain/cross-tools/gcc-o32/usr/ --enable-threads=posix --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --disable-dssi --disable-multilib --enable-languages=c,c++,objc,obj-c++,fortran,go,lto --enable-shared --with-build-time-tools=/home/xuchenghua/toolchain/cross-tools/gcc-o32/usr/mipsel-redhat-linux/bin --with-pkgversion=gcc 20151222 commit: gcc-trunk-231896 

This may be help to reproduced。
Comment 2 Paul Hua 2015-12-23 08:41:31 UTC
The "internal compiler error" appeared after trunk revision 225260, and the revision 225249 can be successfully compiled.

The r225260 show:

commit 32e90dc6a0cda452b426b370326e315ac6f10f02
Author: edlinger <edlinger@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Wed Jul 1 16:10:30 2015 +0000

    gcc/ChangeLog:
    2015-07-01  Bernd Edlinger  <bernd.edlinger@hotmail.de>

            PR rtl-optimization/61047
            * rtlanal.c (get_initial_register_offset): New function.
            (rtx_addr_can_trap_p_1): Check offsets of stack references.

    testsuite/ChangeLog:
    2015-07-01  Bernd Edlinger  <bernd.edlinger@hotmail.de>

            PR rtl-optimization/61047
            * gcc.c-torture/execute/20150611-1.c: New testcase.


    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@225260 138bc75d-0d04-0410-961f-82ee72b054a4

any one can fixing this ?
Comment 3 Bernd Edlinger 2015-12-23 09:45:07 UTC
I will have a look, but please,
can you attach a preprocessed source for maxval_r4.c


Thanks.
Comment 4 Paul Hua 2015-12-23 10:10:32 UTC
Created attachment 37114 [details]
preprocessed source for maxval_r4.c

The compile command line :

cc1 -fpreprocessed maxval_r4.i -mel -quiet -dumpbase maxval_r4.c -mabi=32 -minterlink-mips16 -march=mips64r2 -mllsc -mips64r2 -mno-shared -auxbase-strip maxval_r4.o -g -O2 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wextra -Wwrite-strings -Werror=implicit-function-declaration -Werror=vla -Wunknown-pragmas -std=gnu11 -std=gnu11 -version -fcx-fortran-rules -ffunction-sections -fdata-sections -o maxval_r4.s

Thanks.
Comment 5 Paul Hua 2015-12-23 10:12:15 UTC
Created attachment 37115 [details]
building command
Comment 6 Bernd Edlinger 2015-12-23 12:52:11 UTC
(In reply to Paul Hua from comment #5)
> Created attachment 37115 [details]
> building command

I'm unable to reproduce.
What is your cross-compiler command line?
Comment 7 Bernd Edlinger 2015-12-23 13:01:09 UTC
FYI, I used:
../gcc-trunk/configure --prefix=/home/ed/gnu/mips64el-unknown-linux --target=mips64el-unknown-linux --enable-languages=c --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --enable-plugin --enable-initfini-array --with-arch=mips64r2 --with-abi=64 --enable-gnu-indirect-function --with-long-double-128 --enable-shared --enable-threads=posix --disable-libgcc --disable-libssp --disable-libgomp --disable-libquadmath --disable-libatomic
Comment 8 Paul Hua 2015-12-24 01:42:35 UTC
(In reply to Bernd Edlinger from comment #6)
> (In reply to Paul Hua from comment #5)
> > Created attachment 37115 [details]
> > building command
> 
> I'm unable to reproduce.
> What is your cross-compiler command line?

The command line have been submitted on comment #4:

$where_build_obj/gcc/cc1 -fpreprocessed maxval_r4.i -mel -quiet -dumpbase maxval_r4.c -mabi=32 -minterlink-mips16 -march=mips64r2 -mllsc -mips64r2 -mno-shared -auxbase-strip maxval_r4.o -g -O2 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wextra -Wwrite-strings -Werror=implicit-function-declaration -Werror=vla -Wunknown-pragmas -std=gnu11 -std=gnu11 -version -fcx-fortran-rules -ffunction-sections -fdata-sections -o maxval_r4.s
Comment 9 Bernd Edlinger 2015-12-24 06:18:40 UTC
(In reply to Paul Hua from comment #8)
> (In reply to Bernd Edlinger from comment #6)
> > (In reply to Paul Hua from comment #5)
> > > Created attachment 37115 [details]
> > > building command
> > 
> > I'm unable to reproduce.
> > What is your cross-compiler command line?
> 


and how exactly did you configure your cross compiler?
Comment 10 Paul Hua 2015-12-24 12:58:23 UTC
(In reply to Bernd Edlinger from comment #9)
> (In reply to Paul Hua from comment #8)
> > (In reply to Bernd Edlinger from comment #6)
> > > (In reply to Paul Hua from comment #5)
> > > > Created attachment 37115 [details]
> > > > building command
> > > 
> > > I'm unable to reproduce.
> > > What is your cross-compiler command line?
> > 
> 
> 
> and how exactly did you configure your cross compiler?

I'm compared the diff between your configure and mine, find something that my configure specify the --with-build-time-tools=xxx. If don't specify the --with-build-time-tools=xxx the gcc(both r225249 and r225260) can be build successfully. This is the reason why you can't reproduce.

But, when specify the --with-build-time-tools=xxx the gcc r225249 can be build successfully. The gcc r225260 failed, the error is same as above. 

The --with-build-time-tools=xxx is the binutils installed dir.

binutils cross-compiler configure with:

../../binutils-gdb_git_trunk/configure --prefix=/home/xuchenghua/toolchain/cross-compiler/gcc-6.0.0 --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=mipsel-redhat-linux-gnu

gcc cross-compiler configure with:

../../gcc_git_trunk/configure --prefix=/home/xuchenghua/gcc-trunk --target=mipsel-redhat-linux --with-arch=mips64r2 --with-abi=32 --enable-threads=posix --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --disable-dssi --disable-multilib --enable-languages=c --enable-shared --with-build-time-tools=/home/xuchenghua/toolchain/cross-compiler/gcc-6.0.0/mipsel-redhat-linux-gnu/bin/

I'm sorry for wasted your time.

thanks.
Comment 11 Bernd Edlinger 2015-12-24 16:47:45 UTC
ok, now I see.  try this:

Index: gcc/config/mips/mips.c
===================================================================
--- gcc/config/mips/mips.c	(revision 231927)
+++ gcc/config/mips/mips.c	(working copy)
@@ -10347,8 +10347,6 @@ mips_compute_frame_info (void)
   memset (frame, 0, sizeof (*frame));
   size = get_frame_size ();
 
-  cfun->machine->global_pointer = mips_global_pointer ();
-
   /* The first two blocks contain the outgoing argument area and the $gp save
      slot.  This area isn't needed in leaf functions.  We can also skip it
      if we know that none of the called functions will use this space.
@@ -10377,6 +10375,17 @@ mips_compute_frame_info (void)
     }
   offset = frame->args_size + frame->cprestore_size;
 
+  /* MIPS16 code offsets the frame pointer by the size of the outgoing
+     arguments.  This tends to increase the chances of using unextended
+     instructions for local variables and incoming arguments.  */
+  if (TARGET_MIPS16)
+    frame->hard_frame_pointer_offset = frame->args_size;
+
+  /* The function mips_global_pointer walks all insns and some depend
+     on the predicate function mips_cprestore_address_p, which uses
+     frame->args_size and frame->hard_frame_pointer_offset.  */
+  cfun->machine->global_pointer = mips_global_pointer ();
+
   /* Move above the local variables.  */
   frame->var_size = MIPS_STACK_ALIGN (size);
   offset += frame->var_size;
@@ -10520,12 +10529,6 @@ mips_compute_frame_info (void)
     frame->acc_save_offset = frame->acc_sp_offset - offset;
   if (frame->num_cop0_regs > 0)
     frame->cop0_save_offset = frame->cop0_sp_offset - offset;
-
-  /* MIPS16 code offsets the frame pointer by the size of the outgoing
-     arguments.  This tends to increase the chances of using unextended
-     instructions for local variables and incoming arguments.  */
-  if (TARGET_MIPS16)
-    frame->hard_frame_pointer_offset = frame->args_size;
 }
 
 /* Return the style of GP load sequence that is being used for the
Comment 12 Bernd Edlinger 2015-12-25 11:12:17 UTC
confirmed, I encountered it too when compiling a cross-glibc

gcc-config:
../gcc-trunk/configure --prefix=/home/ed/gnu/mips-linux-gnu --target=mips-linux-gnu --enable-languages=c --disable-shared --disable-threads --disable-libssp --disable-libgomp --disable-libquadmath --disable-libatomic

glibc-config:
../glibc-2.22/configure --prefix=/home/ed/gnu/mips-linux-gnu/mips-linux-gnu --build=mips-linux-gnu --disable-werror CC=mips-linux-gnu-gcc

mips-linux-gnu-gcc -mabi=32 ../sysdeps/ieee754/dbl-64/e_remainder.c -c -std=gnu99 -fgnu89-inline  -O2 -Wall -Wundef -Wwrite-strings -fmerge-all-constants -frounding-math -g -Wstrict-prototypes       -Wno-uninitialized    -D__NO_MATH_INLINES -D__LIBC_INTERNAL_MATH_INLINES -DNO_LONG_DOUBLE -D_Mlong_double_=double -I../include -I/home/ed/gnu/glibc-build-mips/math  -I/home/ed/gnu/glibc-build-mips  -I../sysdeps/unix/sysv/linux/mips/mips32/fpu  -I../sysdeps/unix/sysv/linux/mips/mips32  -I../sysdeps/unix/sysv/linux/mips  -I../sysdeps/mips/nptl  -I../sysdeps/unix/sysv/linux/include -I../sysdeps/unix/sysv/linux  -I../sysdeps/nptl  -I../sysdeps/pthread  -I../sysdeps/gnu  -I../sysdeps/unix/inet  -I../sysdeps/unix/sysv  -I../sysdeps/unix/mips/mips32  -I../sysdeps/unix/mips  -I../sysdeps/unix  -I../sysdeps/posix  -I../sysdeps/mips/mips32/fpu  -I../sysdeps/mips/mips32  -I../sysdeps/mips/ieee754  -I../sysdeps/mips/include -I../sysdeps/mips  -I../sysdeps/ieee754/flt-32  -I../sysdeps/ieee754/dbl-64  -I../sysdeps/wordsize-32  -I../sysdeps/mips/fpu  -I../sysdeps/ieee754  -I../sysdeps/generic  -I.. -I../libio -I.   -D_LIBC_REENTRANT -include /home/ed/gnu/glibc-build-mips/libc-modules.h -DMODULE_NAME=libm -include ../include/libc-symbols.h  -DPIC     -o /home/ed/gnu/glibc-build-mips/math/e_remainder.o -MD -MP -MF /home/ed/gnu/glibc-build-mips/math/e_remainder.o.dt -MT /home/ed/gnu/glibc-build-mips/math/e_remainder.o
../sysdeps/ieee754/dbl-64/e_remainder.c: In function '__ieee754_remainder':
../sysdeps/ieee754/dbl-64/e_remainder.c:149:1: error: unrecognizable insn:
 }
 ^

(insn 911 910 912 2 (parallel [
            (set (mem/c:SI (plus:SI (reg/f:SI 29 $sp)
                        (const_int 16 [0x10])) [8  S4 A32])
                (unspec:SI [
                        (const_int 16 [0x10])
                        (reg:SI 28 $28)
                    ] UNSPEC_POTENTIAL_CPRESTORE))
            (clobber (scratch:SI))
        ]) ../sysdeps/ieee754/dbl-64/e_remainder.c:45 -1
     (expr_list:REG_DEAD (reg:SI 28 $28)
        (nil)))
../sysdeps/ieee754/dbl-64/e_remainder.c:149:1: internal compiler error: in get_attr_got, at config/mips/mips.md:694
0xa4c2aa _fatal_insn(char const*, rtx_def const*, char const*, int, char const*)
	../../gcc-trunk/gcc/rtl-error.c:108
0xa4c2d9 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
	../../gcc-trunk/gcc/rtl-error.c:116
0xea6616 get_attr_got(rtx_insn*)
	../../gcc-trunk/gcc/config/mips/mips.md:694
0xdc4128 mips_insn_has_flexible_gp_ref_p
	../../gcc-trunk/gcc/config/mips/mips.c:9927
0xdc11fe mips_find_gp_ref
	../../gcc-trunk/gcc/config/mips/mips.c:9858
0xdc1ee7 mips_global_pointer
	../../gcc-trunk/gcc/config/mips/mips.c:9979
0xdc1ee7 mips_compute_frame_info
	../../gcc-trunk/gcc/config/mips/mips.c:10350
0xdce2ce mips_initial_elimination_offset(int, int)
	../../gcc-trunk/gcc/config/mips/mips.c:10591
0xa4dbd2 rtx_addr_can_trap_p_1
	../../gcc-trunk/gcc/rtlanal.c:618
0xa4da67 rtx_addr_can_trap_p_1
	../../gcc-trunk/gcc/rtlanal.c:679
0xa51737 may_trap_p_1(rtx_def const*, unsigned int)
	../../gcc-trunk/gcc/rtlanal.c:2819
0x723b28 can_move_insns_across(rtx_insn*, rtx_insn*, rtx_insn*, rtx_insn*, basic_block_def*, bitmap_head*, bitmap_head*, rtx_insn**)
	../../gcc-trunk/gcc/df-problems.c:4156
0xf342c8 try_head_merge_bb
	../../gcc-trunk/gcc/cfgcleanup.c:2502
0xf342c8 try_optimize_cfg
	../../gcc-trunk/gcc/cfgcleanup.c:2832
0xf342c8 cleanup_cfg(int)
	../../gcc-trunk/gcc/cfgcleanup.c:3028
0xf349a6 execute
	../../gcc-trunk/gcc/cfgcleanup.c:3157
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
make[2]: *** [/home/ed/gnu/glibc-build-mips/math/e_remainder.o] Error 1
make[2]: Leaving directory `/home/ed/gnu/glibc-2.22/math'
make[1]: *** [math/others] Error 2
make[1]: Leaving directory `/home/ed/gnu/glibc-2.22'
make: *** [all] Error 2

this is also fixed by patch in comment#11
Comment 13 Bernd Edlinger 2016-01-05 10:45:48 UTC
(In reply to Bernd Edlinger from comment #12)
> 
> glibc-config:
> ../glibc-2.22/configure --prefix=/home/ed/gnu/mips-linux-gnu/mips-linux-gnu
> --build=mips-linux-gnu --disable-werror CC=mips-linux-gnu-gcc
> 

correction, the glibc-config was actually wrong:

../glibc-2.22/configure --prefix=/home/ed/gnu/mips-linux-gnu/mips-linux-gnu --host=mips-linux-gnu --disable-werror

then I can build a full cross gcc:

../gcc-trunk/configure --prefix=/home/ed/gnu/mips-linux-gnu --target=mips-linux-gnu --enable-languages=c,c++,fortran,ada

and then finally canadian cross:

../gcc-trunk/configure --prefix=/home/ed/gnu/mips-linux-gnu --target=mips-linux-gnu --enable-languages=c,c++,fortran,ada --host=mips-linux-gnu

(which fails currently in an in-tree mpfr issue: pr69134
Comment 14 Nick Clifton 2016-01-21 14:07:33 UTC
Author: nickc
Date: Thu Jan 21 14:07:01 2016
New Revision: 232674

URL: https://gcc.gnu.org/viewcvs?rev=232674&root=gcc&view=rev
Log:
	PR target/69129
	PR target/69012
	* config/mips/mips.c (mips_compute_frame_info): Initialise
	args_size and hard_frame_pointer_offset fields of the frame
	structure before calling mips_global_pointer.

	PR target/69129
	* gcc.target/mips/pr69129.c: New.

Added:
    trunk/gcc/testsuite/gcc.target/mips/pr69129.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/mips/mips.c
    trunk/gcc/testsuite/ChangeLog
Comment 15 Nick Clifton 2016-01-21 14:10:08 UTC
Hi Guys,

  I have checked in Bernd's patch as it also fixes PR 69129.  I think that this PR can also be closed now, although I am not sure if we need to add another testcase to gcc.target/mips.  (I added a testcase for pr69129...)

Cheers
  Nick
Comment 16 Bernd Edlinger 2016-01-21 18:31:58 UTC
(In reply to Nick Clifton from comment #15)
> Hi Guys,
> 
>   I have checked in Bernd's patch as it also fixes PR 69129.  I think that
> this PR can also be closed now, although I am not sure if we need to add
> another testcase to gcc.target/mips.  (I added a testcase for pr69129...)
> 
> Cheers
>   Nick

Very nice test case.  Thanks!

I am still unsure, if we shouldn't also do something like this,
to prevent any remaining possibility for a further regression:

Index: gcc/config/mips/mips.c
===================================================================
--- gcc/config/mips/mips.c      (revision 231954)
+++ gcc/config/mips/mips.c      (working copy)
@@ -10321,6 +10321,10 @@ mips_compute_frame_info (void)
   HOST_WIDE_INT offset, size;
   unsigned int regno, i;

+  /* Don't change the frame info after reload completed.  */
+  if (reload_completed)
+    return;
+
   /* Set this function's interrupt properties.  */
   if (mips_interrupt_type_p (TREE_TYPE (current_function_decl)))
     {

(I proposed that, but Richard S. raised objections against it)
Comment 17 Bernd Edlinger 2016-01-22 09:48:42 UTC
I'd declare it fixed with Nick's check-in from yesterday.

Thanks for reporting.
Comment 18 Nick Clifton 2016-01-22 11:49:08 UTC
Hi Bernd,

> I am still unsure, if we shouldn't also do something like this,
> to prevent any remaining possibility for a further regression:

> +  /* Don't change the frame info after reload completed.  */
> +  if (reload_completed)
> +    return;

Actually that might not be a bad idea.  Or maybe, to be even more paranoid, we should check that a post-reload frame computation matches the last pre-reload frame computation.  Hmm, maybe that is going to far.

Anyway I like your patch idea, but I cannot approve it.  Maybe the MIPS maintainers will like it...

Cheers
   Nick