File:  [NetBSD Developer Wiki] / wikisrc / users / maya / vax-gcc.mdwn
Revision 1.12: download - view: text, annotated - select for diffs
Sun Sep 15 12:56:38 2019 UTC (16 months ago) by maya
Branches: MAIN
CVS tags: HEAD
Add some upstream bug reports.

# Various GCC/vax issues and invesigation #

[WIP tree](gcc-mirror/)

## libgomp crash with -O2 [#58901]( ##

    cat << EOF > oacc.i
    int a, b;
    int e() {
      short *c = 0;
      char d = c[a + 1];
      b = d;
      a += 2;
    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.  
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.

## change_address_1, at emit-rtl.c:2286 [#85152]( ##



    cat << EOF > oacc.i
    void fn2();
    unsigned a;
    int fn1() {
      int b = a >> 16;
      if (b)
    vax--netbsdelf-gcc -O2 -c oacc.i

## unrecognizable insn with any optimization ##



    cat << EOF > decl.ii
    struct a {
      long long *b() const;
    template <typename> class d : a {
      template <typename e> d(e);
      long long f() const;
    template <typename c> long long d<c>::f() const {
      int g;
      return b()[g];
    int h;
    bool i() {
      d<int> j(h);
      return j.f();
    vax--netbsdelf-g++ -O2 -c decl.ii

This errors out with:

    $ env PATH=$PWD:$PATH ./xgcc -fno-use-linker-plugin -c -O2 ~/oacc/decl.ii -fno-tree-vectorize
    /home/fly/oacc/decl.ii: In function 'bool i()':
    /home/fly/oacc/decl.ii:17:1: error: unrecognizable insn:
       17 | }
          | ^
    (insn 13 12 14 2 (set (reg:SI 33)
            (subreg:SI (mem:DI (plus:SI (mult:SI (reg/v:SI 24 [ g ])
                            (const_int 8 [0x8]))
                        (reg/f:SI 23 [ _6 ])) [1 *_10+0 S8 A32]) 4)) "/home/fly/oacc/decl.ii":16:14 -1
    during RTL pass: vregs
    /home/fly/oacc/decl.ii:17:1: internal compiler error: in extract_insn, at recog.c:2310

This is in VAX-specific code. We need to figure out what instruction pattern this is, that we're missing.

<!--Providing a trivial scheduling will avoid subregs of mem.  
However, this doesn't work for us. Our crash and mem subregs happen at a too early pass, most likely.-->

## DWARF ##

    flag_dwarf2_cfi_asm = 0;

is kind of a big deal. We should probably get rid of it, but [binutils hates that.](

    ld: warning: dynamic relocation to `?' in readonly section `.eh_frame'
    ld: warning: dynamic relocation to `?' in readonly section `.eh_frame'
    ld: warning: creating a DT_TEXTREL in a shared object
    ld: .eh_frame_hdr refers to overlapping FDEs
    ld: final link failed: bad value

[riscv seemed to share the issue]( and had fixed it.

## review comments ##

Jeff Law [provided some feedback]( More of it should be addressed.

CVSweb for NetBSD wikisrc <> software: FreeBSD-CVSweb