--- wikisrc/users/maya/vax-gcc.mdwn 2019/08/29 12:43:34 1.1 +++ wikisrc/users/maya/vax-gcc.mdwn 2019/08/29 21:19:09 1.6 @@ -1,23 +1,51 @@ # Various GCC/vax issues and invesigation # -# libgomp crash with -O2 # +## libgomp crash with -O2 ## Repro: -```` -#!/bin/sh -cat << EOF > oacc.i -int a, b; -int e() { - short *c = 0; - char d = c[a + 1]; - b = d; - a += 2; -} -EOF -vax--netbsdelf-gcc -O2 -c oacc.i -```` + #!/bin/sh + + cat << EOF > oacc.i + int a, b; + int e() { + short *c = 0; + char d = c[a + 1]; + b = d; + a += 2; + } + EOF + vax--netbsdelf-gcc -O2 -c oacc.i + Asserts at emit-rtl.c:2310 gcc_assert (memory_address_addr_space_p (mode, addr, as)); -NetBSD avoids it with a local diff to reload.c/dse.c. +NetBSD avoids it with a [local diff](https://github.com/NetBSD/src/commit/e437e96750193b86d0464965661f616e011056fa) to reload.c/dse.c. +It looks like a real bug in vax_legitimate_address_p not handling some addressing modes. +The code to handle offset(reg)[index] might be off: it doesn't like if neither xfoo0, xfoo1 are constant. + +## unrecognizable insn with any optimization ## + +Repro: + + #!/bin/sh + + cat << EOF > decl.ii + struct a { + long long *b() const; + }; + template class d : a { + public: + template d(e); + long long f() const; + }; + template long long d::f() const { + int g; + return b()[g]; + } + int h; + bool i() { + d j(h); + return j.f(); + } + EOF + vax--netbsdelf-g++ -O2 -c decl.ii -It looks like a real bug in vax_legitimate_address_p not handling some addressing modes