[Bug target/68945] enable libcilkrts on SPARC

2017-12-04 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68945
Bug 68945 depends on bug 70595, which changed state.

Bug 70595 Summary: Cilk Plus testsuite needs massive cleanup
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70595

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |WONTFIX

[Bug target/68945] enable libcilkrts on SPARC

2016-12-01 Thread ro at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68945

Rainer Orth  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #15 from Rainer Orth  ---
Fixed for 7.1.

[Bug target/68945] enable libcilkrts on SPARC

2016-12-01 Thread ro at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68945

--- Comment #14 from Rainer Orth  ---
Author: ro
Date: Thu Dec  1 14:48:49 2016
New Revision: 243112

URL: https://gcc.gnu.org/viewcvs?rev=243112=gcc=rev
Log:
Import libcilkrts Build 4467 (PR target/68945)

PR target/68945
Merge from upstream, version 2.0.4467.0.
Fix typo in git URL.
* aclocal.m4, configure, Makefile.in: Regenerate.

Added:
trunk/libcilkrts/runtime/config/sparc/
trunk/libcilkrts/runtime/config/sparc/cilk-abi-vla.c
trunk/libcilkrts/runtime/config/sparc/os-fence.h
trunk/libcilkrts/runtime/config/sparc/os-unix-sysdep.c
Modified:
trunk/libcilkrts/ChangeLog
trunk/libcilkrts/Makefile.am
trunk/libcilkrts/Makefile.in
trunk/libcilkrts/README
trunk/libcilkrts/configure
trunk/libcilkrts/configure.ac
trunk/libcilkrts/configure.tgt
trunk/libcilkrts/include/cilk/cilk_undocumented.h
trunk/libcilkrts/include/internal/cilk_version.h
trunk/libcilkrts/include/internal/rev.mk
trunk/libcilkrts/runtime/cilk-abi.c
trunk/libcilkrts/runtime/cilk_fiber-unix.cpp
trunk/libcilkrts/runtime/cilk_fiber.h
trunk/libcilkrts/runtime/config/arm/os-fence.h
trunk/libcilkrts/runtime/except-gcc.cpp
trunk/libcilkrts/runtime/global_state.cpp
trunk/libcilkrts/runtime/global_state.h
trunk/libcilkrts/runtime/jmpbuf.h
trunk/libcilkrts/runtime/linux-symbols.ver
trunk/libcilkrts/runtime/local_state.h
trunk/libcilkrts/runtime/mac-symbols.txt
trunk/libcilkrts/runtime/os-unix.c
trunk/libcilkrts/runtime/record-replay.cpp
trunk/libcilkrts/runtime/scheduler.c
trunk/libcilkrts/runtime/scheduler.h
trunk/libcilkrts/runtime/sysdep-unix.c

[Bug target/68945] enable libcilkrts on SPARC

2016-10-24 Thread ro at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68945

--- Comment #13 from Rainer Orth  ---
I see my patch has been applied upstream.  Thanks for that.

It would be really great if it could be imported into the gcc tree for the
GCC 7 release, either before stage 1 closes or, release managers permitting,
even after that.

  Rainer

[Bug target/68945] enable libcilkrts on SPARC

2016-05-10 Thread ro at CeBiTec dot Uni-Bielefeld.DE
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68945

--- Comment #12 from ro at CeBiTec dot Uni-Bielefeld.DE  ---
> --- Comment #11 from Eric Botcazou  ---
[...]
>> * One thing I wonder about is runtime/config/sparc/os-fence.h: when using
>>   __sync_synchronize, gcc emits membar #StoreLoad, while Stefan's patch had
>>   membar#LoadLoad | #LoadStore | #StoreStore | #StoreLoad.  It seems that
>>   all but #StoreLoad are no-ops for TSO SPARC CPUs, but I'd better get this
>> right.
>
> __sync_synchronize emits the minimum memory barrier for the memory model, 
> which
> is TSO on Solaris so only #StoreLoad is needed.  The 4 flags are needed for 
> RMO
> theoretically, but I'm not sure RMO ever existed in real life.

Ok, so I'll keep the __sync_synchronize and inline asm versions in sync
and submit the result upstream.

Thanks.
Rainer

[Bug target/68945] enable libcilkrts on SPARC

2016-05-09 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68945

--- Comment #11 from Eric Botcazou  ---
> * In runtime/config/sparc/os-unix-sysdep.c (__cilkrts_getticks) I needed
> different
>   32- and 64-bit versions.  I tested the result in standalone program which
> just
>   printed the result.

This looks good to me.

> * One thing I wonder about is runtime/config/sparc/os-fence.h: when using
>   __sync_synchronize, gcc emits membar #StoreLoad, while Stefan's patch had
>   membar#LoadLoad | #LoadStore | #StoreStore | #StoreLoad.  It seems that
>   all but #StoreLoad are no-ops for TSO SPARC CPUs, but I'd better get this
> right.

__sync_synchronize emits the minimum memory barrier for the memory model, which
is TSO on Solaris so only #StoreLoad is needed.  The 4 flags are needed for RMO
theoretically, but I'm not sure RMO ever existed in real life.

[Bug target/68945] enable libcilkrts on SPARC

2016-05-09 Thread ro at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68945

Rainer Orth  changed:

   What|Removed |Added

  Attachment #38221|0   |1
is obsolete||
  Attachment #38413|0   |1
is obsolete||

--- Comment #10 from Rainer Orth  ---
Created attachment 38451
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38451=edit
Revised patch

Here's a version of the patch that is, I believe, ready for upstream
submission.

It's based on the upstream version as has just been merged into the gcc repo.

Compared to the previous sparcv9 support, the assertions are gone to allow for
an easier read.

I've also replaced the times(3C) based implementation of __cilkrts_getticks by
one reading %tick directly, which should work on all UltraSPARC CPUs,
independent
of O/S.

I've replaced the _GNU_SOURCE guard around runtime/sysdep-unix.c
(get_runtime_path) around the use dladdr
by the result of a configure check.  The previous version had been wrong (just
defining _GNU_SOURCE) doesn't suddently materialize dladdr), and the function 
is present in Solaris libc.

Perhaps Eric could have a look at the SPARC assembler code to double-check that
I got it right:

* In runtime/config/sparc/os-unix-sysdep.c (__cilkrts_getticks) I needed
different
  32- and 64-bit versions.  I tested the result in standalone program which
just
  printed the result.

* One thing I wonder about is runtime/config/sparc/os-fence.h: when using
  __sync_synchronize, gcc emits membar #StoreLoad, while Stefan's patch had
  membar#LoadLoad | #LoadStore | #StoreStore | #StoreLoad.  It seems that
  all but #StoreLoad are no-ops for TSO SPARC CPUs, but I'd better get this
right.

I also believe that only so little of Stefan's code is left
(__cilkrts_short_pause mostly) to not require a separate assignement for
upstream submission.  If I'm mistaken, we'd better get that ball rolling.

  Rainer

[Bug target/68945] enable libcilkrts on SPARC

2016-05-04 Thread ro at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68945

--- Comment #9 from Rainer Orth  ---
Created attachment 38413
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38413=edit
sparcv9 support patch

This patch (on top of the previous one) fixes the sparcv9 failures reported
before.

As I'd suspected, the problem was that the code didn't take the SPARC V9 stack
bias into account: in a couple of places, the stack and frame pointers in the
__builtin_setjmp/__builtin_longjmp internal jmpbuf are overwritten with
unbiased
addresses.

The patch includes both debugging code (assertions to check that the stack
pointer
is either biased or unbiased) and CILK_ADJUST_SP/CILK_UNADJUST_SP macros to
turn
a stack pointer from unbiased to biased form.

The patch is enough to successfully run all Cilk Plus in the gcc and g++
testsuites
successfully on sparc-sun-solaris2.10, but there may be code paths that also
need
adjustments.

I'm just posting the patch (which is relative to upstream libcilkrts, which
should
be merged into mainline any day now) for reference and comments.

  Rainer

[Bug target/68945] enable libcilkrts on SPARC

2016-04-09 Thread ro at CeBiTec dot Uni-Bielefeld.DE
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68945

--- Comment #8 from ro at CeBiTec dot Uni-Bielefeld.DE  ---
> --- Comment #7 from Stefan Teleman  ---
>> Since Stefan hasn't followed up and I'm currently looking at other
>> libcilkrts issues anyway, I'm taking over from here.
>
> Had every intention to follow-up with a cleaned-up patch, but did not find
> the time to re-do the patch.

No worries: I'm familiar both with the gcc build system and the
testsuite, so the changes fell out naturally.

> I will look into the SIGBUS crashes on SPARC64 and see what i come up
> with.

Great: one of should be able to figure out what's going on.

Rainer

[Bug target/68945] enable libcilkrts on SPARC

2016-04-08 Thread stefan.teleman at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68945

--- Comment #7 from Stefan Teleman  ---
> Since Stefan hasn't followed up and I'm currently looking at other
> libcilkrts issues anyway, I'm taking over from here.

Had every intention to follow-up with a cleaned-up patch, but did not find
the time to re-do the patch.

I will look into the SIGBUS crashes on SPARC64 and see what i come up
with.

[Bug target/68945] enable libcilkrts on SPARC

2016-04-08 Thread ro at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68945

Rainer Orth  changed:

   What|Removed |Added

  Attachment #37050|0   |1
is obsolete||

--- Comment #6 from Rainer Orth  ---
Created attachment 38221
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38221=edit
Cleaned-up patch

[Bug target/68945] enable libcilkrts on SPARC

2016-04-08 Thread ro at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68945

Rainer Orth  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
 CC||ro at gcc dot gnu.org
 Depends on||70595
   Assignee|unassigned at gcc dot gnu.org  |ro at gcc dot gnu.org
   Target Milestone|--- |7.0

--- Comment #5 from Rainer Orth  ---
Since Stefan hasn't followed up and I'm currently looking at other libcilkrts
issues
anyway, I'm taking over from here.

I think I've addressed all review comments.  The necessary testsuite changes
have been split out into PR testsuite/70595.

I'm attaching my current patch, which allows all cilk-plus testcases to PASS
on 32-bit Solaris 12/SPARC.  The picture is different for 64-bit, though, where
a couple of the execution tests FAIL in a way I cannot yet make sense of: they
all
die with SIGBUS like this:

Thread 2 received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1 (LWP 1)]
0x7f614d14 in elf_rtbndr () from /usr/lib/sparcv9/ld.so.1
(gdb) where
#0  0x7f614d14 in elf_rtbndr () from /usr/lib/sparcv9/ld.so.1
#1  0x7efd8e6c in _ti_bind_clear () from /lib/64/libc.so.1
#2  0x7f6335e8 in elf_bndr () from /usr/lib/sparcv9/ld.so.1

I suspect this is due to libcilkrts messing around with the internals of
a __builtin_setjmp/__builtin_longjmp jmpbuf in
libcilkplus/runtime/cilk_fiber-unix.cpp (cilk_fiber_sysdep::run), but haven't
yet pinpointed what's actually
wrong.  Calls for more investigation.

  Rainer


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70595
[Bug 70595] Cilk Plus testsuite needs massive cleanup

[Bug target/68945] enable libcilkrts on SPARC

2015-12-17 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68945

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #4 from Jakub Jelinek  ---
For __EXTENSIONS*, you IMHO want to use autoconf AC_USE_SYSTEM_EXTENSIONS and
remove the explicit _GNU_SOURCE defines in the sources.
In os-unix-sysdep.c you are mixing up the defines, some stuff is SPARC related
(e.g. the membar), but other stuff is Solaris related (the headers, getticks),
you really should use different define for that, or different files depending
on the size of changes.  Otherwise it will fail to build on sparc*-linux*.

[Bug target/68945] enable libcilkrts on SPARC

2015-12-16 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68945

Eric Botcazou  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2015-12-16
 CC||ebotcazou at gcc dot gnu.org
Summary|RFE: enable libcilkrts on   |enable libcilkrts on SPARC
   |SPARC [ patch included ]|
 Ever confirmed|0   |1
   Severity|normal  |enhancement

--- Comment #2 from Eric Botcazou  ---
Patches need to be posted on the gcc-patches@ mailing-list.

A few remarks:

  - SPARC is not a platform/target, only an architecture, so I presume that you
mean SPARC/Solaris here?

  - you don't need 2 entries in configure.tgt

  - you don't need 2 entries in the target field of testcases.

  - you cannot patch Makefile.in directly, go through configure.ac instead.

  - I don't think that patching runtime/config/generic/os-unix-sysdep.c is the
way to go, you probably need to create runtime/config/sparc instead.

  - Why do you test all the possible flavours of macros?

#if defined(sun) || defined(__sun) || defined(__sun__)

#ifdef __sun__ is the correct version.

[Bug target/68945] enable libcilkrts on SPARC

2015-12-16 Thread stefan.teleman at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68945

--- Comment #3 from Stefan Teleman  ---
(In reply to Eric Botcazou from comment #2)
> Patches need to be posted on the gcc-patches@ mailing-list.
> 
> A few remarks:
> 
>   - SPARC is not a platform/target, only an architecture, so I presume that
> you mean SPARC/Solaris here?

Actually, I also mean to include Linux and the BSD's that still
build on and publish for SPARC. I know that FreeBSD and Gentoo Linux
still build and publish SPARC distros.

> 
>   - you don't need 2 entries in configure.tgt
> 
>   - you don't need 2 entries in the target field of testcases.
> 
>   - you cannot patch Makefile.in directly, go through configure.ac instead.
> 
>   - I don't think that patching runtime/config/generic/os-unix-sysdep.c is
> the way to go, you probably need to create runtime/config/sparc instead.
> 
>   - Why do you test all the possible flavours of macros?
> 
> #if defined(sun) || defined(__sun) || defined(__sun__)
> 
> #ifdef __sun__ is the correct version.

OK, thank you for your comments. I will correct these and resubmit
to the gcc-patches@ mailing list.