Bug 213434 - vfwscanf compilation fails when CPUTYPE?=skylake
Summary: vfwscanf compilation fails when CPUTYPE?=skylake
Status: Closed Overcome By Events
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 11.0-STABLE
Hardware: amd64 Any
: --- Affects Some People
Assignee: Bugmeister
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-13 07:45 UTC by mario.g.pavlov
Modified: 2023-12-31 03:05 UTC (History)
0 users

See Also:


Attachments
Preprocessed source and associated run script. (56.98 KB, application/x-xz)
2016-10-13 07:45 UTC, mario.g.pavlov
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description mario.g.pavlov 2016-10-13 07:45:17 UTC
Created attachment 175688 [details]
Preprocessed source and associated run script.

I installed FreeBSD 11 RELEASE amd64 on my skylake machine, checked out stable/11 and tried to buildworld.


===========================================================================
# cat /etc/make.conf
CPUTYPE?=skylake

# for both C and C++
CFLAGS= -O2 -pipe

# kernel building flags
COPTFLAGS= -O -pipe

KERNCONF=STABLE11
===========================================================================


===========================================================================
# svnlite info
Path: .
Working Copy Root Path: /usr/src
URL: https://svn.freebsd.org/base/stable/11
Relative URL: ^/stable/11
Repository Root: https://svn.freebsd.org/base
Repository UUID: ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Revision: 307180
Node Kind: directory
Schedule: normal
Last Changed Author: lidl
Last Changed Rev: 307173
Last Changed Date: 2016-10-13 06:10:04 +0300 (Thu, 13 Oct 2016)
===========================================================================


And I got this:


===========================================================================
cc   -O2 -pipe -march=skylake  -I/usr/src/lib/libc/include -I/usr/src/lib/libc/../../include -I/usr/src/lib/libc/amd64 -DNLS  -D__DBINTERFACE_PRIVATE -I/usr/src/lib/libc/../../contrib/gdtoa -I/usr/src/lib/libc/../../contrib/libc-vis -DINET6 -I/usr/obj/usr/src/lib/libc -I/usr/src/lib/libc/resolv -D_ACL_PRIVATE -DPOSIX_MISTAKE -I/usr/src/lib/libc/../libmd -I/usr/src/lib/libc/../../contrib/jemalloc/include -I/usr/src/lib/libc/../../contrib/tzcode/stdtime -I/usr/src/lib/libc/stdtime -I/usr/src/lib/libc/locale -DBROKEN_DES -DPORTMAP -DDES_BUILTIN -I/usr/src/lib/libc/rpc -DYP -DNS_CACHING -DSYMBOL_VERSIONING -MD  -MF.depend.vfwscanf.o -MTvfwscanf.o -std=gnu99 -fstack-protector-strong -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion -Wno-unused-local-typedef -Wno-switch -Wno-switch-enum -Wno-knr-promoted-parameter  -Qunused-arguments  -I/usr/src/lib/libutil -I/usr/src/lib/msun/amd64 -I/usr/src/lib/msun/x86 -I/usr/src/lib/msun/src -c /usr/src/lib/libc/stdio/vfwscanf.c -o vfwscanf.o
fatal error: error in backend: Cannot select: 0x80343ce40: i32 = X86ISD::CMP 0x8031d4ab0, 0x80343e130
  0x8031d4ab0: i1 = truncate 0x8031d45f0
    0x8031d45f0: i8 = and 0x80305f4c0, 0x80343eab0
      0x80305f4c0: i8 = X86ISD::SETCC Constant:i8<4>, 0x8033da850
        0x8031d4be0: i8 = Constant<4>
        0x8033da850: i32 = X86ISD::CMP 0x8033d95f0, Constant:i8<0>
          0x8033d95f0: i8 = AssertZext 0x8031d4720, ValueType:ch:i1
            0x8031d4720: i8,ch = CopyFromReg 0x802e3f430, Register:i8 %vreg375
              0x80343e850: i8 = Register %vreg375
          0x8033da4c0: i8 = Constant<0>
      0x80343eab0: i8 = X86ISD::SETCC Constant:i8<4>, 0x80343ed10:1
        0x8031d4be0: i8 = Constant<4>
        0x80343ed10: i32,i32 = X86ISD::SUB 0x80305f980, Constant:i32<101>
          0x80305f980: i32,ch = CopyFromReg 0x802e3f430, Register:i32 %vreg378
            0x80305f5f0: i32 = Register %vreg378
          0x8033d9e40: i32 = Constant<101>
  0x80343e130: i1 = truncate 0x80343c130
    0x80343c130: i8 = or 0x80305f4c0, 0x8033beab0
      0x80305f4c0: i8 = X86ISD::SETCC Constant:i8<4>, 0x8033da850
        0x8031d4be0: i8 = Constant<4>
        0x8033da850: i32 = X86ISD::CMP 0x8033d95f0, Constant:i8<0>
          0x8033d95f0: i8 = AssertZext 0x8031d4720, ValueType:ch:i1
            0x8031d4720: i8,ch = CopyFromReg 0x802e3f430, Register:i8 %vreg375
              0x80343e850: i8 = Register %vreg375
          0x8033da4c0: i8 = Constant<0>
      0x8033beab0: i8 = X86ISD::SETCC Constant:i8<9>, 0x80343c720:1
        0x80343e260: i8 = Constant<9>
        0x80343c720: i32,i32 = X86ISD::SUB 0x80305f980, Constant:i32<112>
          0x80305f980: i32,ch = CopyFromReg 0x802e3f430, Register:i32 %vreg378
            0x80305f5f0: i32 = Register %vreg378
          0x8033be5f0: i32 = Constant<112>
In function: __vfwscanf
cc: error: clang frontend command failed with exit code 70 (use -v to see invocation)
FreeBSD clang version 3.8.0 (tags/RELEASE_380/final 262564) (based on LLVM 3.8.0)
Target: x86_64-unknown-freebsd11.0
Thread model: posix
InstalledDir: /usr/obj/usr/src/tmp/usr/bin
cc: note: diagnostic msg: PLEASE submit a bug report to https://bugs.freebsd.org/submit/ and include the crash backtrace, preprocessed source, and associated run script.
cc: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
cc: note: diagnostic msg: /tmp/vfwscanf-f37857.c
cc: note: diagnostic msg: /tmp/vfwscanf-f37857.sh
cc: note: diagnostic msg:

********************
*** Error code 70

Stop.
make[4]: stopped in /usr/src/lib/libc
*** Error code 1

Stop.
make[3]: stopped in /usr/src
*** Error code 1

Stop.
make[2]: stopped in /usr/src
*** Error code 1

Stop.
make[1]: stopped in /usr/src
*** Error code 1

Stop.
make: stopped in /usr/src
===========================================================================

Please find attached the preprocessed source file and associated run script.
Comment 1 mario.g.pavlov 2016-10-15 10:53:45 UTC
After some investigation it turns out this failure is caused by
CPUTYPE?=skylake

When I removed it from make.conf buildworld completed successfully.
I specifically waited for LLVM 3.6 or later to use the skylake target, see http://llvm.org/viewvc/llvm-project/cfe/branches/release_36/lib/Basic/Targets.cpp?view=markup

Is this a problem with base or LLVM?
What's the next best CPUTYPE value for i7-6700?
Comment 2 Mark Linimon freebsd_committer freebsd_triage 2023-12-31 03:05:54 UTC
^Triage: close as OBE.

I'm sorry that this PR never got looked at, but by now, 11.X is long out of support.