[Bug target/59691] cilk-plus run failures on non-sse processors

2014-02-10 Thread law at redhat dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59691

Jeffrey A. Law  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #11 from Jeffrey A. Law  ---
Fixed on trunk.


[Bug target/59691] cilk-plus run failures on non-sse processors

2014-02-10 Thread bviyer at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59691

--- Comment #10 from bviyer at gcc dot gnu.org ---
Author: bviyer
Date: Mon Feb 10 16:56:54 2014
New Revision: 207664

URL: http://gcc.gnu.org/viewcvs?rev=207664&root=gcc&view=rev
Log:
Fix for PR target/59691.
+2014-02-10  Balaji V. Iyer  
+
+   PR target/59691
+   * runtime/config/x86/os-unix-sysdep.c (__builtin_cpu_supports): New
+   function.
+   (restore_x86_fp_state): Added a check if the cpu supports the
+   instruction before emitting it.
+   (sysdep_save_fp_ctrl_state): Likewise.
+


Modified:
trunk/libcilkrts/ChangeLog
trunk/libcilkrts/runtime/config/x86/os-unix-sysdep.c


[Bug target/59691] cilk-plus run failures on non-sse processors

2014-01-25 Thread bviyer at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59691

--- Comment #9 from Balaji V. Iyer  ---
Hi Bernd and H. J.,
The catch_exc.cc bug is a different issue. It is failing in most 32 bit
machines and we are currently looking into it.

Thanks,

Balaji V. Iyer.


[Bug target/59691] cilk-plus run failures on non-sse processors

2014-01-25 Thread hjl.tools at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59691

--- Comment #8 from H.J. Lu  ---
(In reply to Balaji V. Iyer from comment #5)
> Created attachment 31938 [details]
> Possible Fix.
> 
> Possible fix.

You can replace cpu_supports_sse with __builtin_cpu_supports
since __builtin_cpu_supports("sse") is compiled into:

movl__cpu_model+12(%rip), %eax

by GCC.


[Bug target/59691] cilk-plus run failures on non-sse processors

2014-01-25 Thread bernd.edlinger at hotmail dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59691

--- Comment #7 from Bernd Edlinger  ---
(In reply to Balaji V. Iyer from comment #6)
> Hi Jeff, Andrew and Bernd,
>Can you please try out the "possible fix" and
> see if that works for you?
>
> Thanks,
> 
> Balaji V. Iyer.

Hi the patch works,

but there is still one test case failing:

spawn /home/ed/gnu/gcc-build/gcc/testsuite/g++/../../xg++
-B/home/ed/gnu/gcc-build/gcc/testsuite/g++/../../
/home/ed/gnu/gcc-4.9-trunk/gcc/testsuite/g++.dg/cilk-plus/CK/catch_exc.cc
-fno-diagnostics-show-caret -fdiagnostics-color=never -nostdinc++
-I/home/ed/gnu/gcc-build/i686-pc-linux-gnu/libstdc++-v3/include/i686-pc-linux-gnu
-I/home/ed/gnu/gcc-build/i686-pc-linux-gnu/libstdc++-v3/include
-I/home/ed/gnu/gcc-4.9-trunk/libstdc++-v3/libsupc++
-I/home/ed/gnu/gcc-4.9-trunk/libstdc++-v3/include/backward
-I/home/ed/gnu/gcc-4.9-trunk/libstdc++-v3/testsuite/util -fmessage-length=0 -O1
-fcilkplus -fcilkplus -lcilkrts
-L/home/ed/gnu/gcc-build/i686-pc-linux-gnu/./libstdc++-v3/src/.libs
-B/home/ed/gnu/gcc-build/i686-pc-linux-gnu/./libstdc++-v3/src/.libs
-L/home/ed/gnu/gcc-build/i686-pc-linux-gnu/./libstdc++-v3/src/.libs
-L/home/ed/gnu/gcc-build/i686-pc-linux-gnu/./libcilkrts/.libs -lm -o
./catch_exc.exe^M
PASS: g++.dg/cilk-plus/CK/catch_exc.cc  -O1 -fcilkplus (test for excess errors)
Setting LD_LIBRARY_PATH to
.:/home/ed/gnu/gcc-build/i686-pc-linux-gnu/./libstdc++-v3/src/.libs:/home/ed/gnu/gcc-build/i686-pc-linux-gnu/./libstdc++-v3/src/.libs:/home/ed/gnu/gcc-build/gcc:/home/ed/gnu/gcc-build/i686-pc-linux-gnu/./libcilkrts/.libs:.:/home/ed/gnu/gcc-build/i686-pc-linux-gnu/./libstdc++-v3/src/.libs:/home/ed/gnu/gcc-build/i686-pc-linux-gnu/./libstdc++-v3/src/.libs:/home/ed/gnu/gcc-build/gcc:/home/ed/gnu/gcc-build/i686-pc-linux-gnu/./libcilkrts/.libs:/home/ed/gnu/gcc-build/./gmp/.libs:/home/ed/gnu/gcc-build/./prev-gmp/.libs:/home/ed/gnu/gcc-build/./mpfr/.libs:/home/ed/gnu/gcc-build/./prev-mpfr/.libs:/home/ed/gnu/gcc-build/./mpc/.libs:/home/ed/gnu/gcc-build/./prev-mpc/.libs
spawn [open ...]^M
terminate called after throwing an instance of 'int'
FAIL: g++.dg/cilk-plus/CK/catch_exc.cc  -O1 -fcilkplus execution test


[Bug target/59691] cilk-plus run failures on non-sse processors

2014-01-23 Thread bviyer at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59691

--- Comment #6 from Balaji V. Iyer  ---
Hi Jeff, Andrew and Bernd,
Can you please try out the "possible fix" and see if that works for you?

Thanks,

Balaji V. Iyer.


[Bug target/59691] cilk-plus run failures on non-sse processors

2014-01-23 Thread bviyer at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59691

--- Comment #5 from Balaji V. Iyer  ---
Created attachment 31938
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31938&action=edit
Possible Fix.

Possible fix.


[Bug target/59691] cilk-plus run failures on non-sse processors

2014-01-22 Thread law at redhat dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59691

--- Comment #4 from Jeffrey A. Law  ---
On 01/22/14 10:45, pinskia at gcc dot gnu.org wrote:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59691
>
> --- Comment #3 from Andrew Pinski  ---
> (In reply to Balaji V. Iyer from comment #2)
>> Hello Bernd,
>>  I don't have a pentium 2 machine readily available. Can you try this
>> patch and see if it works for you?
>
> This is not correct, there should be a runtime check rather than a compile 
> time
> one.
Also note that you can usually change the underlying processor in VM 
environments.  That's obviously useful for testing this kind of thing. 
VMs are, umm, goodness.

jeff


[Bug target/59691] cilk-plus run failures on non-sse processors

2014-01-22 Thread pinskia at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59691

--- Comment #3 from Andrew Pinski  ---
(In reply to Balaji V. Iyer from comment #2)
> Hello Bernd,
> I don't have a pentium 2 machine readily available. Can you try this
> patch and see if it works for you?

This is not correct, there should be a runtime check rather than a compile time
one.

> 
> Thanks,
> 
> Balaji V. Iyer.
> 
> diff --git a/libcilkrts/runtime/config/x86/os-unix-sysdep.c
> b/libcilkrts/runtime
> /config/x86/os-unix-sysdep.c
> index 881bc3f..8d5642c 100644
> --- a/libcilkrts/runtime/config/x86/os-unix-sysdep.c
> +++ b/libcilkrts/runtime/config/x86/os-unix-sysdep.c
> @@ -47,7 +47,7 @@
>  // save the FP state (rounding mode and the like) before calling setjmp.  We
>  // will need to restore that state when we resume.
>  #ifndef __MIC__
> -# if defined(__i386__) || defined(__x86_64)
> +# if (defined(__i386__) || defined(__x86_64)) && defined (__SSE__)
>  #   define RESTORE_X86_FP_STATE
>  # endif // defined(__i386__) || defined(__x86_64)
>  #endif  // __MIC__


[Bug target/59691] cilk-plus run failures on non-sse processors

2014-01-22 Thread bviyer at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59691

--- Comment #2 from Balaji V. Iyer  ---
Hello Bernd,
I don't have a pentium 2 machine readily available. Can you try this patch
and see if it works for you?

Thanks,

Balaji V. Iyer.

diff --git a/libcilkrts/runtime/config/x86/os-unix-sysdep.c
b/libcilkrts/runtime
/config/x86/os-unix-sysdep.c
index 881bc3f..8d5642c 100644
--- a/libcilkrts/runtime/config/x86/os-unix-sysdep.c
+++ b/libcilkrts/runtime/config/x86/os-unix-sysdep.c
@@ -47,7 +47,7 @@
 // save the FP state (rounding mode and the like) before calling setjmp.  We
 // will need to restore that state when we resume.
 #ifndef __MIC__
-# if defined(__i386__) || defined(__x86_64)
+# if (defined(__i386__) || defined(__x86_64)) && defined (__SSE__)
 #   define RESTORE_X86_FP_STATE
 # endif // defined(__i386__) || defined(__x86_64)
 #endif  // __MIC__


[Bug target/59691] cilk-plus run failures on non-sse processors

2014-01-05 Thread pinskia at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59691

Andrew Pinski  changed:

   What|Removed |Added

 Target||i?86-*-*
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2014-01-06
  Component|other   |target
   Target Milestone|--- |4.9.0
Summary|cilk-plus failure on|cilk-plus run failures on
   |PENTIUM2|non-sse processors
 Ever confirmed|0   |1

--- Comment #1 from Andrew Pinski  ---
This is an SSE only instruction.  The code unconditionally uses this
instruction.

Confirmed.

__asm__ ("stmxcsr %0" : "=m" (sf->mxcsr));