public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/61844] New: ICE when building libgcc for sh64 cross-compiler
@ 2014-07-18 14:05 dhowells at redhat dot com
  2014-07-18 14:22 ` [Bug c/61844] " dhowells at redhat dot com
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: dhowells at redhat dot com @ 2014-07-18 14:05 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61844

            Bug ID: 61844
           Summary: ICE when building libgcc for sh64 cross-compiler
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dhowells at redhat dot com

When trying to build a cross-compiler for sh64 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/sh64-linux-gnu/./gcc/xgcc
-B/data/fedora/cross-gcc/gcc-4.9.0-20140702/sh64-linux-gnu/./gcc/
-B/usr/sh64-linux/bin/ -B/usr/sh64-linux/lib/ -isystem /usr/sh64-linux/include
-isystem /usr/sh64-linux/sys-include    -g -O2 -mb -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 -DNO_FPSCR_VALUES -w -Wno-sync-nand -g -DIN_LIBGCC2
-fbuilding-libgcc -fno-stack-protector -Dinhibit_libc  -fpic -DNO_FPSCR_VALUES
-w -Wno-sync-nand -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 _addvsi3.o -MT _addvsi3.o -MD -MP -MF _addvsi3.dep -DL_addvsi3 -c
../../../../gcc-4.9.0-20140702/libgcc/libgcc2.c -fvisibility=hidden
-DHIDE_EXPORTS
../../../../gcc-4.9.0-20140702/libgcc/libgcc2.c: In function ‘__addvsi3’:
../../../../gcc-4.9.0-20140702/libgcc/libgcc2.c:84:1: error: insn does not
satisfy its constraints:
 }
 ^
(insn 27 51 52 3 (set (reg:SI 1 r1 [172])
        (mem/c:SI (plus:SI (reg:SI 2 r2)
                (reg:SI 12 r12)) [0  S4 A32]))
../../../../gcc-4.9.0-20140702/libgcc/libgcc2.c:81 260 {*movsi_media}
     (nil))
../../../../gcc-4.9.0-20140702/libgcc/libgcc2.c:84:1: internal compiler error:
in reload_cse_simplify_operands, at postreload.c:411
0x73b24a _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
        ../../gcc-4.9.0-20140702/gcc/rtl-error.c:109
0x73b26f _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
        ../../gcc-4.9.0-20140702/gcc/rtl-error.c:120
0x6f2aa0 reload_cse_simplify_operands
        ../../gcc-4.9.0-20140702/gcc/postreload.c:411
0x6f48cc reload_cse_simplify
        ../../gcc-4.9.0-20140702/gcc/postreload.c:181
0x6f48cc reload_cse_regs_1
        ../../gcc-4.9.0-20140702/gcc/postreload.c:220
0x6f4cbb reload_cse_regs
        ../../gcc-4.9.0-20140702/gcc/postreload.c:68
0x6f4cbb rest_of_handle_postreload
        ../../gcc-4.9.0-20140702/gcc/postreload.c:2332
0x6f4cbb execute
        ../../gcc-4.9.0-20140702/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://bugzilla.redhat.com/bugzilla/> for instructions.
Preprocessed source stored into /tmp/cce3xHzL.out file, please attach this to
your bugreport.

The same reduced test that causes bug 61737 to ICE causes this one to ICE. 
This can be found here:

    https://gcc.gnu.org/bugzilla/attachment.cgi?id=33082
>From gcc-bugs-return-456722-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Jul 18 14:07:29 2014
Return-Path: <gcc-bugs-return-456722-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 23653 invoked by alias); 18 Jul 2014 14:07:28 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 23580 invoked by uid 48); 18 Jul 2014 14:07:24 -0000
From: "dhowells at redhat dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/61844] ICE when building libgcc for sh64 cross-compiler
Date: Fri, 18 Jul 2014 14:07:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: dhowells at redhat dot com
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-61844-4-576yTP3JZ4@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-61844-4@http.gcc.gnu.org/bugzilla/>
References: <bug-61844-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-07/txt/msg01313.txt.bz2
Content-length: 1338

https://gcc.gnu.org/bugzilla/show_bug.cgi?ida844

--- Comment #1 from dhowells at redhat dot com <dhowells at redhat dot com> ---
System compiler being used:

Using built-in specs.
COLLECT_GCC=/usr/bin/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.3/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.3-20140624/obj-x86_64-redhat-linux/isl-install
--with-cloog=/builddir/build/BUILD/gcc-4.8.3-20140624/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.3 20140624 (Red Hat 4.8.3-1) (GCC)


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug c/61844] ICE when building libgcc for sh64 cross-compiler
  2014-07-18 14:05 [Bug c/61844] New: ICE when building libgcc for sh64 cross-compiler dhowells at redhat dot com
@ 2014-07-18 14:22 ` dhowells at redhat dot com
  2014-07-18 14:25 ` dhowells at redhat dot com
                   ` (12 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: dhowells at redhat dot com @ 2014-07-18 14:22 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61844

--- Comment #2 from dhowells at redhat dot com <dhowells at redhat dot com> ---
Created attachment 33144
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33144&action=edit
Old, no-longer functional patch to libgcc

I was given the attached patch when I was on gcc-4.7 but it doesn't seem to
help with gcc-4.9.  The problem occurs with or without the patch.


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug c/61844] ICE when building libgcc for sh64 cross-compiler
  2014-07-18 14:05 [Bug c/61844] New: ICE when building libgcc for sh64 cross-compiler dhowells at redhat dot com
  2014-07-18 14:22 ` [Bug c/61844] " dhowells at redhat dot com
@ 2014-07-18 14:25 ` dhowells at redhat dot com
  2014-07-18 14:28 ` dhowells at redhat dot com
                   ` (11 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: dhowells at redhat dot com @ 2014-07-18 14:25 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61844

--- Comment #3 from dhowells at redhat dot com <dhowells at redhat dot com> ---
The compiler is configured thusly:

AR_FOR_TARGET=/usr/bin/sh64-linux-gnu-ar \
AS_FOR_TARGET=/usr/bin/sh64-linux-gnu-as \
DLLTOOL_FOR_TARGET=/usr/bin/sh64-linux-gnu-dlltool \
LD_FOR_TARGET=/usr/bin/sh64-linux-gnu-ld \
NM_FOR_TARGET=/usr/bin/sh64-linux-gnu-nm \
OBJDUMP_FOR_TARGET=/usr/bin/sh64-linux-gnu-objdump \
RANLIB_FOR_TARGET=/usr/bin/sh64-linux-gnu-ranlib \
STRIP_FOR_TARGET=/usr/bin/sh64-linux-gnu-strip \
WINDRES_FOR_TARGET=/usr/bin/sh64-linux-gnu-windres \
WINDMC_FOR_TARGET=/usr/bin/sh64-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=sh64-linux-gnu-
--sbindir=/usr/sbin --sharedstatedir=/var/lib --sysconfdir=/etc
--target=sh64-linux --with-bugurl=http://bugzilla.redhat.com/bugzilla/
--with-linker-hash-style=gnu --with-newlib
--with-sysroot=/usr/sh64-linux-gnu/sys-root --with-system-libunwind
--with-system-zlib --without-headers --without-isl --without-cloog
--with-multilib-list=m5-32media,m5-32media-nofpu,m5-compact,m5-compact-nofpu,m5-64media,m5-64media-nofpu

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

The compiler is built:

AR_FOR_TARGET=/usr/bin/sh64-linux-gnu-ar \
AS_FOR_TARGET=/usr/bin/sh64-linux-gnu-as \
DLLTOOL_FOR_TARGET=/usr/bin/sh64-linux-gnu-dlltool \
LD_FOR_TARGET=/usr/bin/sh64-linux-gnu-ld \
NM_FOR_TARGET=/usr/bin/sh64-linux-gnu-nm \
OBJDUMP_FOR_TARGET=/usr/bin/sh64-linux-gnu-objdump \
RANLIB_FOR_TARGET=/usr/bin/sh64-linux-gnu-ranlib \
STRIP_FOR_TARGET=/usr/bin/sh64-linux-gnu-strip \
WINDRES_FOR_TARGET=/usr/bin/sh64-linux-gnu-windres \
WINDMC_FOR_TARGET=/usr/bin/sh64-linux-gnu-windmc \
make -C sh64-linux-gnu -j12 tooldir=/usr all-gcc

Then libgcc is built:

make -C sh64-linux-gnu -j12 tooldir=/usr all-target-libgcc


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug c/61844] ICE when building libgcc for sh64 cross-compiler
  2014-07-18 14:05 [Bug c/61844] New: ICE when building libgcc for sh64 cross-compiler dhowells at redhat dot com
  2014-07-18 14:22 ` [Bug c/61844] " dhowells at redhat dot com
  2014-07-18 14:25 ` dhowells at redhat dot com
@ 2014-07-18 14:28 ` dhowells at redhat dot com
  2014-07-18 14:31 ` dhowells at redhat dot com
                   ` (10 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: dhowells at redhat dot com @ 2014-07-18 14:28 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61844

--- Comment #4 from dhowells at redhat dot com <dhowells at redhat dot com> ---
This behaviour can be produced with the SVNREV 212237 (2014-07-02) gcc-4.9.0
compiler tarball and no extra patches.


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug c/61844] ICE when building libgcc for sh64 cross-compiler
  2014-07-18 14:05 [Bug c/61844] New: ICE when building libgcc for sh64 cross-compiler dhowells at redhat dot com
                   ` (2 preceding siblings ...)
  2014-07-18 14:28 ` dhowells at redhat dot com
@ 2014-07-18 14:31 ` dhowells at redhat dot com
  2014-07-27 20:33 ` [Bug rtl-optimization/61844] " olegendo at gcc dot gnu.org
                   ` (9 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: dhowells at redhat dot com @ 2014-07-18 14:31 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61844

--- Comment #5 from dhowells at redhat dot com <dhowells at redhat dot com> ---
Note that I also see a number of warnings like:

/usr/bin/sh64-linux-gnu-nm: _sdivsi3_s.o: File format is ambiguous


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug rtl-optimization/61844] ICE when building libgcc for sh64 cross-compiler
  2014-07-18 14:05 [Bug c/61844] New: ICE when building libgcc for sh64 cross-compiler dhowells at redhat dot com
                   ` (3 preceding siblings ...)
  2014-07-18 14:31 ` dhowells at redhat dot com
@ 2014-07-27 20:33 ` olegendo at gcc dot gnu.org
  2014-07-28  0:29 ` [Bug target/61844] " kkojima at gcc dot gnu.org
                   ` (8 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: olegendo at gcc dot gnu.org @ 2014-07-27 20:33 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61844

Oleg Endo <olegendo at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|                            |sh64-*-*
                 CC|                            |kkojima at gcc dot gnu.org,
                   |                            |olegendo at gcc dot gnu.org

--- Comment #6 from Oleg Endo <olegendo at gcc dot gnu.org> ---
Ugh.  sh64 is not so well maintained these days.

(insn 27 51 52 3 (set (reg:SI 1 r1 [172])
        (mem/c:SI (plus:SI (reg:SI 2 r2)
                (reg:SI 12 r12)) [0  S4 A32]))
../../../../gcc-4.9.0-20140702/libgcc/libgcc2.c:81 260 {*movsi_media}
     (nil))

is actually a valid addressing mode for the LDX.L instruction, which seems to
be missing in sh.md?!


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug target/61844] ICE when building libgcc for sh64 cross-compiler
  2014-07-18 14:05 [Bug c/61844] New: ICE when building libgcc for sh64 cross-compiler dhowells at redhat dot com
                   ` (4 preceding siblings ...)
  2014-07-27 20:33 ` [Bug rtl-optimization/61844] " olegendo at gcc dot gnu.org
@ 2014-07-28  0:29 ` kkojima at gcc dot gnu.org
  2014-07-28  1:11 ` kkojima at gcc dot gnu.org
                   ` (7 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: kkojima at gcc dot gnu.org @ 2014-07-28  0:29 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61844

Kazumoto Kojima <kkojima at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|rtl-optimization            |target

--- Comment #7 from Kazumoto Kojima <kkojima at gcc dot gnu.org> ---
> Ugh.  sh64 is not so well maintained these days.

Agreed.
I don't have enough time for sh64 anymore, unfortunately.

> (insn 27 51 52 3 (set (reg:SI 1 r1 [172])
>         (mem/c:SI (plus:SI (reg:SI 2 r2)
>                 (reg:SI 12 r12)) [0  S4 A32])) ../../../../gcc-4.9.0-20140702/libgcc/libgcc2.c:81 260 {*movsi_media}
>      (nil))
> 
> is actually a valid addressing mode for the LDX.L instruction, which
> seems to be missing in sh.md?!

It seems that the 4th alternative of *movsi_media should handle
that case.

BTW, my sh64-elf build fails with another ICE:

/exp/ldroot/dodes/xsh64-elf-combined/build/./gcc/xgcc
-B/exp/ldroot/dodes/xsh64-elf-combined/build/./gcc/
-B/exp/ldroot/dodes/xsh64-elf-combined/install/sh64-unknown-elf/bin/
-B/exp/ldroot/dodes/xsh64-elf-combined/install/sh64-unknown-elf/lib/ -isystem
/exp/ldroot/dodes/xsh64-elf-combined/install/sh64-unknown-elf/include -isystem
/exp/ldroot/dodes/xsh64-elf-combined/install/sh64-unknown-elf/sys-include
-L/exp/ldroot/dodes/xsh64-elf-combined/build/./ld    -g -O2 -ml -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   -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector
-Dinhibit_libc  -I. -I. -I../../.././gcc
-I/exp/ldroot/dodes/xsh64-elf-combined/combined/libgcc
-I/exp/ldroot/dodes/xsh64-elf-combined/combined/libgcc/.
-I/exp/ldroot/dodes/xsh64-elf-combined/combined/libgcc/../gcc
-I/exp/ldroot/dodes/xsh64-elf-combined/combined/libgcc/../include 
-DHAVE_CC_TLS -DUSE_EMUTLS -o unwind-dw2.o -MT unwind-dw2.o -MD -MP -MF
unwind-dw2.dep -fexceptions -c
/exp/ldroot/dodes/xsh64-elf-combined/combined/libgcc/unwind-dw2.c
-fvisibility=hidden -DHIDE_EXPORTS
/exp/ldroot/dodes/xsh64-elf-combined/combined/libgcc/unwind-dw2.c: In function
'_Unwind_SetGR':
/exp/ldroot/dodes/xsh64-elf-combined/combined/libgcc/unwind-dw2.c:293:1:
internal compiler error: in push_reload, at reload.c:1352
 }
 ^
0x85b64f3 push_reload(rtx_def*, rtx_def*, rtx_def**, rtx_def**, reg_class,
machine_mode, machine_mode, int, int, int, reload_type)
        /exp/ldroot/dodes/xsh64-elf-combined/combined/gcc/reload.c:1351
0x85b8d9f find_reloads_address_1
        /exp/ldroot/dodes/xsh64-elf-combined/combined/gcc/reload.c:5974
0x85b95f5 find_reloads_address_1
        /exp/ldroot/dodes/xsh64-elf-combined/combined/gcc/reload.c:5617
0x85b6b75 find_reloads_address
        /exp/ldroot/dodes/xsh64-elf-combined/combined/gcc/reload.c:5270
0x85bd96c find_reloads(rtx_def*, int, int, int, short*)
        /exp/ldroot/dodes/xsh64-elf-combined/combined/gcc/reload.c:2889
...

In this case, it looks that find_reloads fails for the insn

(insn 440 439 61 33 (set (mem/f/j:SI (plus:SI (reg/v/f:SI 50 r50 [orig:268
unused_rs ] [268]) (reg:SI 736)) [0 unused_rs_142->prev+0 S4 A64])
        (reg/v/f:SI 34 r34 [orig:207 unused_rs ] [207]))
/exp/ldroot/dodes/xsh64-elf-combined/combined/libgcc/unwind-dw2.c:1082 261
{*movsi_media}
     (expr_list:REG_DEAD (reg/v/f:SI 34 r34 [orig:207 unused_rs ] [207])
        (nil)))

which shouldn't require any reloads.  Perhaps it is the same issue
with this PR.  I'll take a look at what is going on.


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug target/61844] ICE when building libgcc for sh64 cross-compiler
  2014-07-18 14:05 [Bug c/61844] New: ICE when building libgcc for sh64 cross-compiler dhowells at redhat dot com
                   ` (5 preceding siblings ...)
  2014-07-28  0:29 ` [Bug target/61844] " kkojima at gcc dot gnu.org
@ 2014-07-28  1:11 ` kkojima at gcc dot gnu.org
  2014-07-28  5:48 ` kkojima at gcc dot gnu.org
                   ` (6 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: kkojima at gcc dot gnu.org @ 2014-07-28  1:11 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61844

--- Comment #8 from Kazumoto Kojima <kkojima at gcc dot gnu.org> ---
Ah, I'm wrong about the insn 440 in #7 doesn't require reload.
I've missed psuedo reg 736.  Anyways there is an issue for
base+index reg addressing for *movsi_media.


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug target/61844] ICE when building libgcc for sh64 cross-compiler
  2014-07-18 14:05 [Bug c/61844] New: ICE when building libgcc for sh64 cross-compiler dhowells at redhat dot com
                   ` (6 preceding siblings ...)
  2014-07-28  1:11 ` kkojima at gcc dot gnu.org
@ 2014-07-28  5:48 ` kkojima at gcc dot gnu.org
  2014-07-28 21:57 ` olegendo at gcc dot gnu.org
                   ` (5 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: kkojima at gcc dot gnu.org @ 2014-07-28  5:48 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61844

--- Comment #9 from Kazumoto Kojima <kkojima at gcc dot gnu.org> ---
The testcase in #7 can be compiled successfully when -mindexed-addressing
is added.  It looks that base+index reg addressing mode is disabled
for shmedia32 and shcompact as default and it makes ira unhappy.
We used to return NO_REGS for INDEX_REG_CLASS when -mindexed-addressing
is disabled and it could suppress the use of reg+index addressing in
the older compilers.  It seems that now this isn't the right way to
disable that addressing.  With

--- /svn/trunk/gcc/config/sh/sh.h    2014-05-14 10:20:06.526008871 +0900
+++ gcc/config/sh/sh.h    2014-07-28 14:16:51.358771570 +0900
@@ -1723,8 +1723,7 @@ struct sh_args {
 #define INDEX_REGISTER_RTX_P(X) MAYBE_INDEX_REGISTER_RTX_P(X, false)
 #endif

-#define ALLOW_INDEXED_ADDRESS \
-  ((!TARGET_SHMEDIA32 && !TARGET_SHCOMPACT) || TARGET_ALLOW_INDEXED_ADDRESS)
+#define ALLOW_INDEXED_ADDRESS 1

 /* A C compound statement that attempts to replace X, which is an address
    that needs reloading, with a valid memory address for an operand of

my c-only sh64-elf build is completed without errors.  Although
I don't think the patch does the right thing, it'll prove that
ALLOW_INDEXED_ADDRESS causes problems.


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug target/61844] ICE when building libgcc for sh64 cross-compiler
  2014-07-18 14:05 [Bug c/61844] New: ICE when building libgcc for sh64 cross-compiler dhowells at redhat dot com
                   ` (7 preceding siblings ...)
  2014-07-28  5:48 ` kkojima at gcc dot gnu.org
@ 2014-07-28 21:57 ` olegendo at gcc dot gnu.org
  2014-07-29 21:31 ` olegendo at gcc dot gnu.org
                   ` (4 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: olegendo at gcc dot gnu.org @ 2014-07-28 21:57 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61844

--- Comment #10 from Oleg Endo <olegendo at gcc dot gnu.org> ---
Created attachment 33197
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33197&action=edit
a possible fix

(In reply to Kazumoto Kojima from comment #9)
> The testcase in #7 can be compiled successfully when -mindexed-addressing
> is added.  It looks that base+index reg addressing mode is disabled
> for shmedia32 and shcompact as default and it makes ira unhappy.
> We used to return NO_REGS for INDEX_REG_CLASS when -mindexed-addressing
> is disabled and it could suppress the use of reg+index addressing in
> the older compilers.  It seems that now this isn't the right way to
> disable that addressing.  With
> 
> --- /svn/trunk/gcc/config/sh/sh.h	2014-05-14 10:20:06.526008871 +0900
> +++ gcc/config/sh/sh.h	2014-07-28 14:16:51.358771570 +0900
> @@ -1723,8 +1723,7 @@ struct sh_args {
>  #define INDEX_REGISTER_RTX_P(X) MAYBE_INDEX_REGISTER_RTX_P(X, false)
>  #endif
>  
> -#define ALLOW_INDEXED_ADDRESS \
> -  ((!TARGET_SHMEDIA32 && !TARGET_SHCOMPACT) || TARGET_ALLOW_INDEXED_ADDRESS)
> +#define ALLOW_INDEXED_ADDRESS 1
>  
>  /* A C compound statement that attempts to replace X, which is an address
>     that needs reloading, with a valid memory address for an operand of
> 
> my c-only sh64-elf build is completed without errors.  Although
> I don't think the patch does the right thing, it'll prove that
> ALLOW_INDEXED_ADDRESS causes problems.

Yeah, always enabling indexed-addressing might not be the right thing in this
case.  At least reading the description of the -mindexed-addressing option is a
bit scary (I'm not that familiar with sh64).

With the attached patch applied I was able to build a c,c++ sh64-elf newlib
1.2.0 cross compiler for the default multilib configs {ml,mb} x
{m5-32media-nofpu, m5-64media, m5-64media-nofpu, m5-compact, m5-compact-nofpu}.
 However, I haven't checked whether it produces correct code actually.  Thus,
feedback is highly appreciated.

I don't know what happened to reload, but it seems it needs some extra help.

The patch shouldn't have any impact on non-sh64, since ALLOW_INDEXED_ADDRESS
always returns 'true' for non-sh64.

If it helps, it can be committed to trunk and the 4.9 and 4.8 branches.
>From gcc-bugs-return-457272-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Jul 28 22:04:58 2014
Return-Path: <gcc-bugs-return-457272-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 29891 invoked by alias); 28 Jul 2014 22:04:58 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 29845 invoked by uid 48); 28 Jul 2014 22:04:55 -0000
From: "olegendo at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/61844] ICE when building libgcc for sh64 cross-compiler
Date: Mon, 28 Jul 2014 22:04:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: target
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: olegendo at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-61844-4-fepMkS9qFK@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-61844-4@http.gcc.gnu.org/bugzilla/>
References: <bug-61844-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-07/txt/msg01863.txt.bz2
Content-length: 630

https://gcc.gnu.org/bugzilla/show_bug.cgi?ida844

--- Comment #11 from Oleg Endo <olegendo at gcc dot gnu.org> ---
(In reply to dhowells@redhat.com from comment #2)
> Created attachment 33144 [details]
> Old, no-longer functional patch to libgcc
>
> I was given the attached patch when I was on gcc-4.7 but it doesn't seem to
> help with gcc-4.9.  The problem occurs with or without the patch.

This patch doesn't have anything to do with the reload ICEs.

Do you happen to know where it came from and what problem it was supposed to
fix?  If it helps, it can be committed to trunk and the 4.9 and 4.8 branches,
too, I think.


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug target/61844] ICE when building libgcc for sh64 cross-compiler
  2014-07-18 14:05 [Bug c/61844] New: ICE when building libgcc for sh64 cross-compiler dhowells at redhat dot com
                   ` (8 preceding siblings ...)
  2014-07-28 21:57 ` olegendo at gcc dot gnu.org
@ 2014-07-29 21:31 ` olegendo at gcc dot gnu.org
  2014-07-31 16:06 ` dhowells at redhat dot com
                   ` (3 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: olegendo at gcc dot gnu.org @ 2014-07-29 21:31 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61844

Oleg Endo <olegendo at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-07-29
     Ever confirmed|0                           |1


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug target/61844] ICE when building libgcc for sh64 cross-compiler
  2014-07-18 14:05 [Bug c/61844] New: ICE when building libgcc for sh64 cross-compiler dhowells at redhat dot com
                   ` (9 preceding siblings ...)
  2014-07-29 21:31 ` olegendo at gcc dot gnu.org
@ 2014-07-31 16:06 ` dhowells at redhat dot com
  2014-07-31 16:28 ` olegendo at gcc dot gnu.org
                   ` (2 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: dhowells at redhat dot com @ 2014-07-31 16:06 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61844

--- Comment #12 from dhowells at redhat dot com <dhowells at redhat dot com> ---
(In reply to Oleg Endo from comment #10)
> Created attachment 33197 [details]
> a possible fix

It permits me to build a slew of sh64 libgccs, so it's looking good.


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug target/61844] ICE when building libgcc for sh64 cross-compiler
  2014-07-18 14:05 [Bug c/61844] New: ICE when building libgcc for sh64 cross-compiler dhowells at redhat dot com
                   ` (10 preceding siblings ...)
  2014-07-31 16:06 ` dhowells at redhat dot com
@ 2014-07-31 16:28 ` olegendo at gcc dot gnu.org
  2014-07-31 20:20 ` olegendo at gcc dot gnu.org
  2014-07-31 21:16 ` olegendo at gcc dot gnu.org
  13 siblings, 0 replies; 15+ messages in thread
From: olegendo at gcc dot gnu.org @ 2014-07-31 16:28 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61844

--- Comment #13 from Oleg Endo <olegendo at gcc dot gnu.org> ---
Author: olegendo
Date: Thu Jul 31 16:27:56 2014
New Revision: 213381

URL: https://gcc.gnu.org/viewcvs?rev=213381&root=gcc&view=rev
Log:
gcc/
    PR target/61844
    * config/sh/sh.c (sh_legitimate_address_p,
    sh_legitimize_reload_address): Handle reg+reg address modes when
    ALLOW_INDEXED_ADDRESS is false.
    * config/sh/predicates.md (general_movsrc_operand,
    general_movdst_operand): Likewise.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/sh/predicates.md
    trunk/gcc/config/sh/sh.c


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug target/61844] ICE when building libgcc for sh64 cross-compiler
  2014-07-18 14:05 [Bug c/61844] New: ICE when building libgcc for sh64 cross-compiler dhowells at redhat dot com
                   ` (11 preceding siblings ...)
  2014-07-31 16:28 ` olegendo at gcc dot gnu.org
@ 2014-07-31 20:20 ` olegendo at gcc dot gnu.org
  2014-07-31 21:16 ` olegendo at gcc dot gnu.org
  13 siblings, 0 replies; 15+ messages in thread
From: olegendo at gcc dot gnu.org @ 2014-07-31 20:20 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61844

--- Comment #14 from Oleg Endo <olegendo at gcc dot gnu.org> ---
Author: olegendo
Date: Thu Jul 31 20:19:43 2014
New Revision: 213384

URL: https://gcc.gnu.org/viewcvs?rev=213384&root=gcc&view=rev
Log:
gcc/
    Backport from mainline
    2014-07-31  Oleg Endo  <olegendo@gcc.gnu.org>

    PR target/61844
    * config/sh/sh.c (sh_legitimate_address_p,
    sh_legitimize_reload_address): Handle reg+reg address modes when
    ALLOW_INDEXED_ADDRESS is false.
    * config/sh/predicates.md (general_movsrc_operand,
    general_movdst_operand): Likewise.


Modified:
    branches/gcc-4_9-branch/gcc/ChangeLog
    branches/gcc-4_9-branch/gcc/config/sh/predicates.md
    branches/gcc-4_9-branch/gcc/config/sh/sh.c


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug target/61844] ICE when building libgcc for sh64 cross-compiler
  2014-07-18 14:05 [Bug c/61844] New: ICE when building libgcc for sh64 cross-compiler dhowells at redhat dot com
                   ` (12 preceding siblings ...)
  2014-07-31 20:20 ` olegendo at gcc dot gnu.org
@ 2014-07-31 21:16 ` olegendo at gcc dot gnu.org
  13 siblings, 0 replies; 15+ messages in thread
From: olegendo at gcc dot gnu.org @ 2014-07-31 21:16 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61844

Oleg Endo <olegendo at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #15 from Oleg Endo <olegendo at gcc dot gnu.org> ---
Fixed on trunk and 4.9.  4.8 doesn't seem to be affected.


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2014-07-31 21:16 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-18 14:05 [Bug c/61844] New: ICE when building libgcc for sh64 cross-compiler dhowells at redhat dot com
2014-07-18 14:22 ` [Bug c/61844] " dhowells at redhat dot com
2014-07-18 14:25 ` dhowells at redhat dot com
2014-07-18 14:28 ` dhowells at redhat dot com
2014-07-18 14:31 ` dhowells at redhat dot com
2014-07-27 20:33 ` [Bug rtl-optimization/61844] " olegendo at gcc dot gnu.org
2014-07-28  0:29 ` [Bug target/61844] " kkojima at gcc dot gnu.org
2014-07-28  1:11 ` kkojima at gcc dot gnu.org
2014-07-28  5:48 ` kkojima at gcc dot gnu.org
2014-07-28 21:57 ` olegendo at gcc dot gnu.org
2014-07-29 21:31 ` olegendo at gcc dot gnu.org
2014-07-31 16:06 ` dhowells at redhat dot com
2014-07-31 16:28 ` olegendo at gcc dot gnu.org
2014-07-31 20:20 ` olegendo at gcc dot gnu.org
2014-07-31 21:16 ` olegendo at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).