[Bug target/58442] bootstrapping vax crashes on NetBSD

2019-09-17 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58442

Eric Gallager  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=58901
 Resolution|--- |FIXED

--- Comment #13 from Eric Gallager  ---
(In reply to coypu from comment #12)
> I think this ticket can be closed.
> all the vax code with mode_dependent_address_p already checks that it's
> MEM_P like suggested by matt thomas.
> 
> 
> I can almost complete a build with the patch in #58901, with the other
> unfixed bug being in binutils rather than GCC :-)

ok, closing then

[Bug target/58442] bootstrapping vax crashes on NetBSD

2019-09-17 Thread coypu at sdf dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58442

coypu  changed:

   What|Removed |Added

 CC||coypu at sdf dot org

--- Comment #12 from coypu  ---
I think this ticket can be closed.
all the vax code with mode_dependent_address_p already checks that it's MEM_P
like suggested by matt thomas.


I can almost complete a build with the patch in #58901, with the other unfixed
bug being in binutils rather than GCC :-)

[Bug target/58442] bootstrapping vax crashes on NetBSD

2018-09-06 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58442

Eric Gallager  changed:

   What|Removed |Added

 CC||egallager at gcc dot gnu.org

--- Comment #11 from Eric Gallager  ---
(In reply to Martin Husemann from comment #10)
> Matt Thomas suggested to go with the easy solution for now: protect the
> calls with MEM_P, i.e.: change the ! mode_dependent_address_p() in the
> bitfield patterns to
> 
>  (MEM_P(..) && ! mode_dependent_address_p(...))
> 
> With this change, a NetBSD kernel can be compiled (but does not yet boot),
> and bootstrap goes way further along (will file another ticket for the next
> obstacle).

Did you ever file that other ticket?

[Bug target/58442] bootstrapping vax crashes on NetBSD

2013-10-28 Thread martin at netbsd dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58442

--- Comment #10 from Martin Husemann  ---
Matt Thomas suggested to go with the easy solution for now: protect the calls
with MEM_P, i.e.: change the ! mode_dependent_address_p() in the bitfield
patterns to

 (MEM_P(..) && ! mode_dependent_address_p(...))

With this change, a NetBSD kernel can be compiled (but does not yet boot), and
bootstrap goes way further along (will file another ticket for the next
obstacle).


[Bug target/58442] bootstrapping vax crashes on NetBSD

2013-10-23 Thread martin at netbsd dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58442

--- Comment #9 from Martin Husemann  ---
Please correct me if I am wrong, but in the bitfield cotexts in vax.md there
are multiple places with similar constructs like:

219&& (REG_P (operands[0])
220|| ! mode_dependent_address_p (XEXP (operands[0], 0),
221MEM_ADDR_SPACE (operands[0])

If I read the code correctly, MEM_ADDR_SPACE() might only be called if MEM_P()
is true. The expression at hand is a SUBREG, so neither REG_P() nor MEM_P() is
true, and we end up invoking MEM_ADDR_SPACE() and should cause a call to
rtl_check_failed_code1(), causing an internal error and abort. No clue why that
fails (and how).

I do not understand VAX good enough, but as THE cisc arch would expect the
moves generated here to work for subregs as well - so maybe we need to check
for REG_P() || SUBREG_P(), where SUBREG_P would be new (GET_CODE(X) ==
SUBRECT)?


[Bug target/58442] bootstrapping vax crashes on NetBSD

2013-10-21 Thread martin at netbsd dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58442

--- Comment #8 from Martin Husemann  ---
And apparently same cause:
ooops, bogus rtx mem attrs: 0x4
(subreg:SI (reg/v:DI 70 [ xtime ]) 4)


[Bug target/58442] bootstrapping vax crashes on NetBSD

2013-10-21 Thread martin at netbsd dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58442

--- Comment #7 from Martin Husemann  ---
I can reproduce the same crash on a different input file with a amd64 -> vax
cross compiler (so we can drop the theory that a miscompiled recog_1 function
causes this).


[Bug target/58442] bootstrapping vax crashes on NetBSD

2013-09-23 Thread martin at netbsd dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58442

--- Comment #6 from Martin Husemann  ---
To verify, I instrumented get_mem_attrs:

static inline struct mem_attrs *
get_mem_attrs (const_rtx x)
{
  struct mem_attrs *attrs;

  attrs = MEM_ATTRS (x);

  attrs = MEM_ATTRS (x);
  if (!attrs) {
attrs = mode_mem_attrs[(int) GET_MODE (x)];
if ((unsigned long)attrs < 1024) {
  fprintf(stderr, "ooops, mode_mem_attrs are bogus: %p mode %d\n", attrs,
G$
  debug_rtx(x);
}
  } else if ((unsigned long)attrs < 1024) {
fprintf(stderr, "ooops, bogus rtx mem attrs: %p\n", attrs);
debug_rtx(x);
  }

  return attrs;
}

and indeed this fires:

ooops, bogus rtx mem attrs: 0x4
(subreg:SI (reg/v:DI 71 [ __s ]) 4)
In file included from
/usr/pkgobj/lang/gcc48/work/build/vax--netbsdelf/libstdc++-v3/include/bits/locale_facets_nonio.h:1903:0,
 from
/usr/pkgobj/lang/gcc48/work/build/vax--netbsdelf/libstdc++-v3/include/locale:41,
 from
../../../../../gcc-4.8.1/libstdc++-v3/src/c++98/locale-inst.cc:29:
...


[Bug target/58442] bootstrapping vax crashes on NetBSD

2013-09-23 Thread martin at netbsd dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58442

--- Comment #5 from Martin Husemann  ---
Just as a sanity check: I verified that the natively generated insn-recog.c is
the same as one cross compiled on an amd64 host.


[Bug target/58442] bootstrapping vax crashes on NetBSD

2013-09-19 Thread martin at netbsd dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58442

--- Comment #4 from Martin Husemann  ---
I stared at the assembly a bit more (but my vax fu is weak):

we are in the last line of

216 #line 781 "../../gcc-4.8.1/gcc/config/vax/vax.md"
217 ((INTVAL (operands[1]) == 8 || INTVAL (operands[1]) == 16)
218&& INTVAL (operands[2]) % INTVAL (operands[1]) == 0
219&& (REG_P (operands[0])
220|| ! mode_dependent_address_p (XEXP (operands[0], 0),
221MEM_ADDR_SPACE (operands[0])

and doing:

   0x92cda2 :
movl *0xef3cfc <_GLOBAL_OFFSET_TABLE_+1548>,r0

this is r0 = operands[0]

MEM_ADDR_SPACE(RTX) is get_mem_attrs (RTX)->addrspace) so we do the call:

   0x92cda9 :  pushl r0
   0x92cdab :
calls $0x1,0x92c99e 

and apparently get_mem_attrs(operand[0]) returned 4, which we then deref to
->addrspace and crash.


[Bug target/58442] bootstrapping vax crashes on NetBSD

2013-09-18 Thread martin at netbsd dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58442

--- Comment #3 from Martin Husemann  ---
   0x92c9fc :movab 0xff60(sp),sp
   0x92ca01 :
movab *0xef3cfc <_GLOBAL_OFFSET_TABLE_+1548>,0xffd8(fp)
   0x92ca09 :   movl 0x4(ap),r0
   0x92ca0d :   movl 0x4(r0),0xffdc(fp)
   0x92ca12 :   movw *0xffdc(fp),r0
   0x92ca16 :   movzwl r0,r0
   0x92ca19 :   movl r0,0xff64(fp)
   0x92ca1e :   cmpl 0xff64(fp),$0x2c
   0x92ca23 :   
beql 0x92ca60 
   0x92ca25 :   cmpl 0xff64(fp),$0x007a
   0x92ca2e :   
bneq 0x92ca33 
   0x92ca30 :   
brw 0x92cbe1 
   0x92ca33 :   pushl $0x6
   0x92ca35 :   pushl 0xffdc(fp)
   0x92ca38 :   
calls $0x2,0x6715e8 
   0x92ca3f :   clrb 0xff6b(fp)
   0x92ca43 :   tstl r0
   0x92ca45 :   
beql 0x92ca4c 
   0x92ca47 :   movb $0x1,0xff6b(fp)
   0x92ca4c :   tstb 0xff6b(fp)
   0x92ca50 :   
bneq 0x92ca55 
   0x92ca52 :   
brw 0x92df46 
   0x92ca55 :   
movl 0xffdc(fp),*0xef3cfc <_GLOBAL_OFFSET_TABLE_+1548>
   0x92ca5d :   
brw 0x92cf4a 
   0x92ca60 :  pushl $0x6
   0x92ca62 :  pushl 0xffdc(fp)
   0x92ca65 :  
calls $0x2,0x66d802 
   0x92ca6c :  clrb 0xff6c(fp)
   0x92ca70 :  tstl r0
   0x92ca72 :  
beql 0x92ca79 
   0x92ca74 :  movb $0x1,0xff6c(fp)
   0x92ca79 :  tstb 0xff6c(fp)
   0x92ca7d :  
beql 0x92ca33 
   0x92ca7f :  
movl 0xffdc(fp),*0xef3cfc <_GLOBAL_OFFSET_TABLE_+1548>
   0x92ca87 :  movl 0x4(ap),r0
   0x92ca8b :  movl 0x8(r0),0xffdc(fp)
   0x92ca90 :  movl 0xffdc(fp),r0
   0x92ca94 :  movb 0x2(r0),r0
   0x92ca98 :  movzbl r0,r0
   0x92ca9b :  cmpl r0,$0x6
   0x92ca9e :  
bneq 0x92caac 
   0x92caa0 :  movw *0xffdc(fp),r0
   0x92caa4 :  movzwl r0,r0
   0x92caa7 :  cmpl r0,$0x32
   0x92caaa :  
beql 0x92cab8 
   0x92caac :  movl 0x4(ap),r0
   0x92cab0 :  movl 0x4(r0),0xffdc(fp)
   0x92cab5 :  
brw 0x92ca33 
   0x92cab8 :  movl 0xffdc(fp),r0
   0x92cabc :  movl 0x4(r0),0xffe0(fp)
   0x92cac1 :  pushl $0x6
   0x92cac3 :  pushl 0xffe0(fp)
   0x92cac6 :  
calls $0x2,0x671620 
   0x92cacd :  clrb 0xff6d(fp)
   0x92cad1 :  tstl r0
   0x92cad3 :  
beql 0x92cada 
   0x92cad5 :  movb $0x1,0xff6d(fp)
   0x92cada :  tstb 0xff6d(fp)
   0x92cade :  
beql 0x92caf0 
   0x92cae0 :  
movab *0xef3cfc <_GLOBAL_OFFSET_TABLE_+1548>,r0
   0x92cae7 :  addl2 $0x4,r0
   0x92caea :  movl 0xffe0(fp),(r0)
   0x92caee :  
brb 0x92cafc 
   0x92caf0 :  movl 0x4(ap),r0
   0x92caf4 :  movl 0x4(r0),0xffdc(fp)
   0x92caf9 :  
brw 0x92ca33 
   0x92cafc :  movl 0xffdc(fp),r0
   0x92cb00 :  movl 0x8(r0),0xffe0(fp)
   0x92cb05 :  movl 0xffe0(fp),r0
   0x92cb09 :  movb 0x2(r0),r0
   0x92cb0d :  movzbl r0,r0
   0x92cb10 :  cmpl r0,$0x6
   0x92cb13 :  
beql 0x92cb21 
   0x92cb15 :  movl 0x4(ap),r0
   0x92cb19 :  movl 0x4(r0),0xffdc(fp)
   0x92cb1e :  
brw 0x92ca33 
   0x92cb21 :  pushl $0x6
   0x92cb23 :  pushl 0xffe0(fp)
   0x92cb26 :  
calls $0x2,0x92bd36 
   0x92cb2d :  clrb 0xff6e(fp)
   0x92cb31 :  tstl r0
   0x92cb33 :  
beql 0x92cb3a 
   0x92cb35 :  movb $0x1,0xff6e(fp)
   0x92cb3a :  tstb 0xff6e(fp)
   0x92cb3e :  
beql 0x92cb50 
   0x92cb40 :  
movab *0xef3cfc <_GLOBAL_OFFSET_TABLE_+1548>,r0
   0x92cb47 :  addl2 $0x8,r0
   0x92cb4a :  movl 0xffe0(fp),(r0)
   0x92cb4e :  
brb 0x92cb8b 
   0x92cb50 :  pushl $0x6
   0x92cb52 :  pushl 0xffe0(fp)
   0x92cb55 :  
calls $0x2,0x92bd9e 
   0x92cb5c :  clrb 0xff6f(fp)
   0x92cb60 :  tstl r0
   0x92cb62 :  
beql 0x92cb69 
   0x92cb64 :  movb $0x1,0xff6f(fp)
   0x92cb69 :  tstb 0xff6f(fp)
   0x92cb6d :  
beql 0x92cb7f 
   0x92cb6f :  
movab *0xef3cfc <_GLOBAL_OFFSET_TABLE_+1548>,r0
   0x92cb76 :  addl2 $0x8,r0
   0x92cb79 :  movl 0xffe0(fp),(r0)
   0x92cb7d :  
brb 0x92cbba 
   0x92cb7f :  movl 0x4(ap),r0
   0x92cb83 :  movl 0x4(r0),0xffdc(fp)
   0x92cb88 :  
brw 0x92ca33 
   0x92cb8b :  
movab *0xef4424 <_GLOBAL_OFFSET_TABLE_+3380>,r0
   0x92cb92 :  movab 0x308(r0),r0
   0x92cb97 :  movl (r0),r0
   0x92cb9a :  tstl r0
   0x92cb9c :  
beql 0x92cba6 
   0x92cb9e :  movl $0x2b,0xff70(fp)
   0x92cba3 :  
brw 0x92df4b 
   0x92cba6 :  movl 0x4(ap),r0
   0x92cbaa :  movl 0x8(r0),0xffdc(fp)
   0x92cbaf :  movl 0xffdc(fp),r0
   0x92cbb3 :  movl 0x8(r0),0xffe0(fp)
   0x92cbb8 :  
brb 0x92cb50 
   0x92cbba :  
movab *0xef4424 <_GLOBAL_OFFSET_TABLE_+3380>,r0
   0x92cbc1

[Bug target/58442] bootstrapping vax crashes on NetBSD

2013-09-17 Thread jbg...@lug-owl.de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58442

--- Comment #2 from Jan-Benedict Glaw  ---
So r0 is waay off.  As we're far into the function (950) and fiddling with r0,
I guess this is the final part, preparing to return from here. An assembler
dump of the whole function would be helpful I hope.


[Bug target/58442] bootstrapping vax crashes on NetBSD

2013-09-17 Thread martin at netbsd dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58442

--- Comment #1 from Martin Husemann  ---
(gdb) x/i 0x0092cdb0
=> 0x92cdb0 :  movb 0x14(r0),r0
(gdb) info reg
r0 0x4  4
r1 0x8  8
r2 0x0  0
r3 0xf0c308 15778568
r4 0x0  0
r5 0x0  0
r6 0x9e 158
r7 0x7f7d6c72   2138926194
r8 0x7f7ca000   2138873856
r9 0x7ff0   2147483632
r100x7f7d   2138898432
r110xa1b08  662280
ap 0x7fffe1c4   2147475908
fp 0x7fffe1b0   2147475888
sp 0x7fffe110   2147475728
pc 0x92cdb0 9620912
ps 0x3c062914560