diff mbox

[0/2] Add atomic support to m68k

Message ID 20173.1871.63866.22607@pilspetsen.it.uu.se
State New
Headers show

Commit Message

Mikael Pettersson Nov. 23, 2011, 2:46 p.m. UTC
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-20111112.  Compared to 4.7-20111105
I have the following test suite result changes:

 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
+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
 XPASS: gcc.dg/guality/example.c  -O0  execution test
 XPASS: gcc.dg/guality/example.c  -O1  execution test
 WARNING: program timed out.
@@ -462,18 +481,26 @@
 
 		=== gcc Summary ===
 
-# of expected passes		60413
-# of unexpected failures	256
+# of expected passes		60718
+# of unexpected failures	261
 # of unexpected successes	26
-# of expected failures		116
-# of unsupported tests		1072
-/mnt/scratch/objdir47/gcc/xgcc  version 4.7.0 20111105 (experimental) (GCC) 
+# of expected failures		127
+# of unresolved testcases	2
+# of unsupported tests		1142
+/mnt/scratch/objdir47/gcc/xgcc  version 4.7.0 20111112 (experimental) (GCC) 
 
 		=== libgomp tests ===
 
 
 Running target unix
+FAIL: libgomp.c/atomic-10.c execution test
+FAIL: libgomp.c/atomic-3.c execution test
 FAIL: libgomp.c/autopar-1.c execution test
+FAIL: libgomp.c/pr26943-2.c execution test
+FAIL: libgomp.c/pr26943-3.c execution test
+FAIL: libgomp.c/pr26943-4.c execution test
+FAIL: libgomp.c/reduction-2.c execution test
+FAIL: libgomp.c/reduction-3.c execution test
 FAIL: libgomp.c++/for-1.C  -O3 -fomit-frame-pointer -funroll-loops  execution test
 FAIL: libgomp.c++/for-1.C  -O3 -fomit-frame-pointer -funroll-all-loops -finline-functions  execution test
 FAIL: libgomp.c++/for-2.C  -O3 -fomit-frame-pointer -funroll-loops  execution test
@@ -486,18 +513,19 @@
 FAIL: libgomp.c++/for-5.C  -O3 -fomit-frame-pointer -funroll-all-loops -finline-functions  execution test
 FAIL: libgomp.c++/for-8.C  -O3 -fomit-frame-pointer -funroll-loops  execution test
 FAIL: libgomp.c++/for-8.C  -O3 -fomit-frame-pointer -funroll-all-loops -finline-functions  execution test
+FAIL: libgomp.c++/reduction-2.C  -O  execution test
+FAIL: libgomp.c++/reduction-3.C  -O  execution test
 
 		=== libgomp Summary ===
 
-# of expected passes		1214
-# of unexpected failures	13
+# of expected passes		1205
+# of unexpected failures	22
 # of unsupported tests		8
 		=== libstdc++ tests ===
 
 
 Running target unix
 FAIL: 20_util/shared_ptr/thread/mutex_weaktoshared.cc execution test
-WARNING: program timed out.
 FAIL: 22_locale/locale/cons/12658_thread-1.cc execution test
 FAIL: 22_locale/locale/cons/12658_thread-2.cc execution test
 FAIL: 23_containers/list/pthread1.cc execution test
@@ -505,7 +533,7 @@
 FAIL: 23_containers/map/pthread6.cc execution test
 FAIL: 26_numerics/complex/pow.cc execution test
 FAIL: 27_io/basic_ofstream/pthread2.cc execution test
-FAIL: tr1/2_general_utilities/shared_ptr/thread/default_weaktoshared.cc execution test
+FAIL: 27_io/basic_ostringstream/pthread3.cc execution test
 FAIL: tr1/2_general_utilities/shared_ptr/thread/mutex_weaktoshared.cc execution test
 FAIL: tr1/5_numerical_facilities/special_functions/12_ellint_1/check_nan.cc execution test
 FAIL: tr1/5_numerical_facilities/special_functions/13_ellint_2/check_nan.cc execution test
@@ -513,15 +541,15 @@
 
 		=== libstdc++ Summary ===
 
-# of expected passes		8323
+# of expected passes		8523
 # of unexpected failures	13
-# of expected failures		46
-# of unsupported tests		249
+# of expected failures		45
+# of unsupported tests		160

Comments

Richard Henderson Nov. 23, 2011, 11:36 p.m. UTC | #1
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~
Mikael Pettersson Nov. 25, 2011, 10:26 a.m. UTC | #2
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-20111112/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
diff mbox

Patch

--- mail-report-4.7-20111105-0	2011-11-09 21:31:02.000000000 +0100
+++ mail-report-4.7-20111112-with-atomics	2011-11-23 04:59:39.000000000 +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 20111105 (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 20111112 (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-20111112.)