Subject: toolchain/22489: bogus warning/error during compilation of gnu/dist/gcc/gcc/function.c for sh3 target
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <uwe@netbsd.org>
List: netbsd-bugs
Date: 08/14/2003 22:35:44
>Number:         22489
>Category:       toolchain
>Synopsis:       bogus warning/error during compilation of gnu/dist/gcc/gcc/function.c for sh3 target
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    toolchain-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Aug 14 22:36:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Valeriy E. Ushakov
>Release:        1.6W
>Organization:
>Environment:
N/A
>Description:
While building hpcsh world with gcc3 (USE_TOOLS_TOOLCHAIN=no)
the build consistently fails:

/usr/nb3/tools/bin/shle--netbsdelf-gcc -pipe -O  -Werror     -I. -I/nb/src/gnu/usr.bin/gcc3/backend/../arch/sh3el -DIN_GCC -DHAVE_CONFIG_H -I/nb/src/gnu/dist/gcc/gcc -I/nb/src/gnu/dist/gcc/gcc/. -I/nb/src/gnu/dist/gcc/gcc/config -I/nb/src/gnu/dist/gcc/gcc/../include  -DTARGET_NAME=\"shle--netbsdelf\" -DLOCALEDIR=\"/usr/share/locale\" -DNETBSD_NATIVE  -nostdinc -isystem /usr/nb3/distrib/hpcsh/usr/include -c    /nb/src/gnu/dist/gcc/gcc/function.c -o function.o.tmp
/nb/src/gnu/dist/gcc/gcc/function.c: In function `assign_parms':
/nb/src/gnu/dist/gcc/gcc/function.c:4740: warning: `and' of mutually exclusive equal-tests is always 0
*** Error code 1

Stop.
nbmake: stopped in /nb/src/gnu/usr.bin/gcc3/backend

This happens when building on NetBSD/i386 (1.6T) and FreeBSD-4.8STABLE.

The offending line is:

    else if (PARM_BOUNDARY % BITS_PER_WORD != 0)
      abort ();

and in particular the TARGET_SHMEDIA macro that expands to

    (target_flags & 1) && !(target_flags & 0x100)

As this macro is used all over the place, this seems like a gcc bug.

I had the same problem with building hpcsh native gcc-3.3 with cross
gcc-3.3, though I only noticed it now, after I looked through my old
gcc-3.3 build logs.

I'm documenting this as a NetBSD PR because we will have to work
around it untill the fix for the gcc is available.
>How-To-Repeat:
Build sh3 world with USE_TOOLS_TOOLCHAIN=no.
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted: