FS#19386 - [gcc] Possible bug regarding processor capabilities detection.

Attached to Project: Arch Linux
Opened by James (JRMoore) - Friday, 07 May 2010, 18:36 GMT
Last edited by Allan McRae (Allan) - Monday, 10 May 2010, 11:23 GMT
Task Type Support Request
Category Packages: Core
Status Closed
Assigned To Allan McRae (Allan)
Architecture i686
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Hello, I'm using the current version of the gcc package (4.5.0-1) in an Intel Core2 Duo T7300 @ 2.00GHz.

Running "gcc -Q -march=native --help=target" generates the following output: http://pastebin.com/hn1VS0Kw

I can see there that the architecture is detected correctly (core2 for march and mtune) but all SSE capabilities are disabled. As far as I know my processor supports up to SSSE3, so SSE, SSE2, SSE3 and SSSE3 at least should be enabled as well as MMX.

Am I missing something or might there be a problem with the binaries in the current package?
This task depends upon

Closed by  Allan McRae (Allan)
Monday, 10 May 2010, 11:23 GMT
Reason for closing:  Upstream
Additional comments about closing:  see comments
Comment by Andreas Radke (AndyRTR) - Saturday, 08 May 2010, 11:21 GMT
same here: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39851 - could this be related?

and http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43718 - so proabably the SSE settings are well applied but badly displayed with -Q --help-target.
Comment by Allan McRae (Allan) - Sunday, 09 May 2010, 13:03 GMT
Does "gcc -Q -march=core2 --help=target" do the right thing?
Comment by James (JRMoore) - Sunday, 09 May 2010, 13:51 GMT
No, it behaves similar to -march=native, the only differences are -mcx16 and -msahf (both appear disabled) and -mtune is not set to anything.

I've checked the binaries in Fedora as well, with the same results. Maybe it's related to the upstream bugs Andreas mentioned, is there any way to know if SSE instructions are being used anyway?
Comment by Allan McRae (Allan) - Monday, 10 May 2010, 07:19 GMT
Use something like:

gcc -march=native -S -fverbose-asm hello.c

and look in the header of the resulting hello.s file.
Comment by James (JRMoore) - Monday, 10 May 2010, 11:16 GMT
Thank you for everything, they're active and in use if the compiler finds it appropriate. Running the suggested line shows -msse, ... in the header; so the issue must be related to the upstream bugs mentioned.

Furthermore if compiling with -mfpmath=sse it does the appropriate, otherwise GCC would issue the following warning: "SSE instruction set disabled, using 387 arithmetics"
Comment by Allan McRae (Allan) - Monday, 10 May 2010, 11:22 GMT
OK, closing this as an upstream issue. Follow up with upstream to get this fixed.

Loading...