Subject: toolchain/34549: amd64->sh3 cross compiler exposes gcc problem
To: None <toolchain-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <he@NetBSD.org>
List: netbsd-bugs
Date: 09/18/2006 00:20:00
>Number:         34549
>Category:       toolchain
>Synopsis:       amd64->sh3 cross compiler exposes gcc problem
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    toolchain-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Sep 18 00:20:00 +0000 2006
>Originator:     Havard Eidnes
>Release:        NetBSD-current
>Organization:
>Environment:
System: 
Architecture: amd64
Machine: amd64
>Description:
	The build error log

  http://releng.netbsd.org/builds/HEAD/200609140000Z/mmeye.build.failed

	contains the following messages (interspersed with ld.so warnings):

  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

	This comes from the following constructs in the generated
	insn-emit.c file:

/* /u/build/HEAD/src/gnu/dist/gcc4/gcc/config/sh/sh.md:12273 */
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))));
}

/* /u/build/HEAD/src/gnu/dist/gcc4/gcc/config/sh/sh.md:12325 */
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)])));
}

	(cut+pasted from my local i386 build host)

	I've admittedly not reproduced this build problem myself,
	I do not yet have an amd64 host set up for builds.  However,
	the ld.so warnings in the log is an indication that this was
	run on an amd64 host, at least...

>How-To-Repeat:
	Try to build -current mmeye from an amd64 -current host.

>Fix:
	Sorry, don't know.