Annotation of wikisrc/users/maya/vax-gcc.mdwn, revision 1.8

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

CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb