Hi! On Wed, 20 Jul 2016 08:27:56 -0400, Nathan Sidwell <nat...@acm.org> wrote: > On 07/19/16 14:34, Alexander Monakov wrote: > > I've recently committed a middle-end patch that adds handling of undefined > > variables (that the nvptx backend needs) under -fno-toplevel-reorder (svn > > rev. > > 238371). With that change, it's no longer necessary to implicitly enable > > -ftoplevel-reorder in the backend, and the following patch removes that.
Yay for less special-casing! > > Tested with nvptx-none-run, OK for trunk? > > ok thanks Hmm. In an offloading configuration I see the following regression: [-PASS:-]{+FAIL:+} libgomp.oacc-c/../libgomp.oacc-c-c++-common/reduction-cplx-dbl.c -DACC_DEVICE_TYPE_nvidia=1 -DACC_MEM_SHARED=0 -foffload=nvptx-none -O0 (test for excess errors) [-PASS:-]{+UNRESOLVED:+} libgomp.oacc-c/../libgomp.oacc-c-c++-common/reduction-cplx-dbl.c -DACC_DEVICE_TYPE_nvidia=1 -DACC_MEM_SHARED=0 -foffload=nvptx-none -O0 [-execution test-]{+compilation failed to produce executable+} ptxas /tmp/ccmABlIh.o, line 971; error : State space mismatch between instruction and address in instruction 'atom' ptxas /tmp/ccmABlIh.o, line 1008; error : State space mismatch between instruction and address in instruction 'atom' ptxas /tmp/ccmABlIh.o, line 1017; error : State space mismatch between instruction and address in instruction 'atom' ptxas /tmp/ccmABlIh.o, line 1035; error : State space mismatch between instruction and address in instruction 'atom' ptxas /tmp/ccmABlIh.o, line 1331; error : State space mismatch between instruction and address in instruction 'atom' ptxas /tmp/ccmABlIh.o, line 1373; error : State space mismatch between instruction and address in instruction 'atom' ptxas /tmp/ccmABlIh.o, line 1385; error : State space mismatch between instruction and address in instruction 'atom' ptxas /tmp/ccmABlIh.o, line 1408; error : State space mismatch between instruction and address in instruction 'atom' ptxas /tmp/ccmABlIh.o, line 971; error : Unknown symbol '__reduction_lock' ptxas /tmp/ccmABlIh.o, line 971; error : Label expected for forward reference of '__reduction_lock' ptxas /tmp/ccmABlIh.o, line 1008; error : Unknown symbol '__reduction_lock' ptxas /tmp/ccmABlIh.o, line 1008; error : Label expected for forward reference of '__reduction_lock' ptxas /tmp/ccmABlIh.o, line 1017; error : Unknown symbol '__reduction_lock' ptxas /tmp/ccmABlIh.o, line 1017; error : Label expected for forward reference of '__reduction_lock' ptxas /tmp/ccmABlIh.o, line 1035; error : Unknown symbol '__reduction_lock' ptxas /tmp/ccmABlIh.o, line 1035; error : Label expected for forward reference of '__reduction_lock' ptxas /tmp/ccmABlIh.o, line 1331; error : Unknown symbol '__reduction_lock' ptxas /tmp/ccmABlIh.o, line 1331; error : Label expected for forward reference of '__reduction_lock' ptxas /tmp/ccmABlIh.o, line 1373; error : Unknown symbol '__reduction_lock' ptxas /tmp/ccmABlIh.o, line 1373; error : Label expected for forward reference of '__reduction_lock' ptxas /tmp/ccmABlIh.o, line 1385; error : Unknown symbol '__reduction_lock' ptxas /tmp/ccmABlIh.o, line 1385; error : Label expected for forward reference of '__reduction_lock' ptxas /tmp/ccmABlIh.o, line 1408; error : Unknown symbol '__reduction_lock' ptxas /tmp/ccmABlIh.o, line 1408; error : Label expected for forward reference of '__reduction_lock' ptxas fatal : Ptx assembly aborted due to errors nvptx-as: ptxas returned 255 exit status mkoffload: fatal error: [...]/build-gcc/gcc/x86_64-pc-linux-gnu-accel-nvptx-none-gcc return ed 1 exit status compilation terminated. lto-wrapper: fatal error: [...]/build-gcc/gcc//accel/nvptx-none/mkoffload returned 1 exit s tatus compilation terminated. [...]/ld: lto-wrapper failed collect2: error: ld returned 1 exit status Same for C++. ..., and in nvptx-none target testing I see the following: C: [-PASS:-]{+WARNING: program timed out.+} {+FAIL:+} gcc.dg/large-size-array-4.c (test for excess errors) This one times out when creating a huge *.s file: [...] .global .align 8 .u64 name[2147483649] = { 0, 0, [...] Running with -ftoplevel-reorder (as implicitly enabled before), a *.s file with just the preamble gets created. Are these behaviors correct? [-PASS:-]{+FAIL:+} gcc.dg/pr16973.c (test for excess errors) [...]/source-gcc/gcc/testsuite/gcc.dg/pr16973.c:12:1: error: initializer for integer/fixed-point value is too complicated C++: PASS: g++.dg/debug/dwarf2/dwarf4-typedef.C -std=gnu++98 (test for warnings, line 9) FAIL: g++.dg/debug/dwarf2/dwarf4-typedef.C -std=gnu++98 (test for excess errors) PASS: g++.dg/debug/dwarf2/dwarf4-typedef.C -std=gnu++11 (test for warnings, line 9) [-PASS:-]{+FAIL:+} g++.dg/debug/dwarf2/dwarf4-typedef.C -std=gnu++11 (test for excess errors) PASS: g++.dg/debug/dwarf2/dwarf4-typedef.C -std=gnu++14 (test for warnings, line 9) [-PASS:-]{+FAIL:+} g++.dg/debug/dwarf2/dwarf4-typedef.C -std=gnu++14 (test for excess errors) These now all FAIL due to "sorry, unimplemented: target cannot support nonlocal goto", which is "acceptable", but should be XFAILed. (Though, that has generally not yet been done for C++.) UNSUPPORTED: g++.dg/cpp0x/variadic98.C -std=c++98 [-PASS:-]{+FAIL:+} g++.dg/cpp0x/variadic98.C -std=c++11 (test for excess errors) [-PASS:-]{+FAIL:+} g++.dg/cpp0x/variadic98.C -std=c++14 (test for excess errors) Again, "sorry, unimplemented: target cannot support nonlocal goto". UNSUPPORTED: g++.dg/cpp1y/nsdmi-aggr1.C -std=c++98 UNSUPPORTED: g++.dg/cpp1y/nsdmi-aggr1.C -std=c++11 [-PASS:-]{+FAIL:+} g++.dg/cpp1y/nsdmi-aggr1.C -std=c++14 (test for excess errors) [-PASS:-]{+UNRESOLVED:+} g++.dg/cpp1y/nsdmi-aggr1.C -std=c++14 [-execution test-]{+compilation failed to produce executable+} Now fails with: nvptx-as: circular reference in variable initializers FAIL: g++.dg/other/pr47218.C -std=gnu++98 (test for excess errors) [-FAIL: g++.dg/other/pr47218.C -std=gnu++11 (internal compiler error)-] FAIL: g++.dg/other/pr47218.C -std=gnu++11 (test for excess errors) [-FAIL: g++.dg/other/pr47218.C -std=gnu++14 (internal compiler error)-] FAIL: g++.dg/other/pr47218.C -std=gnu++14 (test for excess errors) :-) These now all FAIL with "sorry, unimplemented: target cannot support nonlocal goto" instead of cryptic ptxas errors before: ptxas pr47218.o, line 74; error : Unimplemented feature: labels as initial values ptxas pr47218.o, line 339; error : Arguments mismatch for instruction 'mov' ptxas pr47218.o, line 341; error : Arguments mismatch for instruction 'mov' ptxas pr47218.o, line 387; fatal : Parsing error near '.byte': syntax error ptxas fatal : Ptx assembly aborted due to errors nvptx-as: ptxas returned 255 exit status xg++: internal compiler error: Segmentation fault (program as) [-PASS:-]{+FAIL:+} g++.dg/torture/20090329-1.C -O0 (test for excess errors) PASS: g++.dg/torture/20090329-1.C -O1 (test for excess errors) PASS: g++.dg/torture/20090329-1.C -O2 (test for excess errors) PASS: g++.dg/torture/20090329-1.C -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions (test for excess errors) Another "sorry, unimplemented: target cannot support nonlocal goto". [-PASS:-]{+FAIL:+} g++.dg/torture/pr42714.C -O0 (test for excess errors) PASS: g++.dg/torture/pr42714.C -O1 (test for excess errors) PASS: g++.dg/torture/pr42714.C -O2 (test for excess errors) PASS: g++.dg/torture/pr42714.C -O3 -g (test for excess errors) Another "sorry, unimplemented: target cannot support nonlocal goto". [-PASS:-]{+FAIL:+} g++.dg/torture/pr49039.C -O0 (test for excess errors) [-PASS:-]{+UNRESOLVED:+} g++.dg/torture/pr49039.C -O0 [-execution test-]{+compilation failed to produce executable+} PASS: g++.dg/torture/pr49039.C -O1 (test for excess errors) PASS: g++.dg/torture/pr49039.C -O1 execution test PASS: g++.dg/torture/pr49039.C -O2 (test for excess errors) Another "sorry, unimplemented: target cannot support nonlocal goto". [-PASS:-]{+FAIL:+} g++.dg/torture/pr64312.C -O0 (test for excess errors) PASS: g++.dg/torture/pr64312.C -O1 (test for excess errors) PASS: g++.dg/torture/pr64312.C -O2 (test for excess errors) PASS: g++.dg/torture/pr64312.C -O3 -g (test for excess errors) Another "sorry, unimplemented: target cannot support nonlocal goto". FAIL: g++.old-deja/g++.benjamin/tem01.C -std=c++98 (test for excess errors) [-PASS:-]{+FAIL:+} g++.old-deja/g++.benjamin/tem01.C -std=c++11 (test for excess errors) [-PASS:-]{+FAIL:+} g++.old-deja/g++.benjamin/tem01.C -std=c++14 (test for excess errors) Two more "sorry, unimplemented: target cannot support nonlocal goto". [-PASS:-]{+FAIL:+} g++.old-deja/g++.brendan/crash47.C -std=c++98 (test for excess errors) [-PASS:-]{+FAIL:+} g++.old-deja/g++.brendan/crash47.C -std=c++11 (test for excess errors) [-PASS:-]{+FAIL:+} g++.old-deja/g++.brendan/crash47.C -std=c++14 (test for excess errors) More "sorry, unimplemented: target cannot support nonlocal goto". But why did these PASS before? Is this generally just a problem with -O0, or are there any optimizations doing things differently whether -ftoplevel-reorder is in effect or not, and we could perhaps shuffle some things so that for nvptx we run into "sorry, unimplemented: target cannot support nonlocal goto" less often? That is, I'm not clear on how -fno-toplevel-reorder interacts with "nonlocal goto". [-PASS:-]{+FAIL:+} g++.old-deja/g++.jason/overload33.C -std=c++98 (test for excess errors) [-PASS:-]{+FAIL:+} g++.old-deja/g++.jason/overload33.C -std=c++11 (test for excess errors) [-PASS:-]{+FAIL:+} g++.old-deja/g++.jason/overload33.C -std=c++14 (test for excess errors) More "sorry, unimplemented: target cannot support nonlocal goto" regressions. PASS: g++.old-deja/g++.pt/crash55.C -std=c++98 (test for excess errors) [-PASS:-]{+FAIL:+} g++.old-deja/g++.pt/crash55.C -std=c++11 (test for excess errors) [-PASS:-]{+FAIL:+} g++.old-deja/g++.pt/crash55.C -std=c++14 (test for excess errors) These now fail with: ptxas crash55.o, line 61; error : Arguments mismatch for instruction 'mov' ptxas crash55.o, line 63; error : Arguments mismatch for instruction 'mov' ptxas crash55.o, line 80; error : Label expected for argument 0 of instruction 'call' ptxas crash55.o, line 80; error : Function '_ZN3fooIcE1dEPS0_' not declared in this scope ptxas crash55.o, line 80; error : Call target not recognized ptxas crash55.o, line 91; fatal : Parsing error near '.byte': syntax error ptxas fatal : Ptx assembly aborted due to errors nvptx-as: ptxas returned 255 exit status [-PASS:-]{+FAIL:+} g++.old-deja/g++.pt/ttp64.C -std=c++98 (test for excess errors) [-PASS:-]{+FAIL:+} g++.old-deja/g++.pt/ttp64.C -std=c++11 (test for excess errors) [-PASS:-]{+FAIL:+} g++.old-deja/g++.pt/ttp64.C -std=c++14 (test for excess errors) More "sorry, unimplemented: target cannot support nonlocal goto" regressions. Grüße Thomas
signature.asc
Description: PGP signature