Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 05 Jan 2017 03:02:58 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-toolchain@FreeBSD.org
Subject:   [Bug 215681] head -r310854: TARGET_ARCH=powerpc buildkernel via clang 3.9.1: sys/powerpc/aim/trap_subr32.S:409:2: error: too few operands for instruction
Message-ID:  <bug-215681-29464-t5swS9od2n@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-215681-29464@https.bugs.freebsd.org/bugzilla/>
References:  <bug-215681-29464@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D215681

--- Comment #2 from Mark Millard <markmi@dsl-only.net> ---
(In reply to Mark Millard from comment #1)

[Possibly to be treated as a kernel source code issue
instead of a toolchain issue! Reassign?]

It turns out that only one "normal" ppc instruction had such a
syntactic rejection by llvm. So this is not a general syntax
mismatch for clang 3.9.1 .

I'd guess that the below means that the kernel source
will be updated to avoid the problem. I've no clue if
FreeBSD would request llvm to allow the assembler
syntax that was rejected as well.

clang 3.9.1 is not allowing the optional crD to be optional
in the instruction format:

cmp [crD,]L,rA,rB

The following:

# svnlite diff /usr/src/sys/powerpc/aim/trap_subr32.S
Index: /usr/src/sys/powerpc/aim/trap_subr32.S
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- /usr/src/sys/powerpc/aim/trap_subr32.S      (revision 311147)
+++ /usr/src/sys/powerpc/aim/trap_subr32.S      (working copy)
@@ -406,7 +406,7 @@
        mtctr %r1                       /* load counter */
 im1:
        lwzu %r1, 8(%r2)                /* get next pte */
-       cmp 0, %r1, %r3                 /* see if found pte */
+       cmp 0, 0, %r1, %r3              /* see if found pte */
        bdnzf 2, im1                    /* dec count br if cmp ne and if
                                         * count not zero */
        bne instr_sec_hash              /* if not found set up second hash

allows buildkernel to finish if WEEROR=3D is used.
(The above filled in the default value explicltly.)

The other code in trap_subr32.S has a couple of cmp
instructions and they have the extra "0," already:

. . .
dm1:
        lwzu %r1, 8(%r2)                /* get next pte */
        cmp 0, 0, %r1, %r3              /* see if found pte */
        bdnzf 2, dm1                    /* dec count br if cmp ne and if
                                         * count not zero */
. . .
ds1:
        lwzu %r1, 8(%r2)                /* get next pte */
        cmp 0, 0, %r1, %r3              /* see if found pte */
        bdnzf 2, ds1                    /* dec count br if cmp ne and if
                                         * count not zero */

So it appears that having the "extra" 0, is normal
for the powerpc kernel sources.


Extra information:

The next error that buildkernel stopped at without WERROR=3D
being in use was:

--- adb_mouse.o ---
/usr/src/sys/dev/adb/adb_mouse.c:523:21: error: implicit conversion from 'i=
nt'
to 'int8_t' (aka 'signed char') changes value from 128 to -128
[-Werror,-Wconstant-conversion]
                sc->packet[0] =3D 1 << 7;
                              ~ ~~^~~~

1 error generated.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-215681-29464-t5swS9od2n>