Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug
Bug#: 24445
Product:  
Component:  
Status: RESOLVED
Resolution: FIXED
Assigned To: Not yet assigned to anyone <unassigned@gcc.gnu.org>
Host:
Reported against  
Priority:  
Severity:  
Target Milestone:  
 
 
Target:
Reporter: Robert P. J. Day <rpjday@mindspring.com>
Add CC:
CC:
Remove selected CCs
Build:
URL:
Summary:
Keywords:
Known to work:
Known to fail:

Attachment Description Type Created Size Actions
strtok.i.gz compressed strtok.i file from running the single offending sh4-unknown-linux-gnu-gcc command application/x-gzip 2005-10-19 19:09 5.49 KB Edit
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 24445 depends on: Show dependency tree
Show dependency graph
Bug 24445 blocks:

Additional Comments:






View Bug Activity   |   Format For Printing   |   Clone This Bug


Description:   Last confirmed: 2005-11-01 23:58 Opened: 2005-10-19 17:32
trying to build a cross-compile toolchain using "crosstool" with the following
properties:

BINUTILS_DIR=binutils-2.16.1
GCC_DIR=gcc-4.1-20051015
GLIBC_DIR=glibc-2.3.5
LINUX_SANITIZED_HEADER_DIR=linux-libc-headers-2.6.12.0
GLIBCTHREADS_FILENAME=glibc-linuxthreads-2.3.5

TARGET=sh4-unknown-linux-gnu
TARGET_CFLAGS="-O -m4 -ml"
GLIBC_CONFIGPARMS="no-z-defs=yes"
GLIBC_EXTRA_CONFIG="--without-fp"
USE_SYSROOT=1

  eventually, trying to compile glibc-2.3.5:

sh4-unknown-linux-gnu-gcc  ../sysdeps/generic/strtok.c -c -std=gnu99 -O -Wall
-Winline -Wstrict-prototypes -Wwrite-strings -m4 -ml   -fPIC    -I../include
-I.
-I/home/rpjday/ct/crosstool-0.38.new/build/sh4-unknown-linux-gnu/gcc-4.1-20051015-glibc-2.3.5/build-glibc/string
-I.. -I../libio 
-I/home/rpjday/ct/crosstool-0.38.new/build/sh4-unknown-linux-gnu/gcc-4.1-20051015-glibc-2.3.5/build-glibc
-I../sysdeps/sh/elf -I../linuxthreads/sysdeps/unix/sysv/linux/sh
-I../linuxthreads/sysdeps/unix/sysv/linux -I../linuxthreads/sysdeps/pthread
-I../sysdeps/pthread -I../linuxthreads/sysdeps/unix/sysv
-I../linuxthreads/sysdeps/unix -I../linuxthreads/sysdeps/sh
-I../sysdeps/unix/sysv/linux/sh/sh4 -I../sysdeps/unix/sysv/linux/sh
-I../sysdeps/unix/sysv/linux -I../sysdeps/gnu -I../sysdeps/unix/common
-I../sysdeps/unix/mman -I../sysdeps/unix/inet -I../sysdeps/unix/sysv
-I../sysdeps/unix/sh -I../sysdeps/unix -I../sysdeps/posix -I../sysdeps/sh/sh4
-I../sysdeps/sh -I../sysdeps/wordsize-32 -I../sysdeps/ieee754/flt-32
-I../sysdeps/ieee754/dbl-64 -I../sysdeps/ieee754 -I../sysdeps/generic/elf
-I../sysdeps/generic -nostdinc -isystem
/home/rpjday/ct/crosstool-0.38.new/build/sh4-unknown-linux-gnu/gcc-4.1-20051015-glibc-2.3.5/gcc-core-prefix/lib/gcc/sh4-unknown-linux-gnu/4.1.0/include
-isystem /home/rpjday/ct/sh4/sh4-unknown-linux-gnu/sys-root/usr/include
-D_LIBC_REENTRANT -include ../include/libc-symbols.h  -DPIC -DSHARED     -o
/home/rpjday/ct/crosstool-0.38.new/build/sh4-unknown-linux-gnu/gcc-4.1-20051015-glibc-2.3.5/build-glibc/string/strtok.os
-MD -MP -MF
/home/rpjday/ct/crosstool-0.38.new/build/sh4-unknown-linux-gnu/gcc-4.1-20051015-glibc-2.3.5/build-glibc/string/strtok.os.dt
-MT
/home/rpjday/ct/crosstool-0.38.new/build/sh4-unknown-linux-gnu/gcc-4.1-20051015-glibc-2.3.5/build-glibc/string/strtok.os
../sysdeps/generic/strtok.c: In function 'strtok':
../sysdeps/generic/strtok.c:66: error: unable to find a register to spill in
class 'R0_REGS'
../sysdeps/generic/strtok.c:66: error: this is the insn:
(insn 68 112 69 5 (set (mem/c/i:SI (plus:SI (reg:SI 12 r12)
                (reg/f:SI 1 r1 [177])) [0 olds+0 S4 A32])
        (reg:SI 0 r0)) 172 {movsi_ie} (insn_list:REG_DEP_TRUE 62
(insn_list:REG_DEP_TRUE 67 (nil)))
    (expr_list:REG_DEAD (reg:SI 0 r0)
        (expr_list:REG_DEAD (reg/f:SI 1 r1 [177])
            (nil))))
../sysdeps/generic/strtok.c:66: internal compiler error: in spill_failure, at
reload1.c:1890
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
make[2]: ***
[/home/rpjday/ct/crosstool-0.38.new/build/sh4-unknown-linux-gnu/gcc-4.1-20051015-glibc-2.3.5/build-glibc/string/strtok.os]
Error 1
make[2]: Leaving directory
`/home/rpjday/ct/crosstool-0.38.new/build/sh4-unknown-linux-gnu/gcc-4.1-20051015-glibc-2.3.5/glibc-2.3.5/string'
make[1]: *** [string/subdir_lib] Error 2
make[1]: Leaving directory
`/home/rpjday/ct/crosstool-0.38.new/build/sh4-unknown-linux-gnu/gcc-4.1-20051015-glibc-2.3.5/glibc-2.3.5'
make: *** [lib] Error 2

------- Comment #1 From Andrew Pinski 2005-10-19 19:07 -------
I think a work around for this problem was committed on the 17th which is after
the snapshot was done, Can you confirm that?

If you do, please mark this as a dup of bug 22553.

Thanks,
Andrew Pinski

------- Comment #2 From Robert P. J. Day 2005-10-19 19:09 -------
Created an attachment (id=10026) [edit]
compressed strtok.i file from running the single offending
sh4-unknown-linux-gnu-gcc command

------- Comment #3 From Robert P. J. Day 2005-10-19 19:54 -------
Using a CVS pull as of today didn't seem to solve the problem.

------- Comment #4 From Kazumoto Kojima 2005-10-20 12:11 -------
Here is a reduced testcase:

extern int bar (void) __attribute__ ((__pure__));
extern char *baz;
void foo (void)
{
  baz = (char *) bar ();
}

------- Comment #5 From Alexander Sieb 2005-10-20 12:14 -------
(In reply to comment #1)
> I think a work around for this problem was committed on the 17th which is after
> the snapshot was done, Can you confirm that?
>

I just tried cvs head (as of 2005-10-20 12:10 GMT). Same problem,
unfortunately.

Regards,
  Alexander

------- Comment #6 From Robert P. J. Day 2005-10-20 12:45 -------
(In reply to comment #4)
> Here is a reduced testcase:
> 
> extern int bar (void) __attribute__ ((__pure__));
> extern char *baz;
> void foo (void)
> {
>   baz = (char *) bar ();
> }
> 

OK, given the reduced test case that shows the problem, I assume there's no
need to provide any further details from the crosstool output then?

------- Comment #7 From Robert P. J. Day 2005-10-21 14:15 -------
  In case anyone is interested, this error appeared between gcc-4.1 snapshots
20050917 and 20050924.  gcc-4.1-20050917 built a toolchain without incident.

------- Comment #8 From Robert P. J. Day 2005-10-22 21:36 -------
Just now tested with new snapshot gcc-4.1-20051022, same result.

------- Comment #9 From Robert P. J. Day 2005-10-30 09:56 -------
The latest snapshot of gcc-4.1-20051029 still produces the same error at the
same location.  Was there a workaround posted somewhere, or is this still an
unresolved issue?

------- Comment #10 From Kazumoto Kojima 2005-11-01 23:55 -------
With binary search, I've found that the failure started after the patch:

2005-09-18  Jan Hubicka  <jh@suse.cz>

        * calls.c (flags_from_decl_or_type): Do not set ECF_LIBCALL_BLOCK.

http://gcc.gnu.org/viewcvs/trunk/gcc/calls.c?r1=103656&r2=104405

------- Comment #11 From Andrew Pinski 2005-11-01 23:58 -------
(In reply to comment #10)
> With binary search, I've found that the failure started after the patch:

That would mean it was a latent bug.

Confirmed.

------- Comment #12 From Mark Mitchell 2005-11-03 06:39 -------
Downgrading to P5; SH is not a primary or secondary target.

------- Comment #13 From Kazumoto Kojima 2005-11-11 02:12 -------
Subject: Bug 24445

Author: kkojima
Date: Fri Nov 11 02:12:42 2005
New Revision: 106774

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=106774
Log:
        PR target/24445
        * calls.c (expand_call): Copy a return value to a plain register
        if needed.

        * gcc.dg/pr24445.c: New test.


Added:
    trunk/gcc/testsuite/gcc.dg/pr24445.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/calls.c
    trunk/gcc/testsuite/ChangeLog

------- Comment #14 From Andrew Pinski 2005-11-11 17:43 -------
Fixed.

Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug