NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: toolchain/58411: GCC/x86_64 10.5 and 12.4 miscompile GCC/sh3 12.4



The following reply was made to PR toolchain/58411; it has been noted by GNATS.

From: Harold Gutch <logix%foobar.franken.de@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: toolchain/58411: GCC/x86_64 10.5 and 12.4 miscompile GCC/sh3 12.4
Date: Wed, 10 Jul 2024 12:06:21 +0200

 Hi,
 
 just as an additional data point, I did the following on Ubuntu 24.04,
 which ships with "gcc version 13.2.0 (Ubuntu 13.2.0-23ubuntu4)" with a
 current tree from 2024-07-06 (so four days ago):
 
 1a)
   $ ./build.sh -u -U -O ../../bugs/58411 -m dreamcast -j 16 tools
 
 1b)
 
   $ tooldir.Linux-6.8.0-36-generic-x86_64/bin/shle--netbsdelf-gcc-10.5.0 -O1 -c test.c
   $ tooldir.Linux-6.8.0-36-generic-x86_64/bin/shle--netbsdelf-objdump -d test.o
   [...]
   00000000 <func>:
      0:   48 24           tst     r4,r4
      2:   06 89           bt      12 <func+0x12>
      4:   43 60           mov     r4,r0
      6:   01 88           cmp/eq  #1,r0
      8:   04 8f           bf.s    14 <func+0x14>
      a:   01 e0           mov     #1,r0
      c:   04 90           mov.w   18 <func+0x18>,r0       ! beaf
      e:   0b 00           rts
     10:   09 00           nop
     12:   02 90           mov.w   1a <func+0x1a>,r0       ! dead
     14:   0b 00           rts
     16:   09 00           nop
     18:   af be           bsr     fffffd7a <func+0xfffffd7a>
     1a:   ad de           mov.l   2d0 <func+0x2d0>,r14
 
 
 2a)
   $ ./build.sh -u -U -O ../../bugs/58411 -m dreamcast -j 16 -VHAVE_GCC=12 tools
 
 2b)
 
   $ tooldir.Linux-6.8.0-36-generic-x86_64/bin/shle--netbsdelf-gcc-12.4.0 -O1 -c test.c
   $ tooldir.Linux-6.8.0-36-generic-x86_64/bin/shle--netbsdelf-objdump -d test.o
   [...]
   00000000 <func>:
      0:   04 8b           bf      c <func+0xc>
      2:   43 60           mov     r4,r0
      4:   01 88           cmp/eq  #1,r0
      6:   04 89           bt      12 <func+0x12>
      8:   0b 00           rts
      a:   01 e0           mov     #1,r0
      c:   04 90           mov.w   18 <func+0x18>,r0       ! dead
      e:   0b 00           rts
     10:   09 00           nop
     12:   02 90           mov.w   1a <func+0x1a>,r0       ! beaf
     14:   0b 00           rts
     16:   09 00           nop
     18:   ad de           mov.l   2d0 <func+0x2d0>,r14
     1a:   af be           bsr     fffffd7c <func+0xfffffd7c>
 
 
 So it appears that this is behavior is not specific to our host gcc
 but also appears on other platforms.
 
 
   Harold
 


Home | Main Index | Thread Index | Old Index