Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#44442 - [clang] clang generating SSE2 instructions with `-march=i686`

Attached to Project: Arch Linux
Opened by Félix Faisant (xcodexif) - Friday, 03 April 2015, 06:53 GMT
Last edited by Evangelos Foutras (foutrelis) - Saturday, 04 April 2015, 08:56 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Evangelos Foutras (foutrelis)
Architecture i686
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

When compiling with the flags "-march=i686 -mtune=generic" (default flags in makepkg) or not, and then linking, clang produces SSE2 instructions, then the execution of the output produces a SIGILL. Disass in GDB :

0x08062fdf <+143>: mov %ecx,(%eax)
0x08062fe1 <+145>: call 0x8063250 <std::_Deque_base<optctx::ctxfncts_t, std::allocator<optctx::ctxfncts_t> >::_M_get_Tp_allocator()>
=> 0x08062fe6 <+150>: movsd -0x28(%ebp),%xmm0
0x08062feb <+155>: movsd -0x20(%ebp),%xmm1
0x08062ff0 <+160>: mov %esp,%ecx


Additional info:
* package version : I always seen this bug, and switching to GCC resolves the problem

This task depends upon

Closed by  Evangelos Foutras (foutrelis)
Saturday, 04 April 2015, 08:56 GMT
Reason for closing:  Works for me
Additional comments about closing:  Feel free to file a new bug with a minimal test case if the issue can be reliably reproduced.
Comment by Doug Newgard (Scimmia) - Friday, 03 April 2015, 13:30 GMT
Have you reported this upstream? I doubt this is a packaging problem.
Comment by Félix Faisant (xcodexif) - Friday, 03 April 2015, 17:57 GMT
No, but anyone could confirm this behavior ?
If it is confirmed, I'll report upstream.
Comment by Félix Faisant (xcodexif) - Friday, 03 April 2015, 19:30 GMT
Bug seems to be resolved with the last update of clang/llvm.
Comment by Evangelos Foutras (foutrelis) - Saturday, 04 April 2015, 07:54 GMT
clang defaults to pentium4 as the target CPU on 32-bit (which enables SSE2). After passing -march=i686, SSE2 appears to be disabled.

Which clang version were you using before the update? (The 3.6.0-4 release only fixed the shebangs in a couple of Python scripts, so it shouldn't have affected this issue.)

If you can still reproduce the issue, please provide a minimal test case. If it's not happening anymore, we can go ahead and close this task.
Comment by Félix Faisant (xcodexif) - Saturday, 04 April 2015, 08:52 GMT
In fact, I can't even provide a test case right now because the bug seems to be very intermittent and strange.
Sometimes SSE2 instructions appeared in one of my packages, and, when changing a single line of code (even without a link with the buggy part of the executable), it can disappear, without any apparent reason.
When I discovered the behavior (one year ago), I switched to gcc for all my packages, but one (which uses a clang-only feature). And two days ago, the bug finally appeared on this package too.
So maybe I opened this bug report too early.
I re-switched all my packages to clang, and if it reappears, I'll investigate more deeply and create a test case before opening a bug report.

NB: For linking, I don't use -march=i686. But I think it shouldn't affect anything.

Loading...