Re: [PATCH 0/2] Add atomic support to m68k

2011-11-25 Thread Mikael Pettersson
Richard Henderson writes:
  On 11/23/2011 06:46 AM, Mikael Pettersson wrote:
   +FAIL: c-c++-common/gomp/atomic-10.c scan-tree-dump-times ompexp 
   __atomic_fetch_add 4
   +FAIL: c-c++-common/gomp/atomic-3.c scan-tree-dump-times ompexp xyzzy, 4 
   1
   +FAIL: c-c++-common/gomp/atomic-9.c scan-tree-dump-times ompexp 
   __atomic_fetch_add 1
  
  What are these failures?

Executing on host: /mnt/scratch/objdir47/gcc/xgcc -B/mnt/scratch/objdir47/gcc/ 
/mnt/scratch/gcc-4.7-2012/gcc/testsuite/c-c++-common/gomp/atomic-9.c
-fopenmp -fdump-tree-ompexp -S  -o atomic-9.s(timeout = 300)
PASS: c-c++-common/gomp/atomic-9.c (test for excess errors)
FAIL: c-c++-common/gomp/atomic-9.c scan-tree-dump-times ompexp 
__atomic_fetch_add 1

The test case expects

  #pragma omp atomic
*bar() += 1;

to become __atomic_fetch_add (it does on x86_64), but on m68k-linux with your
patch the assignment is instead bracketed by 
__builtin_GOMP_atomic_{start,end}().

atomic-10.c and atomic-3.c are the same issue.

  Are they fixed if you add m68k-linux to check_effective_target_sync_int_long 
  and check_effective_target_sync_char_short in 
  gcc/testsuite/lib/target-supports.exp?

No.  These tests require cas_int, and the patched gcc does provide that.
I believe the real error is that gomp for some reason doesn't think the target
has gcc atomics, and the tests fail in that case.

/Mikael


Re: [PATCH 0/2] Add atomic support to m68k

2011-11-23 Thread Mikael Pettersson
Mikael Pettersson writes:
  Richard Henderson writes:
The first patch adds support for the m68k-linux syscall.  The second
patch adds native support for the m680[2346]0 CAS instruction, and
the m68000/Coldfire TAS instruction.

Both tested only via cross-compile.  

Please test...
  
  Thanks Richard.  I'm currently bootstrapping and regtesting this
  natively on aranym.

Bootstrapped fine and tested mostly OK.  Seems to have eliminated all
atomics-related regressions in 4.7-2012.  Compared to 4.7-2005
I have the following test suite result changes:

--- mail-report-4.7-2005-0  2011-11-09 21:31:02.0 +0100
+++ mail-report-4.7-2012-with-atomics   2011-11-23 04:59:39.0 
+0100
@@ -1,5 +1,5 @@
 cat 'EOF' |
-LAST_UPDATED: Obtained from SVN: trunk revision 181017
+LAST_UPDATED: Obtained from SVN: trunk revision 181327
 
 Native configuration is m68k-unknown-linux-gnu
 
@@ -12,8 +12,20 @@
 FAIL: tmpdir-g++.dg-struct-layout-1/t016 cp_compat_x_tst.o-cp_compat_y_tst.o 
execute 
 FAIL: tmpdir-g++.dg-struct-layout-1/t025 cp_compat_x_tst.o-cp_compat_y_tst.o 
execute 
 FAIL: tmpdir-g++.dg-struct-layout-1/t027 cp_compat_x_tst.o-cp_compat_y_tst.o 
execute 
-FAIL: g++.dg/cdce3.C scan-tree-dump cdce cdce3.C:98: note: function call is 
shrink-wrapped into error conditions.
-FAIL: g++.dg/cdce3.C scan-tree-dump cdce cdce3.C:108: note: function call is 
shrink-wrapped into error conditions.
+FAIL: g++.dg/cdce3.C -std=gnu++98 scan-tree-dump cdce cdce3.C:98: note: 
function call is shrink-wrapped into error conditions.
+FAIL: g++.dg/cdce3.C -std=gnu++98 scan-tree-dump cdce cdce3.C:108: note: 
function call is shrink-wrapped into error conditions.
+FAIL: g++.dg/cdce3.C -std=gnu++11 scan-tree-dump cdce cdce3.C:98: note: 
function call is shrink-wrapped into error conditions.
+FAIL: g++.dg/cdce3.C -std=gnu++11 scan-tree-dump cdce cdce3.C:108: note: 
function call is shrink-wrapped into error conditions.
+FAIL: g++.dg/opt/cfg3.C -std=gnu++98 (internal compiler error)
+FAIL: g++.dg/opt/cfg3.C -std=gnu++98 (test for excess errors)
+FAIL: g++.dg/opt/cfg3.C -std=gnu++11 (internal compiler error)
+FAIL: g++.dg/opt/cfg3.C -std=gnu++11 (test for excess errors)
+FAIL: c-c++-common/gomp/atomic-10.c -std=gnu++98 scan-tree-dump-times ompexp 
__atomic_fetch_add 4
+FAIL: c-c++-common/gomp/atomic-10.c -std=gnu++11 scan-tree-dump-times ompexp 
__atomic_fetch_add 4
+FAIL: c-c++-common/gomp/atomic-3.c -std=gnu++98 scan-tree-dump-times ompexp 
xyzzy, 4 1
+FAIL: c-c++-common/gomp/atomic-3.c -std=gnu++11 scan-tree-dump-times ompexp 
xyzzy, 4 1
+FAIL: c-c++-common/gomp/atomic-9.c -std=gnu++98 scan-tree-dump-times ompexp 
__atomic_fetch_add 1
+FAIL: c-c++-common/gomp/atomic-9.c -std=gnu++11 scan-tree-dump-times ompexp 
__atomic_fetch_add 1
 FAIL: g++.dg/guality/redeclaration1.C  -O0  line 17 i == 24
 FAIL: g++.dg/guality/redeclaration1.C  -O1  line 17 i == 24
 FAIL: g++.dg/guality/redeclaration1.C  -O2  line 17 i == 24
@@ -106,11 +118,11 @@
 
=== g++ Summary ===
 
-# of expected passes   26073
-# of unexpected failures   96
-# of expected failures 151
-# of unsupported tests 413
-/mnt/scratch/objdir47/gcc/testsuite/g++/../../g++  version 4.7.0 2005 
(experimental) (GCC) 
+# of expected passes   43635
+# of unexpected failures   108
+# of expected failures 280
+# of unsupported tests 633
+/mnt/scratch/objdir47/gcc/testsuite/g++/../../g++  version 4.7.0 2012 
(experimental) (GCC) 
 
=== gcc tests ===
 
@@ -150,6 +162,10 @@
 FAIL: gcc.c-torture/execute/arith-rand-ll.c execution,  -O3 
-fomit-frame-pointer -funroll-all-loops -finline-functions 
 FAIL: gcc.c-torture/execute/arith-rand-ll.c execution,  -O3 -g 
 FAIL: gcc.c-torture/execute/arith-rand-ll.c execution,  -Os 
+FAIL: gcc.c-torture/execute/stdarg-3.c compilation,  -O3 -fomit-frame-pointer 
-funroll-loops  (internal compiler error)
+UNRESOLVED: gcc.c-torture/execute/stdarg-3.c execution,  -O3 
-fomit-frame-pointer -funroll-loops 
+FAIL: gcc.c-torture/execute/stdarg-3.c compilation,  -O3 -fomit-frame-pointer 
-funroll-all-loops -finline-functions  (internal compiler error)
+UNRESOLVED: gcc.c-torture/execute/stdarg-3.c execution,  -O3 
-fomit-frame-pointer -funroll-all-loops -finline-functions 

(Ignore this one, it's also in vanilla 4.7-2012.)

 FAIL: gcc.c-torture/execute/ieee/compare-fp-1.c execution,  -O0 
 FAIL: gcc.c-torture/execute/ieee/compare-fp-1.c execution,  -O1 
 FAIL: gcc.c-torture/execute/ieee/compare-fp-1.c execution,  -O2 
@@ -194,6 +210,9 @@
 FAIL: gcc.dg/pr46309.c scan-tree-dump-times reassoc1 Optimizing range tests 
a_[0-9]*.D. -.128, 159. and -.192, 223.[
 FAIL: gcc.dg/pr46309.c scan-tree-dump-times reassoc2 Optimizing range tests 
D.[0-9]*_[0-9]* -.0, 31. and -.128, 159.[
 FAIL: gcc.dg/pr46647.c scan-tree-dump-not optimized memset
+FAIL: c-c++-common/gomp/atomic-10.c scan-tree-dump-times ompexp 
__atomic_fetch_add 4

Re: [PATCH 0/2] Add atomic support to m68k

2011-11-23 Thread Richard Henderson
On 11/23/2011 06:46 AM, Mikael Pettersson wrote:
 +FAIL: c-c++-common/gomp/atomic-10.c scan-tree-dump-times ompexp 
 __atomic_fetch_add 4
 +FAIL: c-c++-common/gomp/atomic-3.c scan-tree-dump-times ompexp xyzzy, 4 1
 +FAIL: c-c++-common/gomp/atomic-9.c scan-tree-dump-times ompexp 
 __atomic_fetch_add 1

What are these failures?

Are they fixed if you add m68k-linux to check_effective_target_sync_int_long 
and check_effective_target_sync_char_short in 
gcc/testsuite/lib/target-supports.exp?


r~


Re: [PATCH 0/2] Add atomic support to m68k

2011-11-19 Thread Mikael Pettersson
Richard Henderson writes:
  The first patch adds support for the m68k-linux syscall.  The second
  patch adds native support for the m680[2346]0 CAS instruction, and
  the m68000/Coldfire TAS instruction.
  
  Both tested only via cross-compile.  
  
  Please test...

Thanks Richard.  I'm currently bootstrapping and regtesting this
natively on aranym.

/Mikael


  
  
  r~
  
  
  Richard Henderson (2):
m68k-linux: Implement atomic operations via syscall.
m68k: Implement CAS and TAS patterns.
  
   gcc/config/m68k/linux.h   |4 +
   gcc/config/m68k/m68k.c|8 ++
   gcc/config/m68k/m68k.md   |9 ++
   gcc/config/m68k/sync.md   |   80 ++
   libgcc/config.host|6 +-
   libgcc/config/m68k/linux-atomic.c |  211 
  +
   libgcc/config/m68k/t-linux|1 +
   7 files changed, 316 insertions(+), 3 deletions(-)
   create mode 100644 gcc/config/m68k/sync.md
   create mode 100644 libgcc/config/m68k/linux-atomic.c
   create mode 100644 libgcc/config/m68k/t-linux
  
  -- 
  1.7.4.4
  


[PATCH 0/2] Add atomic support to m68k

2011-11-18 Thread Richard Henderson
The first patch adds support for the m68k-linux syscall.  The second
patch adds native support for the m680[2346]0 CAS instruction, and
the m68000/Coldfire TAS instruction.

Both tested only via cross-compile.  

Please test...


r~


Richard Henderson (2):
  m68k-linux: Implement atomic operations via syscall.
  m68k: Implement CAS and TAS patterns.

 gcc/config/m68k/linux.h   |4 +
 gcc/config/m68k/m68k.c|8 ++
 gcc/config/m68k/m68k.md   |9 ++
 gcc/config/m68k/sync.md   |   80 ++
 libgcc/config.host|6 +-
 libgcc/config/m68k/linux-atomic.c |  211 +
 libgcc/config/m68k/t-linux|1 +
 7 files changed, 316 insertions(+), 3 deletions(-)
 create mode 100644 gcc/config/m68k/sync.md
 create mode 100644 libgcc/config/m68k/linux-atomic.c
 create mode 100644 libgcc/config/m68k/t-linux

-- 
1.7.4.4