Bug 61737 - ICE when building libgcc for cris cross-compiler
Summary: ICE when building libgcc for cris cross-compiler
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.9.0
: P3 normal
Target Milestone: 4.9.2
Assignee: Hans-Peter Nilsson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-07 14:45 UTC by dhowells@redhat.com
Modified: 2014-07-18 16:04 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2014-07-15 00:00:00


Attachments
Reduced preprocessed source that induces the error message (178 bytes, text/plain)
2014-07-07 14:45 UTC, dhowells@redhat.com
Details
Patch to config.gcc (306 bytes, patch)
2014-07-15 00:43 UTC, Hans-Peter Nilsson
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description dhowells@redhat.com 2014-07-07 14:45:29 UTC
Created attachment 33082 [details]
Reduced preprocessed source that induces the error message

When trying to build a cross-compiler for cris with libgcc, I get the following error and several others like it (make -j is in operation) during the compiler build:

/data/fedora/cross-gcc/gcc-4.9.0-20140702/cris-linux-gnu/./gcc/xgcc -B/data/fedora/cross-gcc/gcc-4.9.0-20140702/cris-linux-gnu/./gcc/ -B/usr/cris-linux-gnu/bin/ -B/usr/cris-linux-gnu/lib/ -isystem /usr/cris-linux-gnu/include -isystem /usr/cris-linux-gnu/sys-include    -g -O2 -O2  -g -O2 -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include   -fPIC -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -Dinhibit_libc  -fPIC -I. -I. -I../.././gcc -I../../../gcc-4.9.0-20140702/libgcc -I../../../gcc-4.9.0-20140702/libgcc/. -I../../../gcc-4.9.0-20140702/libgcc/../gcc -I../../../gcc-4.9.0-20140702/libgcc/../include  -DHAVE_CC_TLS -DUSE_EMUTLS -o _subvsi3.o -MT _subvsi3.o -MD -MP -MF _subvsi3.dep -DL_subvsi3 -c ../../../gcc-4.9.0-20140702/libgcc/libgcc2.c -fvisibility=hidden -DHIDE_EXPORTS
../../../gcc-4.9.0-20140702/libgcc/libgcc2.c: In function ‘__subvsi3’:
../../../gcc-4.9.0-20140702/libgcc/libgcc2.c:122:1: error: unrecognizable insn:
 }
 ^
(call_insn 27 26 28 7 (parallel [
            (call (mem:QI (symbol_ref:SI ("abort") [flags 0x41] <function_decl 0x7f5784e05d00 abort>) [0 __builtin_abort S1 A8])
                (const_int 0 [0]))
            (clobber (reg:SI 16 srp))
        ]) ../../../gcc-4.9.0-20140702/libgcc/libgcc2.c:119 -1
     (expr_list:REG_NORETURN (const_int 0 [0])
        (expr_list:REG_EH_REGION (const_int 0 [0])
            (nil)))
    (nil))
../../../gcc-4.9.0-20140702/libgcc/libgcc2.c:122:1: internal compiler error: in extract_insn, at recog.c:2202
0x71c16a _fatal_insn(char const*, rtx_def const*, char const*, int, char const*)
        ../../gcc-4.9.0-20140702/gcc/rtl-error.c:109
0x71c199 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
        ../../gcc-4.9.0-20140702/gcc/rtl-error.c:117
0x6ee18a extract_insn(rtx_def*)
        ../../gcc-4.9.0-20140702/gcc/recog.c:2202
0x5d08d0 instantiate_virtual_regs_in_insn
        ../../gcc-4.9.0-20140702/gcc/function.c:1607
0x5d08d0 instantiate_virtual_regs
        ../../gcc-4.9.0-20140702/gcc/function.c:1925
0x5d08d0 execute
        ../../gcc-4.9.0-20140702/gcc/function.c:1975
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://bugzilla.redhat.com/bugzilla/> for instructions.
The bug is not reproducible, so it is likely a hardware or OS problem.


I'm also very intrigued by that last line - I can reproduce it quite easily.

Anyway, I've added a reduced libgcc2.i that causes the error to occur.  I don't think it'll help because you need the intermediate-stage compiler binaries also.

System gcc being used to build the cross-compiler:
Using built-in specs.
COLLECT_GCC=/usr/bin/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.2/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-isl=/builddir/build/BUILD/gcc-4.8.2-20131212/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.2-20131212/obj-x86_64-redhat-linux/cloog-install --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.8.2 20131212 (Red Hat 4.8.2-7) (GCC)
Comment 1 dhowells@redhat.com 2014-07-07 15:14:35 UTC
I needed the following change to gcc (courtesy of Nick Clifton) to get cris-gcc to build at all, even without libgcc:

Index: gcc/config.gcc
===================================================================
--- gcc/config.gcc
+++ gcc/config.gcc
@@ -1130,7 +1130,7 @@
 crisv32-*-linux* | cris-*-linux*)
 	tm_file="dbxelf.h elfos.h ${tm_file} gnu-user.h linux.h glibc-stdint.h cris/linux.h"
 	# We need to avoid using t-linux, so override default tmake_file
-	tmake_file="cris/t-cris cris/t-linux t-slibgcc t-linux"
+	tmake_file="${tmake_file} cris/t-cris cris/t-linux t-slibgcc"
 	extra_options="${extra_options} cris/linux.opt"
 	case $target in
 	  cris-*-*)

This behaviour can be produced with the SVNREV 212237 (2014-07-02) gcc-4.9.0 compiler tarball plus one patch and then the following config:

AR_FOR_TARGET=/usr/bin/cris-linux-gnu-ar \
AS_FOR_TARGET=/usr/bin/cris-linux-gnu-as \
DLLTOOL_FOR_TARGET=/usr/bin/cris-linux-gnu-dlltool \
LD_FOR_TARGET=/usr/bin/cris-linux-gnu-ld \
NM_FOR_TARGET=/usr/bin/cris-linux-gnu-nm \
OBJDUMP_FOR_TARGET=/usr/bin/cris-linux-gnu-objdump \
RANLIB_FOR_TARGET=/usr/bin/cris-linux-gnu-ranlib \
STRIP_FOR_TARGET=/usr/bin/cris-linux-gnu-strip \
WINDRES_FOR_TARGET=/usr/bin/cris-linux-gnu-windres \
WINDMC_FOR_TARGET=/usr/bin/cris-linux-gnu-windmc \
LDFLAGS='-Wl,-z,relro ' \
../gcc-4.9.0-20140702/configure --bindir=/usr/bin --build=x86_64-redhat-linux-gnu \
  --datadir=/usr/share --disable-decimal-float --disable-dependency-tracking \
  --disable-gold --disable-libgomp --disable-libmudflap --disable-libquadmath \
  --disable-libssp --disable-nls --disable-plugin --disable-shared \
  --disable-silent-rules --disable-sjlj-exceptions --disable-threads \
  --enable-checking= --enable-gnu-unique-object --enable-initfini-array \
  --enable-languages=c,c++ --enable-linker-build-id --enable-nls --enable-obsolete \
  --enable-targets=all --exec-prefix=/usr --host=x86_64-redhat-linux-gnu \
  --includedir=/usr/include --infodir=/usr/share/info --libexecdir=/usr/libexec \
  --localstatedir=/var --mandir=/usr/share/man --prefix=/usr \
  --program-prefix=cris-linux-gnu- --sbindir=/usr/sbin --sharedstatedir=/var/lib \
  --sysconfdir=/etc --target=cris-linux-gnu \
  --with-bugurl=http://bugzilla.redhat.com/bugzilla/ \
  --with-linker-hash-style=gnu --with-newlib --with-sysroot=/usr/cris-linux-gnu/sys-root \
  --with-system-libunwind --with-system-zlib --without-headers --without-isl \
  --without-cloog

The binutils is:
cris-linux-gnu-as -v
GNU assembler version 2.24.0 (cris-linux-gnu) using BFD version version 2.24.0-4.fc20 20140613

The compiler is built with:
AR_FOR_TARGET=/usr/bin/cris-linux-gnu-ar \
AS_FOR_TARGET=/usr/bin/cris-linux-gnu-as \
DLLTOOL_FOR_TARGET=/usr/bin/cris-linux-gnu-dlltool \
LD_FOR_TARGET=/usr/bin/cris-linux-gnu-ld \
NM_FOR_TARGET=/usr/bin/cris-linux-gnu-nm \
OBJDUMP_FOR_TARGET=/usr/bin/cris-linux-gnu-objdump \
RANLIB_FOR_TARGET=/usr/bin/cris-linux-gnu-ranlib \
STRIP_FOR_TARGET=/usr/bin/cris-linux-gnu-strip \
WINDRES_FOR_TARGET=/usr/bin/cris-linux-gnu-windres \
WINDMC_FOR_TARGET=/usr/bin/cris-linux-gnu-windmc \
make -C cris-linux-gnu tooldir=/usr all-gcc

libgcc is built with:
make -C cris-linux-gnu tooldir=/usr all-target-libgcc
Comment 2 dhowells@redhat.com 2014-07-07 16:04:51 UTC
This also appears to occur for --target=sh64-linux on an unpatched gcc tree.
Comment 3 Hans-Peter Nilsson 2014-07-14 19:07:40 UTC
(In reply to dhowells@redhat.com from comment #1)

Thanks for reporting, I'll take this.  (I don't autotest cris-linux not crisv32-linux; they aren't in general use anymore.)

> I needed the following change to gcc (courtesy of Nick Clifton) to get
> cris-gcc to build at all, even without libgcc:
> 
> Index: gcc/config.gcc
> ===================================================================
> --- gcc/config.gcc
> +++ gcc/config.gcc
> @@ -1130,7 +1130,7 @@
>  crisv32-*-linux* | cris-*-linux*)
>  	tm_file="dbxelf.h elfos.h ${tm_file} gnu-user.h linux.h glibc-stdint.h
> cris/linux.h"
>  	# We need to avoid using t-linux, so override default tmake_file
> -	tmake_file="cris/t-cris cris/t-linux t-slibgcc t-linux"
> +	tmake_file="${tmake_file} cris/t-cris cris/t-linux t-slibgcc"
>  	extra_options="${extra_options} cris/linux.opt"
>  	case $target in
>  	  cris-*-*)

Obvious breakages (for obvious reasons with obvious correct results) is covered by the obviousness rule and thus free to commit for anyone (including you).

In fact, this typo (missing prepending of ${tmake_file}), supposedly introduced at the time of some general config-revision, is shared with several targets.

JFTR:

> This behaviour can be produced with the SVNREV 212237 (2014-07-02) gcc-4.9.0
> compiler tarball plus one patch and then the following config:
[...]

No need for specific options besides --target nor special paths given target binutils in the PATH; you should set that instead.  (Sadly, "no specific options" with the exception of sysroot / build-sysroot options unless hoops are jumped through, but I hope to fix that one day for all cross-targets.)  Also, a multitude of options like this magnitude is a red flag.  (Your cross-build setup is flawed, but I doubt that's the root of the build problem.)

> Anyway, I've added a reduced libgcc2.i that causes the error to occur.

Thanks.

>  I don't think it'll help because you need the intermediate-stage compiler binaries also.

Incorrect.  This is a *cross-compiler*.  Even if it was a native build, failing building the first stage libgcc build makes the stageness issue moot. :)

> libgcc is built with:
> make -C cris-linux-gnu tooldir=/usr all-target-libgcc

I'd expect "make all-target-libgcc" to Just Work.
Comment 4 Hans-Peter Nilsson 2014-07-14 19:26:42 UTC
(In reply to Hans-Peter Nilsson from comment #3)
> (In reply to dhowells@redhat.com from comment #1)

> > Index: gcc/config.gcc
> > ===================================================================
> > --- gcc/config.gcc
> > +++ gcc/config.gcc
> > @@ -1130,7 +1130,7 @@
> >  crisv32-*-linux* | cris-*-linux*)
> >  	tm_file="dbxelf.h elfos.h ${tm_file} gnu-user.h linux.h glibc-stdint.h
> > cris/linux.h"
> >  	# We need to avoid using t-linux, so override default tmake_file
> > -	tmake_file="cris/t-cris cris/t-linux t-slibgcc t-linux"
> > +	tmake_file="${tmake_file} cris/t-cris cris/t-linux t-slibgcc"

> Obvious breakages (for obvious reasons with obvious correct results) is
> covered by the obviousness rule and thus free to commit for anyone
> (including you).

Except it's only obvious in the absence of a comment "explaining" the exception.  Doh!  So, there's another issue and that patch is incorrect (do *not* apply it).  Also, I don't remember what aspects of t-linux needs avoiding.  Looking into it...
Comment 5 Hans-Peter Nilsson 2014-07-15 00:40:34 UTC
Confirmed the observation at r212508, with the patch in the attachment in the next comment.
Comment 6 Hans-Peter Nilsson 2014-07-15 00:43:50 UTC
Created attachment 33121 [details]
Patch to config.gcc

Correct patch to config.gcc required to actually build the compiler proper.
Comment 7 Hans-Peter Nilsson 2014-07-15 00:58:28 UTC
(In reply to dhowells@redhat.com from comment #0)

BTW,

> Please submit a full bug report,
> with preprocessed source if appropriate.
> Please include the complete backtrace with any bug report.
> See <http://bugzilla.redhat.com/bugzilla/> for instructions.
> The bug is not reproducible, so it is likely a hardware or OS problem.
> 
> 
> I'm also very intrigued by that last line - I can reproduce it quite easily.

This is a RH local patch in your host gcc (by Jakub, IIRC) to help users re-running the actual ICEing command adding -save-temps.  I'm guessing it has a bug and accidentally drops some option required to reproduce the ICE...
Comment 8 Hans-Peter Nilsson 2014-07-15 02:48:38 UTC
(In reply to dhowells@redhat.com from comment #0)
> ../../../gcc-4.9.0-20140702/libgcc/libgcc2.c: In function ‘__subvsi3’:
> ../../../gcc-4.9.0-20140702/libgcc/libgcc2.c:122:1: error: unrecognizable
> insn:
>  }
>  ^
> (call_insn 27 26 28 7 (parallel [
>             (call (mem:QI (symbol_ref:SI ("abort") [flags 0x41]
> <function_decl 0x7f5784e05d00 abort>) [0 __builtin_abort S1 A8])


This symbol_ref must be wrapped inside a CONST by the middle-end.
Something changed such that that doesn't happen anymore; that's the bug.
Unless this was a deliberate general change in representation, which I doubt.
Still investigating...
Comment 9 Hans-Peter Nilsson 2014-07-15 03:07:03 UTC
(In reply to Hans-Peter Nilsson from comment #8)
> This symbol_ref must be wrapped inside a CONST by the middle-end.

Uh, strike that, I'm hallucinating.
Comment 10 dhowells@redhat.com 2014-07-15 09:19:14 UTC
(In reply to Hans-Peter Nilsson from comment #7)
> (In reply to dhowells@redhat.com from comment #0)
> > I'm also very intrigued by that last line - I can reproduce it quite easily.
> 
> This is a RH local patch in your host gcc (by Jakub, IIRC) to help users
> re-running the actual ICEing command adding -save-temps.  I'm guessing it
> has a bug and accidentally drops some option required to reproduce the ICE...

It's in the gcc-4.9.0-20140702 tarball.
Comment 11 dhowells@redhat.com 2014-07-15 09:34:31 UTC
(In reply to Hans-Peter Nilsson from comment #3)
> > libgcc is built with:
> > make -C cris-linux-gnu tooldir=/usr all-target-libgcc
> 
> I'd expect "make all-target-libgcc" to Just Work.

So would I.  However, it doesn't work for all arches that the SRPM builds a cross-compiler for.  I need the compiler to build the kernel, but not normally libgcc, however, I've been asked to build libgcc if I can.  The arches for which I can't build libgcc include: cris, sh, sh64 and tile.
Comment 12 dhowells@redhat.com 2014-07-15 09:36:19 UTC
(In reply to Hans-Peter Nilsson from comment #6)
> Created attachment 33121 [details]
> Patch to config.gcc
> 
> Correct patch to config.gcc required to actually build the compiler proper.

Okay, I've tried that.  I can't see that it makes any obvious difference.  Is there something I should look for?
Comment 13 Hans-Peter Nilsson 2014-07-15 14:42:07 UTC
(In reply to dhowells@redhat.com from comment #12)
> (In reply to Hans-Peter Nilsson from comment #6)
> > Created attachment 33121 [details]
> > Patch to config.gcc
> > 
> > Correct patch to config.gcc required to actually build the compiler proper.
> 
> Okay, I've tried that.  I can't see that it makes any obvious difference. 
> Is there something I should look for?

Oh, it wasn't meant as a fix to the problem at hand, just a replacement for the prerequisite patch.  The differences to *that* one is that the duplicate t-slibgcc t-linux are removed and the comment too, after checking why I had it; likely a libgcc-related issue with headers (and so moot after the libgcc split years ago).
Comment 14 Hans-Peter Nilsson 2014-07-15 14:44:31 UTC
(In reply to dhowells@redhat.com from comment #10)
> (In reply to Hans-Peter Nilsson from comment #7)
> > (In reply to dhowells@redhat.com from comment #0)
> > > I'm also very intrigued by that last line - I can reproduce it quite easily.
> > 
> > This is a RH local patch in your host gcc (by Jakub, IIRC) to help users
> > re-running the actual ICEing command adding -save-temps.  I'm guessing it
> > has a bug and accidentally drops some option required to reproduce the ICE...
> 
> It's in the gcc-4.9.0-20140702 tarball.

Oh it finally made into the FSF repo, good!
Could you please consider open a separate PR for the "is not reproducible" misdisagnosis?
Comment 15 dhowells@redhat.com 2014-07-15 14:58:11 UTC
(In reply to Hans-Peter Nilsson from comment #14)
> Could you please consider open a separate PR for the "is not reproducible"
> misdisagnosis?

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61812
Comment 16 Hans-Peter Nilsson 2014-07-17 02:04:25 UTC
Author: hp
Date: Thu Jul 17 02:03:52 2014
New Revision: 212708

URL: https://gcc.gnu.org/viewcvs?rev=212708&root=gcc&view=rev
Log:
	PR target/61737.
	* config/cris/cris.c (TARGET_LEGITIMATE_CONSTANT_P)
	(TARGET_CANNOT_FORCE_CONST_MEM): Define.
	(cris_cannot_force_const_mem, cris_legitimate_constant_p): New
	functions.
	(cris_print_index, cris_print_operand, cris_constant_index_p)
	(cris_side_effect_mode_ok): Replace CONSTANT_P with CRIS_CONSTANT_P.
	(cris_address_cost): Ditto last CONSTANT_P.
	(cris_symbol_type_of): Rename from cris_pic_symbol_type_of.  All
        callers changed.  Yield cris_offsettable_symbol for non-PIC
        constant symbolic expressions including labels.  Yield cris_unspec
	for all unspecs.
	(cris_expand_pic_call_address): New parameter MARKERP.  Set its
        target to pic_offset_table_rtx for calls that will likely go
        through PLT, const0_rtx when they can't.  All callers changed.
	Assert flag_pic.  Use CONSTANT_P, not CONSTANT_ADDRESS_P, for
	symbolic expressions to be PICified.  Remove second, redundant,
	assert on can_create_pseudo_p returning non-zero.  Use
	replace_equiv_address_nv, not replace_equiv_address, for final
	operand update.
	* config/cris/cris.md ("movsi"): Move variable t to pattern
	toplevel. Adjust assert for new cris_symbol_type member.  Use
	CONSTANT_P instead of CONSTANT_ADDRESS_P.
	("*movsi_internal") <case 9>: Make check for valid unspec operands
	for lapc stricter.
	<case CRIS_UNSPEC_PCREL, CRIS_UNSPEC_PLT_PCREL>: Clear condition
	codes.
	("call", "call_value"): Use second incoming operand as a marker
	for pic-offset-table-register being used.
	("*expanded_call_non_v32", "*expanded_call_v32")
        ("*expanded_call_value_non_v32", "*expanded_call_value_v32"): For
	second incoming operand to CALL, match cris_call_type_marker.
	("*expanded_call_value_side"): Ditto.  Disable before
	reload_completed.
	("*expanded_call_side"): Ditto.  Fix typo in comment.
	(moverside, movemside peepholes): Check for CRIS_CONSTANT_P, not
	CONSTANT_P.
	* config/cris/predicates.md ("cris_call_type_marker"): New predicate.
	* config/cris/cris.h (CRIS_CONSTANT_P): New macro.
	(enum cris_symbol_type): Rename from cris_pic_symbol_type.  All
        users changed.  Add members cris_offsettable_symbol and
	cris_unspec.
	(cris_symbol_type): Rename from cris_pic_symbol_type.
	* config/cris/constraints.md ("T"): Use CRIS_CONSTANT_P, not
        just CONSTANT_P.
	* config/cris/cris-protos.h (cris_symbol_type_of,
	cris_expand_pic_call_address): Adjust prototypes.
	(cris_legitimate_constant_p): New prototype.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/cris/constraints.md
    trunk/gcc/config/cris/cris-protos.h
    trunk/gcc/config/cris/cris.c
    trunk/gcc/config/cris/cris.h
    trunk/gcc/config/cris/cris.md
    trunk/gcc/config/cris/predicates.md
Comment 17 Hans-Peter Nilsson 2014-07-17 03:53:56 UTC
Author: hp
Date: Thu Jul 17 03:53:23 2014
New Revision: 212713

URL: https://gcc.gnu.org/viewcvs?rev=212713&root=gcc&view=rev
Log:
	Backport from trunk.
	PR target/61737.
	* config/cris/cris.c (TARGET_LEGITIMATE_CONSTANT_P)
	(TARGET_CANNOT_FORCE_CONST_MEM): Define.
	(cris_cannot_force_const_mem, cris_legitimate_constant_p): New
	functions.
	(cris_print_index, cris_print_operand, cris_constant_index_p)
	(cris_side_effect_mode_ok): Replace CONSTANT_P with CRIS_CONSTANT_P.
	(cris_address_cost): Ditto last CONSTANT_P.
	(cris_symbol_type_of): Rename from cris_pic_symbol_type_of.  All
        callers changed.  Yield cris_offsettable_symbol for non-PIC
        constant symbolic expressions including labels.  Yield cris_unspec
	for all unspecs.
	(cris_expand_pic_call_address): New parameter MARKERP.  Set its
        target to pic_offset_table_rtx for calls that will likely go
        through PLT, const0_rtx when they can't.  All callers changed.
	Assert flag_pic.  Use CONSTANT_P, not CONSTANT_ADDRESS_P, for
	symbolic expressions to be PICified.  Remove second, redundant,
	assert on can_create_pseudo_p returning non-zero.  Use
	replace_equiv_address_nv, not replace_equiv_address, for final
	operand update.
	* config/cris/cris.md ("movsi"): Move variable t to pattern
	toplevel. Adjust assert for new cris_symbol_type member.  Use
	CONSTANT_P instead of CONSTANT_ADDRESS_P.
	("*movsi_internal") <case 9>: Make check for valid unspec operands
	for lapc stricter.
	<case CRIS_UNSPEC_PCREL, CRIS_UNSPEC_PLT_PCREL>: Clear condition
	codes.
	("call", "call_value"): Use second incoming operand as a marker
	for pic-offset-table-register being used.
	("*expanded_call_non_v32", "*expanded_call_v32")
        ("*expanded_call_value_non_v32", "*expanded_call_value_v32"): For
	second incoming operand to CALL, match cris_call_type_marker.
	("*expanded_call_value_side"): Ditto.  Disable before
	reload_completed.
	("*expanded_call_side"): Ditto.  Fix typo in comment.
	(moverside, movemside peepholes): Check for CRIS_CONSTANT_P, not
	CONSTANT_P.
	* config/cris/predicates.md ("cris_call_type_marker"): New predicate.
	* config/cris/cris.h (CRIS_CONSTANT_P): New macro.
	(enum cris_symbol_type): Rename from cris_pic_symbol_type.  All
        users changed.  Add members cris_offsettable_symbol and
	cris_unspec.
	(cris_symbol_type): Rename from cris_pic_symbol_type.
	* config/cris/constraints.md ("T"): Use CRIS_CONSTANT_P, not
        just CONSTANT_P.
	* config/cris/cris-protos.h (cris_symbol_type_of,
	cris_expand_pic_call_address): Adjust prototypes.
	(cris_legitimate_constant_p): New prototype.

Modified:
    branches/gcc-4_9-branch/gcc/ChangeLog
    branches/gcc-4_9-branch/gcc/config/cris/constraints.md
    branches/gcc-4_9-branch/gcc/config/cris/cris-protos.h
    branches/gcc-4_9-branch/gcc/config/cris/cris.c
    branches/gcc-4_9-branch/gcc/config/cris/cris.h
    branches/gcc-4_9-branch/gcc/config/cris/cris.md
    branches/gcc-4_9-branch/gcc/config/cris/predicates.md
Comment 18 Hans-Peter Nilsson 2014-07-17 04:27:38 UTC
Prerequisite config.gcc patch committed separately.
Comment 19 dhowells@redhat.com 2014-07-18 13:21:46 UTC
This seems to have done the trick, thanks!
Comment 20 Hans-Peter Nilsson 2014-07-18 15:53:12 UTC
Unfortunately, at the face of it, I think the only factors common with PR61844 are "rot at the RTL level" and "building libgcc".  (My own involvement with SH64 is too far in the past and then only peripheral to the GCC port.)
Comment 21 Hans-Peter Nilsson 2014-07-18 15:58:27 UTC
(In reply to Hans-Peter Nilsson from comment #20)
> Unfortunately, at the face of it, I think the only factors common with
> PR61844 are "rot at the RTL level" and "building libgcc".

Apparently also "when handling PIC" (register 12 on SH says grep).
Unfortunately that's unlikely to help anyone not involved with SH64.
Comment 22 dhowells@redhat.com 2014-07-18 16:04:51 UTC
That's a shame.  It's just that the error messages look very similar.