* [Bug target/59691] cilk-plus run failures on non-sse processors
2014-01-05 23:25 [Bug other/59691] New: cilk-plus failure on PENTIUM2 bernd.edlinger at hotmail dot de
@ 2014-01-06 0:06 ` pinskia at gcc dot gnu.org
2014-01-22 17:37 ` bviyer at gmail dot com
` (9 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2014-01-06 0:06 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59691
Andrew Pinski <pinskia at gcc dot gnu.org> 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 <pinskia at gcc dot gnu.org> ---
This is an SSE only instruction. The code unconditionally uses this
instruction.
Confirmed.
__asm__ ("stmxcsr %0" : "=m" (sf->mxcsr));
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug target/59691] cilk-plus run failures on non-sse processors
2014-01-05 23:25 [Bug other/59691] New: cilk-plus failure on PENTIUM2 bernd.edlinger at hotmail dot de
2014-01-06 0:06 ` [Bug target/59691] cilk-plus run failures on non-sse processors pinskia at gcc dot gnu.org
@ 2014-01-22 17:37 ` bviyer at gmail dot com
2014-01-22 17:45 ` pinskia at gcc dot gnu.org
` (8 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: bviyer at gmail dot com @ 2014-01-22 17:37 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59691
--- Comment #2 from Balaji V. Iyer <bviyer at gmail dot com> ---
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__
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug target/59691] cilk-plus run failures on non-sse processors
2014-01-05 23:25 [Bug other/59691] New: cilk-plus failure on PENTIUM2 bernd.edlinger at hotmail dot de
2014-01-06 0:06 ` [Bug target/59691] cilk-plus run failures on non-sse processors pinskia at gcc dot gnu.org
2014-01-22 17:37 ` bviyer at gmail dot com
@ 2014-01-22 17:45 ` pinskia at gcc dot gnu.org
2014-01-22 17:53 ` law at redhat dot com
` (7 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2014-01-22 17:45 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59691
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(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__
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug target/59691] cilk-plus run failures on non-sse processors
2014-01-05 23:25 [Bug other/59691] New: cilk-plus failure on PENTIUM2 bernd.edlinger at hotmail dot de
` (2 preceding siblings ...)
2014-01-22 17:45 ` pinskia at gcc dot gnu.org
@ 2014-01-22 17:53 ` law at redhat dot com
2014-01-23 18:06 ` bviyer at gmail dot com
` (6 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: law at redhat dot com @ 2014-01-22 17:53 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59691
--- Comment #4 from Jeffrey A. Law <law at redhat dot com> ---
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 <pinskia at gcc dot gnu.org> ---
> (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
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug target/59691] cilk-plus run failures on non-sse processors
2014-01-05 23:25 [Bug other/59691] New: cilk-plus failure on PENTIUM2 bernd.edlinger at hotmail dot de
` (3 preceding siblings ...)
2014-01-22 17:53 ` law at redhat dot com
@ 2014-01-23 18:06 ` bviyer at gmail dot com
2014-01-23 18:08 ` bviyer at gmail dot com
` (5 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: bviyer at gmail dot com @ 2014-01-23 18:06 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59691
--- Comment #5 from Balaji V. Iyer <bviyer at gmail dot com> ---
Created attachment 31938
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31938&action=edit
Possible Fix.
Possible fix.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug target/59691] cilk-plus run failures on non-sse processors
2014-01-05 23:25 [Bug other/59691] New: cilk-plus failure on PENTIUM2 bernd.edlinger at hotmail dot de
` (4 preceding siblings ...)
2014-01-23 18:06 ` bviyer at gmail dot com
@ 2014-01-23 18:08 ` bviyer at gmail dot com
2014-01-25 8:13 ` bernd.edlinger at hotmail dot de
` (4 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: bviyer at gmail dot com @ 2014-01-23 18:08 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59691
--- Comment #6 from Balaji V. Iyer <bviyer at gmail dot com> ---
Hi Jeff, Andrew and Bernd,
Can you please try out the "possible fix" and see if that works for you?
Thanks,
Balaji V. Iyer.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug target/59691] cilk-plus run failures on non-sse processors
2014-01-05 23:25 [Bug other/59691] New: cilk-plus failure on PENTIUM2 bernd.edlinger at hotmail dot de
` (5 preceding siblings ...)
2014-01-23 18:08 ` bviyer at gmail dot com
@ 2014-01-25 8:13 ` bernd.edlinger at hotmail dot de
2014-01-25 13:30 ` hjl.tools at gmail dot com
` (3 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: bernd.edlinger at hotmail dot de @ 2014-01-25 8:13 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59691
--- Comment #7 from Bernd Edlinger <bernd.edlinger at hotmail dot de> ---
(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
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug target/59691] cilk-plus run failures on non-sse processors
2014-01-05 23:25 [Bug other/59691] New: cilk-plus failure on PENTIUM2 bernd.edlinger at hotmail dot de
` (6 preceding siblings ...)
2014-01-25 8:13 ` bernd.edlinger at hotmail dot de
@ 2014-01-25 13:30 ` hjl.tools at gmail dot com
2014-01-25 15:20 ` bviyer at gmail dot com
` (2 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: hjl.tools at gmail dot com @ 2014-01-25 13:30 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59691
--- Comment #8 from H.J. Lu <hjl.tools at gmail dot com> ---
(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.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug target/59691] cilk-plus run failures on non-sse processors
2014-01-05 23:25 [Bug other/59691] New: cilk-plus failure on PENTIUM2 bernd.edlinger at hotmail dot de
` (7 preceding siblings ...)
2014-01-25 13:30 ` hjl.tools at gmail dot com
@ 2014-01-25 15:20 ` bviyer at gmail dot com
2014-02-10 16:57 ` bviyer at gcc dot gnu.org
2014-02-10 17:44 ` law at redhat dot com
10 siblings, 0 replies; 12+ messages in thread
From: bviyer at gmail dot com @ 2014-01-25 15:20 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59691
--- Comment #9 from Balaji V. Iyer <bviyer at gmail dot com> ---
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.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug target/59691] cilk-plus run failures on non-sse processors
2014-01-05 23:25 [Bug other/59691] New: cilk-plus failure on PENTIUM2 bernd.edlinger at hotmail dot de
` (8 preceding siblings ...)
2014-01-25 15:20 ` bviyer at gmail dot com
@ 2014-02-10 16:57 ` bviyer at gcc dot gnu.org
2014-02-10 17:44 ` law at redhat dot com
10 siblings, 0 replies; 12+ messages in thread
From: bviyer at gcc dot gnu.org @ 2014-02-10 16:57 UTC (permalink / raw)
To: gcc-bugs
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 <balaji.v.iyer@intel.com>
+
+ 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
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug target/59691] cilk-plus run failures on non-sse processors
2014-01-05 23:25 [Bug other/59691] New: cilk-plus failure on PENTIUM2 bernd.edlinger at hotmail dot de
` (9 preceding siblings ...)
2014-02-10 16:57 ` bviyer at gcc dot gnu.org
@ 2014-02-10 17:44 ` law at redhat dot com
10 siblings, 0 replies; 12+ messages in thread
From: law at redhat dot com @ 2014-02-10 17:44 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59691
Jeffrey A. Law <law at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
--- Comment #11 from Jeffrey A. Law <law at redhat dot com> ---
Fixed on trunk.
^ permalink raw reply [flat|nested] 12+ messages in thread