Bug 58934 - [4.9 Regression]: build fails on cris-elf in reload_cse_simplify_operands for newlib dtoa.c
Summary: [4.9 Regression]: build fails on cris-elf in reload_cse_simplify_operands for...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: rtl-optimization (show other bugs)
Version: 4.9.0
: P3 normal
Target Milestone: 4.9.0
Assignee: Martin Jambor
URL:
Keywords: build, ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2013-10-31 05:37 UTC by Hans-Peter Nilsson
Modified: 2013-11-25 14:21 UTC (History)
6 users (show)

See Also:
Host: x86_64-unknown-linux-gnu
Target: cris-axis-elf, sparc-sun-solaris2.11 sh*-*-*,arm-none-eabi,arm-none-linux-gnueabihf,powerpc*-*-*
Build:
Known to work:
Known to fail:
Last reconfirmed: 2013-10-31 00:00:00


Attachments
Repeat as ./cc1 -fpreprocessed -O2 -o dtoa.s dtoa.i (8.96 KB, text/plain)
2013-10-31 05:37 UTC, Hans-Peter Nilsson
Details
SH testcase (6.11 KB, text/plain)
2013-10-31 11:53 UTC, chrbr
Details
arm-none-eabi reduced testcase (507 bytes, text/x-csrc)
2013-10-31 13:04 UTC, Ramana Radhakrishnan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hans-Peter Nilsson 2013-10-31 05:37:07 UTC
Created attachment 31115 [details]
Repeat as ./cc1 -fpreprocessed -O2 -o dtoa.s dtoa.i

Revision r204205 caused the build for cris-elf to fail as follows:

/tmp/break20131030_05/gccobj/./gcc/xgcc -B/tmp/break20131030_05/gccobj/./gcc/ -nostdinc -B/tmp/break20131030_05/gccobj/cris-elf/v8/newlib/ -isystem /tmp/break20131030_05/gccobj/cris-elf/v8/newlib/targ-include -isystem /tmp/break20131030_05/gcc/newlib/libc/include -B/tmp/break20131030_05/gccobj/cris-elf/v8/libgloss/cris -L/tmp/break20131030_05/gccobj/cris-elf/v8/libgloss/libnosys -L/tmp/break20131030_05/gcc/libgloss/cris -B/tmp/break20131030_05/pre/cris-elf/bin/ -B/tmp/break20131030_05/pre/cris-elf/lib/ -isystem /tmp/break20131030_05/pre/cris-elf/include -isystem /tmp/break20131030_05/pre/cris-elf/sys-include  -march=v8 -mbest-lib-options -DPACKAGE_NAME=\"newlib\" -DPACKAGE_TARNAME=\"newlib\" -DPACKAGE_VERSION=\"1.20.0\" -DPACKAGE_STRING=\"newlib\ 1.20.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -I. -I/tmp/break20131030_05/gcc/newlib/libc/stdlib -DHAVE_RENAME -D_USE_WRITE -DCOMPACT_CTYPE -fno-builtin      -g -O2  -march=v8 -mbest-lib-options -c -o lib_a-dtoa.o `test -f 'dtoa.c' || echo '/tmp/break20131030_05/gcc/newlib/libc/stdlib/'`dtoa.c
/tmp/break20131030_05/gcc/newlib/libc/stdlib/dtoa.c: In function 'quorem':
/tmp/break20131030_05/gcc/newlib/libc/stdlib/dtoa.c:142:1: error: insn does not satisfy its constraints:
 }
 ^
(insn 289 35 288 3 (set (reg/v/f:SI 171 [orig:132 S ] [132])
        (reg/v/f:SI 11 r11 [orig:132 S ] [132])) 37 {*movsi_internal}
     (nil))
/tmp/break20131030_05/gcc/newlib/libc/stdlib/dtoa.c:142:1: internal compiler error: in reload_cse_simplify_operands, at postreload.c:411
0x8a5018 _fatal_insn(char const*, rtx_def const*, char const*, int, char const*)
	/tmp/break20131030_05/gcc/gcc/rtl-error.c:109
0x8a503f _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
	/tmp/break20131030_05/gcc/gcc/rtl-error.c:120
0x858866 reload_cse_simplify_operands
	/tmp/break20131030_05/gcc/gcc/postreload.c:411
0x858b44 reload_cse_simplify
	/tmp/break20131030_05/gcc/gcc/postreload.c:123
0x858b44 reload_cse_regs_1
	/tmp/break20131030_05/gcc/gcc/postreload.c:220
0x858bd3 reload_cse_regs
	/tmp/break20131030_05/gcc/gcc/postreload.c:68
0x858bd3 rest_of_handle_postreload
	/tmp/break20131030_05/gcc/gcc/postreload.c:2332
0x858bd3 execute
	/tmp/break20131030_05/gcc/gcc/postreload.c:2368
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[8]: *** [lib_a-dtoa.o] Error 1
make[8]: Leaving directory `/tmp/break20131030_05/gccobj/cris-elf/v8/newlib/libc/stdlib'

Author of commit CC:ed.  Preprocessed code attached.
Comment 1 Rainer Orth 2013-10-31 10:51:45 UTC
I'm seeing a similar error in a Solaris 11/SPARC bootstrap:

libtool: compile:  /var/gcc/regression/trunk/11-gcc/build/./gcc/xgcc -B/var/gcc/regression/trunk/11-gcc/build/./gcc/ -B/vol/gcc/sparc-sun-solaris2.11/bin/ -B/vol/gcc/sparc-sun-solaris2.11/lib/ -isystem /vol/gcc/sparc-sun-solaris2.11/include -isystem /vol/gcc/sparc-sun-solaris2.11/sys-include -DHAVE_CONFIG_H -I. -I/vol/gcc/src/hg/trunk/local/libgomp -I/vol/gcc/src/hg/trunk/local/libgomp/config/posix -I/vol/gcc/src/hg/trunk/local/libgomp -Wall -pthread -Werror -g -O2 -pthread -MT env.lo -MD -MP -MF .deps/env.Tpo -c /vol/gcc/src/hg/trunk/local/libgomp/env.c  -fPIC -DPIC -o .libs/env.o
/vol/gcc/src/hg/trunk/local/libgomp/env.c: In function 'parse_one_place':
/vol/gcc/src/hg/trunk/local/libgomp/env.c:548:1: error: insn does not satisfy its constraints:
 }
 ^
(insn 1271 176 1270 17 (set (reg/v/f:SI 757 [orig:406 stridep ] [406])
        (reg/v/f:SI 27 %i3 [orig:406 stridep ] [406])) 63 {*movsi_insn}
     (nil))
/vol/gcc/src/hg/trunk/local/libgomp/env.c:548:1: internal compiler error: in reload_cse_simplify_operands, at postreload.c:411
0xa0642f _fatal_insn(char const*, rtx_def const*, char const*, int, char const*)
        /vol/gcc/src/hg/trunk/local/gcc/rtl-error.c:109
0xa0649b _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
        /vol/gcc/src/hg/trunk/local/gcc/rtl-error.c:120
0x95d1f7 reload_cse_simplify_operands
        /vol/gcc/src/hg/trunk/local/gcc/postreload.c:411
0x95c32b reload_cse_simplify
        /vol/gcc/src/hg/trunk/local/gcc/postreload.c:123
0x95c857 reload_cse_regs_1
        /vol/gcc/src/hg/trunk/local/gcc/postreload.c:220
0x95c047 reload_cse_regs
        /vol/gcc/src/hg/trunk/local/gcc/postreload.c:68
0x9646eb rest_of_handle_postreload
        /vol/gcc/src/hg/trunk/local/gcc/postreload.c:2332
0x9647d7 execute
        /vol/gcc/src/hg/trunk/local/gcc/postreload.c:2368

  Rainer
Comment 2 Oleg Endo 2013-10-31 11:31:17 UTC
Let me join the club with an SH failure when building libsupc++:

/gcc-trunk2/libstdc++-v3/libsupc++/vmi_class_type_info.cc:68:1: error: insn does not satisfy its constraints:
 }
 ^
(insn 174 173 175 21 (set (reg:SI 7 r7)
        (reg/v/f:SI 260 [orig:223 src_type ] [223])) ../../../../../gcc-trunk2/libstdc++-v3/libsupc++/vmi_class_type_info.cc:58 256 {movsi_i}
     (nil))
../../../../../gcc-trunk2/libstdc++-v3/libsupc++/vmi_class_type_info.cc:68:1: internal compiler error: in reload_cse_simplify_operands, at postreload.c:411
0x879ab97 _fatal_insn(char const*, rtx_def const*, char const*, int, char const*)
	../../gcc-trunk2/gcc/rtl-error.c:109
0x879abd5 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
	../../gcc-trunk2/gcc/rtl-error.c:120
0x8747aba reload_cse_simplify_operands
	../../gcc-trunk2/gcc/postreload.c:411
0x874830a reload_cse_simplify
	../../gcc-trunk2/gcc/postreload.c:123
0x874830a reload_cse_regs_1
	../../gcc-trunk2/gcc/postreload.c:220
0x8749ac2 reload_cse_regs
	../../gcc-trunk2/gcc/postreload.c:68
0x8749ac2 rest_of_handle_postreload
	../../gcc-trunk2/gcc/postreload.c:2332
0x8749ac2 execute
	../../gcc-trunk2/gcc/postreload.c:2368
Please submit a full bug report,
Comment 3 Ramana Radhakrishnan 2013-10-31 11:36:05 UTC
And arm-none-eabi builds in newlib. Let's join the party.

./cc1 -O2 -mthumb -O2 -g -fno-builtin -fshort-enums -S -mcpu=cortex-a9 -mfpu=neon -mfloat-abi=softfp reduced.c 



#>$GCCDIR/configure --target=arm-none-eabi --with-languages=c

Breaks glibc builds for arm-none-linux-gnueabihf
Comment 4 chrbr 2013-10-31 11:53:12 UTC
Created attachment 31119 [details]
SH testcase

yep, Also fails to build the sh-none-elf newlib. Attached case to reproduce

cc1 -O2  fgets.i  -quiet -fno-builtin
fgets.i: In function '_fgets_r':
fgets.i:826:1: error: insn does not satisfy its constraints:
 }
 ^
(insn 162 163 161 4 (set (reg/v/f:SI 215 [orig:192 buf ] [192])
        (reg/v/f:SI 5 r5 [orig:192 buf ] [192])) 256 {movsi_i}
     (nil))
fgets.i:826:1: internal compiler error: in reload_cse_simplify_operands, at postreload.c:411
Comment 5 Martin Jambor 2013-10-31 12:08:57 UTC
I'll revert the patch momentarily. Sorry for the trouble and thanks for any testcases.
Comment 6 Ramana Radhakrishnan 2013-10-31 13:04:23 UTC
Created attachment 31121 [details]
arm-none-eabi reduced testcase

./cc1 -O2 -g -mthumb -mcpu=cortex-a9 -mfpu=neon -mfloat-abi=softfp reduced.c
Comment 7 Martin Jambor 2013-10-31 13:39:30 UTC
Author: jamborm
Date: Thu Oct 31 13:39:26 2013
New Revision: 204254

URL: http://gcc.gnu.org/viewcvs?rev=204254&root=gcc&view=rev
Log:
2013-10-31  Martin Jambor  <mjambor@suse.cz>

	PR rtl-optimization/58934
	Revert:
	2013-10-30  Martin Jambor  <mjambor@suse.cz>
	PR rtl-optimization/10474
	* ira.c (find_moveable_pseudos): Do not calculate dominance info
	nor df analysis.
	(interesting_dest_for_shprep): New function.
	(split_live_ranges_for_shrink_wrap): Likewise.
	(ira): Calculate dominance info and df analysis. Call
	split_live_ranges_for_shrink_wrap.

testsuite/
	* gcc.dg/pr10474.c: New testcase.
	* gcc.dg/ira-shrinkwrap-prep-1.c: Likewise.
	* gcc.dg/ira-shrinkwrap-prep-2.c: Likewise.


Removed:
    trunk/gcc/testsuite/gcc.dg/ira-shrinkwrap-prep-1.c
    trunk/gcc/testsuite/gcc.dg/ira-shrinkwrap-prep-2.c
    trunk/gcc/testsuite/gcc.dg/pr10474.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/ira.c
    trunk/gcc/testsuite/ChangeLog
Comment 8 David Edelsohn 2013-10-31 13:53:53 UTC
It also had broken PowerPC.
Comment 9 Hans-Peter Nilsson 2013-11-01 02:31:03 UTC
Fixed as far as I'm concerned.
Martin, you're assigned so I'll let you close it if you please.
Comment 10 Richard Biener 2013-11-04 14:15:22 UTC
Fixed.
Comment 11 Martin Jambor 2013-11-08 12:39:31 UTC
I have re-submitted my patch in which this bug is fixed, you can find
it at http://gcc.gnu.org/ml/gcc-patches/2013-11/msg00598.html

I have verified the patch bootstraps on i686-linux (reported by Jakub
in the mailing list), ppc64-linux (some problem reported by David in
comment #8) and ia64-linux (no problem reported but anyway), however I
could not try the same on Sparc or Solaris (even though failure was
reported by Rainer in comment #1) because I do not have access to
either of them (oh how I wish that sparcs on the compile farm came
back).

Similarly, I have verified that the original reported failure on
cris-elf cross-compiler goes away, as does the problem on sh-none-elf
cross (the one from comment #4).  However, even without the fix I was
not able to reproduce the failure on arm reported in comment #6.

If anyone is willing to test the patch on any platform but especially
on those which I could not, I'd be very grateful.  Thanks.
Comment 12 ro@CeBiTec.Uni-Bielefeld.DE 2013-11-12 13:37:58 UTC
> --- Comment #11 from Martin Jambor <jamborm at gcc dot gnu.org> ---
[...]
> If anyone is willing to test the patch on any platform but especially
> on those which I could not, I'd be very grateful.  Thanks.

I've now regression-tested the patch on sparc-sun-solaris2.11.
Bootstrap works and I find just a single regression:

FAIL: gfortran.fortran-torture/execute/pr32604.f90 execution,  -O2 -fbounds-check 

which is reproducible.

	Rainer
Comment 13 Martin Jambor 2013-11-13 13:45:44 UTC
(In reply to ro@CeBiTec.Uni-Bielefeld.DE from comment #12)
> > --- Comment #11 from Martin Jambor <jamborm at gcc dot gnu.org> ---
> [...]
> > If anyone is willing to test the patch on any platform but especially
> > on those which I could not, I'd be very grateful.  Thanks.
> 
> I've now regression-tested the patch on sparc-sun-solaris2.11.
> Bootstrap works and I find just a single regression:
> 
> FAIL: gfortran.fortran-torture/execute/pr32604.f90 execution,  -O2
> -fbounds-check 
> 
> which is reproducible.
> 
> 	Rainer

Thanks a lot.  I committed the patch a few moments before reading your
comment so I suppose trunk now suffers from this failure.  If so, can
you please open a bug report?

I tried to reproduce it on gcc54 on the compile farm (sparc64-linux)
but so far I have failed to even build the gcc itself there :-/
Comment 14 Martin Jambor 2013-11-25 13:57:59 UTC
(In reply to ro@CeBiTec.Uni-Bielefeld.DE from comment #12)
> FAIL: gfortran.fortran-torture/execute/pr32604.f90 execution,  -O2
> -fbounds-check 
> 

I did not find this failure in your latest test results
(http://gcc.gnu.org/ml/gcc-testresults/2013-11/msg01857.html) and so I
assume it has been also fixed by any of the subsequent patches
addressing other issues.
Comment 15 ro@CeBiTec.Uni-Bielefeld.DE 2013-11-25 14:21:37 UTC
> --- Comment #14 from Martin Jambor <jamborm at gcc dot gnu.org> ---
> (In reply to ro@CeBiTec.Uni-Bielefeld.DE from comment #12)
>> FAIL: gfortran.fortran-torture/execute/pr32604.f90 execution,  -O2
>> -fbounds-check 
>> 
>
> I did not find this failure in your latest test results
> (http://gcc.gnu.org/ml/gcc-testresults/2013-11/msg01857.html) and so I
> assume it has been also fixed by any of the subsequent patches
> addressing other issues.

Right, it's gone in this weekend's bootstraps.

	Rainer