1: # Various GCC/vax issues and invesigation #
2:
3: ## libgomp crash with -O2 ##
4: Repro:
5:
6: #!/bin/sh
7:
8: cat << EOF > oacc.i
9: int a, b;
10: int e() {
11: short *c = 0;
12: char d = c[a + 1];
13: b = d;
14: a += 2;
15: }
16: EOF
17: vax--netbsdelf-gcc -O2 -c oacc.i
18:
19: Asserts at emit-rtl.c:2310 gcc_assert (memory_address_addr_space_p (mode, addr, as));
20:
21: NetBSD avoids it with a [local diff](https://github.com/NetBSD/src/commit/e437e96750193b86d0464965661f616e011056fa) to reload.c/dse.c.
22: It looks like a real bug in vax_legitimate_address_p not handling some addressing modes.
23: The code to handle offset(reg)[index] might be off: it doesn't like if neither xfoo0, xfoo1 are constant.
24:
25: ## unrecognizable insn with any optimization ##
26:
27: Repro:
28:
29: #!/bin/sh
30:
31: cat << EOF > decl.ii
32: struct a {
33: long long *b() const;
34: };
35: template <typename> class d : a {
36: public:
37: template <typename e> d(e);
38: long long f() const;
39: };
40: template <typename c> long long d<c>::f() const {
41: int g;
42: return b()[g];
43: }
44: int h;
45: bool i() {
46: d<int> j(h);
47: return j.f();
48: }
49: EOF
50: vax--netbsdelf-g++ -O2 -c decl.ii
51:
52: This errors out with:
53:
54: $ env PATH=$PWD:$PATH ./xgcc -fno-use-linker-plugin -c -O2 ~/oacc/decl.ii -fno-tree-vectorize
55: /home/fly/oacc/decl.ii: In function 'bool i()':
56: /home/fly/oacc/decl.ii:17:1: error: unrecognizable insn:
57: 17 | }
58: | ^
59: (insn 13 12 14 2 (set (reg:SI 33)
60: (subreg:SI (mem:DI (plus:SI (mult:SI (reg/v:SI 24 [ g ])
61: (const_int 8 [0x8]))
62: (reg/f:SI 23 [ _6 ])) [1 *_10+0 S8 A32]) 4)) "/home/fly/oacc/decl.ii":16:14 -1
63: (nil))
64: during RTL pass: vregs
65: /home/fly/oacc/decl.ii:17:1: internal compiler error: in extract_insn, at recog.c:2310
66:
67: Providing a trivial scheduling will avoid subregs of mem.
CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb