This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug bootstrap/32497] New: Crosscomiling native sh3 gcc on a 64-bit host fails
- From: "uwe at netbsd dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 Jun 2007 14:33:53 -0000
- Subject: [Bug bootstrap/32497] New: Crosscomiling native sh3 gcc on a 64-bit host fails
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
NetBSD autobuild cluster is a mixture of i386 and amd64 machines, and
when sh3 builds hit an amd64 build host the build fails when
cross-compiling native /usr/bin/gcc for sh3 target.
/usr/nb/tools/bin/shle--netbsdelf-gcc ... -c insn-emit.c
insn-emit.c: In function 'gen_mshfhi_l_di':
insn-emit.c:5476: warning: integer constant is too large for 'long' type
insn-emit.c: In function 'gen_mshflo_l_di':
insn-emit.c:5493: warning: this decimal constant is unsigned only in ISO C90
--- insn-emit.o ---
*** [insn-emit.o] Error code 1
1 error
nbmake: stopped in /home/builds/ab/HEAD/src/gnu/usr.bin/gcc4/backend
My i386 build (this one is ok) has:
/* /usr/src/gnu/dist/gcc4/gcc/config/sh/sh.md:12291 */
rtx
gen_mshfhi_l_di (rtx operand0 ATTRIBUTE_UNUSED,
rtx operand1 ATTRIBUTE_UNUSED,
rtx operand2 ATTRIBUTE_UNUSED)
{
return gen_rtx_SET (VOIDmode,
operand0,
gen_rtx_IOR (DImode,
gen_rtx_LSHIFTRT (DImode,
operand1,
const_int_rtx[MAX_SAVED_CONST_INT + (32)]),
gen_rtx_AND (DImode,
operand2,
GEN_INT (-4294967296LL))));
}
/* /usr/src/gnu/dist/gcc4/gcc/config/sh/sh.md:12343 */
rtx
gen_mshflo_l_di (rtx operand0 ATTRIBUTE_UNUSED,
rtx operand1 ATTRIBUTE_UNUSED,
rtx operand2 ATTRIBUTE_UNUSED)
{
return gen_rtx_SET (VOIDmode,
operand0,
gen_rtx_IOR (DImode,
gen_rtx_AND (DImode,
operand1,
GEN_INT (4294967295LL)),
gen_rtx_ASHIFT (DImode,
operand2,
const_int_rtx[MAX_SAVED_CONST_INT + (32)])));
}
I don't have any 64-bit machine handy, but a friend sent me
insn-emit.c (failing like above) from his 64-bit machine and it has
4294967295 and -4294967296 in the above marked as long (L),
not long long (LL). And as that insn-emit.c is compiled with
shle--netbsdelf-gcc it is not happy about those constants.
While this issue was discussed on NetBSD mailing lists
the following comment was made by Izumi Tsutsui:
| The statements in insn-emit.c are generated by
| the following line:
| > printf (HOST_WIDE_INT_PRINT_DEC_C, INTVAL (x));
| in src/gnu/dist/gcc4/gcc/genemit.c, and HOST_WIDE_INT_PRINT_DEC_C
| is defined in src/gnu/dist/gcc4/gcc/hwint.h.
[...]
| Sources for the "build" machine should include "bconfig.h"
| then HOST_foo macros will represent build's sizes.
| Sources for the "host" machine should include "config.h"
| then HOST_foo macros will represent host's sizes.
|
| But in genemit.c case, it's a source for the build so
| it includes "bconfig.h" then HOST_foo macros represent
| build's size, but HOST_WIDE_INT_PRINT_DEC_C is used
| in printf(3) to create insn-emit.c which is a source
| of the host machine.
| Then a build's type (long) is used in a host's source
| where it should be a host's type (long long).
|
| Is there any way to refer host's sizes ("LL" suffix
| for 64bit integers in this case) in build's sources?
--
Summary: Crosscomiling native sh3 gcc on a 64-bit host fails
Product: gcc
Version: 4.1.3
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: bootstrap
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: uwe at netbsd dot org
GCC build triplet: x86_64--netbsd
GCC host triplet: shle--netbsdelf
GCC target triplet: shle--netbsdelf
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32497