Bug 227339

Summary: clang crashes with error in backend: SSE2 register return with SSE2 disabled
Product: Base System Reporter: dev
Component: binAssignee: Dimitry Andric <dim>
Status: New ---    
Severity: Affects Many People CC: dim, toolchain
Priority: ---    
Version: 11.1-RELEASE   
Hardware: amd64   
OS: Any   
Attachments:
Description Flags
preprocessed file and invocation script none

Description dev 2018-04-07 11:10:55 UTC
Created attachment 192303 [details]
preprocessed file and invocation script

While trying to update the databases/arangodb33 port to the latest upstream version, this happens. Attached are the preprocessed source file and invocation script.
Comment 1 dev 2018-04-07 19:46:06 UTC
This is clang 4.0 in 11.1-RELEASE-p8.
Comment 2 Dimitry Andric freebsd_committer freebsd_triage 2018-04-08 10:27:33 UTC
This also reproduces with clang from head:

/usr/ports/databases/arangodb33/work/arangodb-3.3.6.1/3rdParty/curl/curl-7.50.3/lib/timeval.c:137:8: error: SSE2 register return with SSE2 disabled
double curlx_tvdiff_secs(struct timeval newer, struct timeval older)
       ^
1 error generated.

and I think the problem is that the command line options make it impossible to compile this source.  E.g. it compiles for amd64, but something passes:

-mno-sse2
-mno-sse3
-mno-ssse3
-mno-sse4.1
-mno-sse4.2
-mno-sse4a
-mno-avx
-mno-fma
-mno-bmi2
-mno-avx2
-mno-xop
-mno-fma4
-mno-avx512f
-mno-avx512vl
-mno-avx512pf
-mno-avx512er
-mno-avx512cd
-mno-avx512dq
-mno-avx512bw
-mno-avx512ifma
-mno-avx512vbmi

on the command line, making it impossible to work with doubles in the amd64 ABI.  You should try removing all the -mno-* options, and see if it compiles then.