https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126126

            Bug ID: 126126
           Summary: [SH] Bootstrap comparison failure! - gcc/ipa-cp.o
                    differs
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: glaubitz at debian dot org
                CC: olegendo at gcc dot gnu.org
  Target Milestone: ---
            Target: sh*-*-*

Created attachment 64947
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=64947&action=edit
Diff of disassembly of stage2/stage3 versions of gcc/ipa-cp.o on sh4

Performing a native bootstrap build on Debian unstable sh4 on revision
f50679ec5db fails during the stage2/stage3 comparision:

make[2]: Entering directory '/home/glaubitz/gcc/build'
make[3]: Entering directory '/home/glaubitz/gcc/build'
rm -f stage_current
make[3]: Leaving directory '/home/glaubitz/gcc/build'
Comparing stages 2 and 3
Bootstrap comparison failure!
gcc/ipa-cp.o differs
make[2]: *** [Makefile:27202: compare] Error 1
make[2]: Leaving directory '/home/glaubitz/gcc/build'
make[1]: *** [Makefile:27182: stage3-bubble] Error 2
make[1]: Leaving directory '/home/glaubitz/gcc/build'
make: *** [Makefile:1139: all] Error 2

Disassembling gcc/ipa-cp.o from both stage2 and stage3 and then diffing the
result yields:

--- ipa-cp-stage2.diff  2026-07-05 20:27:50.272519255 +0200
+++ ipa-cp-stage3.diff  2026-07-05 20:27:56.584519312 +0200
@@ -1,5 +1,5 @@

-./stage2-gcc/ipa-cp.o:     file format elf32-sh-linux
+./stage3-gcc/ipa-cp.o:     file format elf32-sh-linux


 Disassembly of section .text:
@@ -51424,7 +51424,7 @@
   18:  23 6c           mov     r2,r12
   1a:  11 52           mov.l   @(4,r1),r2
   1c:  33 6d           mov     r3,r13
-  1e:  6a d3           mov.l   1c8
<_ZNK13profile_count11apply_scaleExx+0x1c8>,r3      ! fffffff
+  1e:  6b d3           mov.l   1cc
<_ZNK13profile_count11apply_scaleExx+0x1cc>,r3      ! fffffff
   20:  53 6e           mov     r5,r14
   22:  42 64           mov.l   @r4,r4
   24:  38 22           tst     r3,r2
@@ -51446,7 +51446,7 @@
   44:  f6 69           mov.l   @r15+,r9
   46:  0b 00           rts     
   48:  f6 68           mov.l   @r15+,r8
-  4a:  5f d3           mov.l   1c8
<_ZNK13profile_count11apply_scaleExx+0x1c8>,r3      ! fffffff
+  4a:  60 d3           mov.l   1cc
<_ZNK13profile_count11apply_scaleExx+0x1cc>,r3      ! fffffff
   4c:  30 35           cmp/eq  r3,r5
   4e:  6a 8d           bt.s    126 <_ZNK13profile_count11apply_scaleExx+0x126>
   50:  43 60           mov     r4,r0
@@ -51459,14 +51459,14 @@
   5e:  15 49           cmp/pl  r9
   60:  96 38           cmp/hi  r9,r8
   62:  01 89           bt      68 <_ZNK13profile_count11apply_scaleExx+0x68>
-  64:  a9 a0           bra     1ba <_ZNK13profile_count11apply_scaleExx+0x1ba>
+  64:  aa a0           bra     1bc <_ZNK13profile_count11apply_scaleExx+0x1bc>
   66:  09 00           nop     
   68:  58 25           tst     r5,r5
   6a:  70 8f           bf.s    14e <_ZNK13profile_count11apply_scaleExx+0x14e>
   6c:  00 e6           mov     #0,r6
   6e:  78 27           tst     r7,r7
   70:  01 89           bt      76 <_ZNK13profile_count11apply_scaleExx+0x76>
-  72:  7f a0           bra     174 <_ZNK13profile_count11apply_scaleExx+0x174>
+  72:  80 a0           bra     176 <_ZNK13profile_count11apply_scaleExx+0x176>
   74:  73 63           mov     r7,r3
   76:  e5 34           dmulu.l r14,r4
   78:  1a 00           sts     macl,r0
@@ -51487,31 +51487,31 @@
   96:  04 89           bt      a2 <_ZNK13profile_count11apply_scaleExx+0xa2>
   98:  32 30           cmp/hs  r3,r0
   9a:  01 8b           bf      a0 <_ZNK13profile_count11apply_scaleExx+0xa0>
-  9c:  88 a0           bra     1b0 <_ZNK13profile_count11apply_scaleExx+0x1b0>
+  9c:  89 a0           bra     1b2 <_ZNK13profile_count11apply_scaleExx+0x1b2>
   9e:  f3 58           mov.l   @(12,r15),r8
   a0:  01 e6           mov     #1,r6
   a2:  68 26           tst     r6,r6
   a4:  0f 8f           bf.s    c6 <_ZNK13profile_count11apply_scaleExx+0xc6>
   a6:  c3 66           mov     r12,r6
   a8:  03 65           mov     r0,r5
-  aa:  48 d0           mov.l   1cc
<_ZNK13profile_count11apply_scaleExx+0x1cc>,r0      ! 0
<_ZNK13profile_count11apply_scaleExx>
+  aa:  49 d0           mov.l   1d0
<_ZNK13profile_count11apply_scaleExx+0x1d0>,r0      ! 0
<_ZNK13profile_count11apply_scaleExx>
   ac:  23 1f           mov.l   r2,@(12,r15)
   ae:  d3 67           mov     r13,r7
   b0:  0b 40           jsr     @r0
   b2:  b3 64           mov     r11,r4
-  b4:  44 d7           mov.l   1c8
<_ZNK13profile_count11apply_scaleExx+0x1c8>,r7      ! fffffff
+  b4:  45 d7           mov.l   1cc
<_ZNK13profile_count11apply_scaleExx+0x1cc>,r7      ! fffffff
   b6:  03 66           mov     r0,r6
   b8:  f3 52           mov.l   @(12,r15),r2
   ba:  72 31           cmp/hs  r7,r1
-  bc:  5c 8d           bt.s    178 <_ZNK13profile_count11apply_scaleExx+0x178>
+  bc:  5d 8d           bt.s    17a <_ZNK13profile_count11apply_scaleExx+0x17a>
   be:  13 63           mov     r1,r3
-  c0:  41 d1           mov.l   1c8
<_ZNK13profile_count11apply_scaleExx+0x1c8>,r1      ! fffffff
+  c0:  42 d1           mov.l   1cc
<_ZNK13profile_count11apply_scaleExx+0x1cc>,r1      ! fffffff
   c2:  1a a0           bra     fa <_ZNK13profile_count11apply_scaleExx+0xfa>
   c4:  19 23           and     r1,r3
   c6:  d8 2d           tst     r13,r13
   c8:  3b 8d           bt.s    142 <_ZNK13profile_count11apply_scaleExx+0x142>
   ca:  c3 60           mov     r12,r0
-  cc:  40 d0           mov.l   1d0
<_ZNK13profile_count11apply_scaleExx+0x1d0>,r0      ! 0
<_ZNK13profile_count11apply_scaleExx>
+  cc:  41 d0           mov.l   1d4
<_ZNK13profile_count11apply_scaleExx+0x1d4>,r0      ! 0
<_ZNK13profile_count11apply_scaleExx>
   ce:  f3 62           mov     r15,r2
   d0:  10 72           add     #16,r2
   d2:  13 1f           mov.l   r1,@(12,r15)
@@ -51521,17 +51521,17 @@
   da:  0b 40           jsr     @r0
   dc:  d1 1f           mov.l   r13,@(4,r15)
   de:  f5 53           mov.l   @(20,r15),r3
-  e0:  39 d2           mov.l   1c8
<_ZNK13profile_count11apply_scaleExx+0x1c8>,r2      ! fffffff
+  e0:  3a d2           mov.l   1cc
<_ZNK13profile_count11apply_scaleExx+0x1cc>,r2      ! fffffff
   e2:  f4 50           mov.l   @(16,r15),r0
   e4:  22 33           cmp/hs  r2,r3
   e6:  05 8f           bf.s    f4 <_ZNK13profile_count11apply_scaleExx+0xf4>
   e8:  f3 51           mov.l   @(12,r15),r1
   ea:  26 33           cmp/hi  r2,r3
-  ec:  5c 8f           bf.s    1a8 <_ZNK13profile_count11apply_scaleExx+0x1a8>
+  ec:  5d 8f           bf.s    1aa <_ZNK13profile_count11apply_scaleExx+0x1aa>
   ee:  fe e2           mov     #-2,r2
-  f0:  35 d3           mov.l   1c8
<_ZNK13profile_count11apply_scaleExx+0x1c8>,r3      ! fffffff
+  f0:  36 d3           mov.l   1cc
<_ZNK13profile_count11apply_scaleExx+0x1cc>,r3      ! fffffff
   f2:  fe e0           mov     #-2,r0
-  f4:  34 d2           mov.l   1c8
<_ZNK13profile_count11apply_scaleExx+0x1c8>,r2      ! fffffff
+  f4:  35 d2           mov.l   1cc
<_ZNK13profile_count11apply_scaleExx+0x1cc>,r2      ! fffffff
   f6:  29 23           and     r2,r3
   f8:  11 52           mov.l   @(4,r1),r2
   fa:  e4 e1           mov     #-28,r1
@@ -51543,7 +51543,7 @@
  106:  07 e1           mov     #7,r1
  108:  1c e2           mov     #28,r2
  10a:  2d 41           shld    r2,r1
- 10c:  2e d2           mov.l   1c8
<_ZNK13profile_count11apply_scaleExx+0x1c8>,r2      ! fffffff
+ 10c:  2f d2           mov.l   1cc
<_ZNK13profile_count11apply_scaleExx+0x1cc>,r2      ! fffffff
  10e:  29 23           and     r2,r3
  110:  3b 21           or      r3,r1
  112:  18 7f           add     #24,r15
@@ -51558,7 +51558,7 @@
  124:  f6 68           mov.l   @r15+,r8
  126:  ff 88           cmp/eq  #-1,r0
  128:  93 8b           bf      52 <_ZNK13profile_count11apply_scaleExx+0x52>
- 12a:  2a d1           mov.l   1d4
<_ZNK13profile_count11apply_scaleExx+0x1d4>,r1      ! 10000000
+ 12a:  2b d1           mov.l   1d8
<_ZNK13profile_count11apply_scaleExx+0x1d8>,r1      ! 10000000
  12c:  5b 21           or      r5,r1
  12e:  18 7f           add     #24,r15
  130:  26 4f           lds.l   @r15+,pr
@@ -51573,77 +51573,79 @@
  142:  01 88           cmp/eq  #1,r0
  144:  c2 8f           bf.s    cc <_ZNK13profile_count11apply_scaleExx+0xcc>
  146:  fe e0           mov     #-2,r0
- 148:  1f d3           mov.l   1c8
<_ZNK13profile_count11apply_scaleExx+0x1c8>,r3      ! fffffff
+ 148:  20 d3           mov.l   1cc
<_ZNK13profile_count11apply_scaleExx+0x1cc>,r3      ! fffffff
  14a:  d7 af           bra     fc <_ZNK13profile_count11apply_scaleExx+0xfc>
  14c:  e4 e1           mov     #-28,r1
  14e:  78 27           tst     r7,r7
- 150:  1a 8f           bf.s    188 <_ZNK13profile_count11apply_scaleExx+0x188>
+ 150:  1b 8f           bf.s    18a <_ZNK13profile_count11apply_scaleExx+0x18a>
  152:  53 63           mov     r5,r3
  154:  e3 60           mov     r14,r0
  156:  e5 34           dmulu.l r14,r4
  158:  08 00           clrt    
- 15a:  0a 0b           sts     mach,r11
- 15c:  1a 0a           sts     macl,r10
+ 15a:  0a 0a           sts     mach,r10
+ 15c:  1a 09           sts     macl,r9
  15e:  35 30           dmulu.l r3,r0
  160:  00 e0           mov     #0,r0
- 162:  1a 08           sts     macl,r8
- 164:  0a 09           sts     mach,r9
- 166:  be 38           addc    r11,r8
- 168:  0e 39           addc    r0,r9
- 16a:  98 29           tst     r9,r9
- 16c:  0c 8f           bf.s    188 <_ZNK13profile_count11apply_scaleExx+0x188>
- 16e:  83 63           mov     r8,r3
- 170:  84 af           bra     7c <_ZNK13profile_count11apply_scaleExx+0x7c>
- 172:  a3 60           mov     r10,r0
- 174:  ef af           bra     156 <_ZNK13profile_count11apply_scaleExx+0x156>
- 176:  43 60           mov     r4,r0
- 178:  76 31           cmp/hi  r7,r1
- 17a:  10 8f           bf.s    19e <_ZNK13profile_count11apply_scaleExx+0x19e>
- 17c:  fe e1           mov     #-2,r1
- 17e:  12 d3           mov.l   1c8
<_ZNK13profile_count11apply_scaleExx+0x1c8>,r3      ! fffffff
- 180:  fe e0           mov     #-2,r0
- 182:  11 d1           mov.l   1c8
<_ZNK13profile_count11apply_scaleExx+0x1c8>,r1      ! fffffff
- 184:  b9 af           bra     fa <_ZNK13profile_count11apply_scaleExx+0xfa>
- 186:  19 23           and     r1,r3
- 188:  e7 05           mul.l   r14,r5
- 18a:  1a 03           sts     macl,r3
- 18c:  77 04           mul.l   r7,r4
- 18e:  1a 00           sts     macl,r0
- 190:  e5 34           dmulu.l r14,r4
- 192:  0c 33           add     r0,r3
- 194:  0a 06           sts     mach,r6
- 196:  1a 00           sts     macl,r0
- 198:  6c 33           add     r6,r3
- 19a:  6f af           bra     7c <_ZNK13profile_count11apply_scaleExx+0x7c>
- 19c:  01 e6           mov     #1,r6
- 19e:  16 36           cmp/hi  r1,r6
- 1a0:  ed 89           bt      17e <_ZNK13profile_count11apply_scaleExx+0x17e>
- 1a2:  09 d1           mov.l   1c8
<_ZNK13profile_count11apply_scaleExx+0x1c8>,r1      ! fffffff
- 1a4:  a9 af           bra     fa <_ZNK13profile_count11apply_scaleExx+0xfa>
- 1a6:  19 23           and     r1,r3
- 1a8:  26 30           cmp/hi  r2,r0
- 1aa:  a3 8b           bf      f4 <_ZNK13profile_count11apply_scaleExx+0xf4>
- 1ac:  a0 af           bra     f0 <_ZNK13profile_count11apply_scaleExx+0xf0>
- 1ae:  09 00           nop     
- 1b0:  82 3b           cmp/hs  r8,r11
- 1b2:  00 89           bt      1b6 <_ZNK13profile_count11apply_scaleExx+0x1b6>
- 1b4:  01 e6           mov     #1,r6
- 1b6:  75 af           bra     a4 <_ZNK13profile_count11apply_scaleExx+0xa4>
- 1b8:  68 26           tst     r6,r6
- 1ba:  07 d1           mov.l   1d8
<_ZNK13profile_count11apply_scaleExx+0x1d8>,r1      ! 0
<_ZNK13profile_count11apply_scaleExx>
- 1bc:  07 d6           mov.l   1dc
<_ZNK13profile_count11apply_scaleExx+0x1dc>,r6      ! 0
<_ZNK13profile_count11apply_scaleExx>
- 1be:  02 95           mov.w   1c6
<_ZNK13profile_count11apply_scaleExx+0x1c6>,r5      ! 497
- 1c0:  07 d4           mov.l   1e0
<_ZNK13profile_count11apply_scaleExx+0x1e0>,r4      ! f8
- 1c2:  0b 41           jsr     @r1
- 1c4:  09 00           nop     
- 1c6:  97 04           mul.l   r9,r4
- 1c8:  ff ff           .word 0xffff
- 1ca:  ff 0f           mac.l   @r15+,@r15+
+ 162:  a3 63           mov     r10,r3
+ 164:  1a 0b           sts     macl,r11
+ 166:  0a 08           sts     mach,r8
+ 168:  be 33           addc    r11,r3
+ 16a:  0e 38           addc    r0,r8
+ 16c:  88 28           tst     r8,r8
+ 16e:  0c 8f           bf.s    18a <_ZNK13profile_count11apply_scaleExx+0x18a>
+ 170:  93 60           mov     r9,r0
+ 172:  84 af           bra     7e <_ZNK13profile_count11apply_scaleExx+0x7e>
+ 174:  68 26           tst     r6,r6
+ 176:  ee af           bra     156 <_ZNK13profile_count11apply_scaleExx+0x156>
+ 178:  43 60           mov     r4,r0
+ 17a:  76 31           cmp/hi  r7,r1
+ 17c:  10 8f           bf.s    1a0 <_ZNK13profile_count11apply_scaleExx+0x1a0>
+ 17e:  fe e1           mov     #-2,r1
+ 180:  12 d3           mov.l   1cc
<_ZNK13profile_count11apply_scaleExx+0x1cc>,r3      ! fffffff
+ 182:  fe e0           mov     #-2,r0
+ 184:  11 d1           mov.l   1cc
<_ZNK13profile_count11apply_scaleExx+0x1cc>,r1      ! fffffff
+ 186:  b8 af           bra     fa <_ZNK13profile_count11apply_scaleExx+0xfa>
+ 188:  19 23           and     r1,r3
+ 18a:  e7 05           mul.l   r14,r5
+ 18c:  1a 03           sts     macl,r3
+ 18e:  77 04           mul.l   r7,r4
+ 190:  1a 00           sts     macl,r0
+ 192:  e5 34           dmulu.l r14,r4
+ 194:  0c 33           add     r0,r3
+ 196:  0a 06           sts     mach,r6
+ 198:  1a 00           sts     macl,r0
+ 19a:  6c 33           add     r6,r3
+ 19c:  6e af           bra     7c <_ZNK13profile_count11apply_scaleExx+0x7c>
+ 19e:  01 e6           mov     #1,r6
+ 1a0:  16 36           cmp/hi  r1,r6
+ 1a2:  ed 89           bt      180 <_ZNK13profile_count11apply_scaleExx+0x180>
+ 1a4:  09 d1           mov.l   1cc
<_ZNK13profile_count11apply_scaleExx+0x1cc>,r1      ! fffffff
+ 1a6:  a8 af           bra     fa <_ZNK13profile_count11apply_scaleExx+0xfa>
+ 1a8:  19 23           and     r1,r3
+ 1aa:  26 30           cmp/hi  r2,r0
+ 1ac:  a2 8b           bf      f4 <_ZNK13profile_count11apply_scaleExx+0xf4>
+ 1ae:  9f af           bra     f0 <_ZNK13profile_count11apply_scaleExx+0xf0>
+ 1b0:  09 00           nop     
+ 1b2:  82 3b           cmp/hs  r8,r11
+ 1b4:  00 89           bt      1b8 <_ZNK13profile_count11apply_scaleExx+0x1b8>
+ 1b6:  01 e6           mov     #1,r6
+ 1b8:  74 af           bra     a4 <_ZNK13profile_count11apply_scaleExx+0xa4>
+ 1ba:  68 26           tst     r6,r6
+ 1bc:  07 d1           mov.l   1dc
<_ZNK13profile_count11apply_scaleExx+0x1dc>,r1      ! 0
<_ZNK13profile_count11apply_scaleExx>
+ 1be:  08 d6           mov.l   1e0
<_ZNK13profile_count11apply_scaleExx+0x1e0>,r6      ! 0
<_ZNK13profile_count11apply_scaleExx>
+ 1c0:  02 95           mov.w   1c8
<_ZNK13profile_count11apply_scaleExx+0x1c8>,r5      ! 497
+ 1c2:  08 d4           mov.l   1e4
<_ZNK13profile_count11apply_scaleExx+0x1e4>,r4      ! f8
+ 1c4:  0b 41           jsr     @r1
+ 1c6:  09 00           nop     
+ 1c8:  97 04           mul.l   r9,r4
+ 1ca:  09 00           nop     
+ 1cc:  ff ff           .word 0xffff
+ 1ce:  ff 0f           mac.l   @r15+,@r15+
        ...
- 1d4:  00 00           .word 0x0000
- 1d6:  00 10           mov.l   r0,@(0,r0)
+ 1d8:  00 00           .word 0x0000
+ 1da:  00 10           mov.l   r0,@(0,r0)
        ...
- 1e0:  f8 00           .word 0x00f8
+ 1e4:  f8 00           .word 0x00f8
        ...

 Disassembly of section .text._ZNK13profile_count3ipaEv:

In Debian, we currently ignore this diff by adding the following line to
src/configure.ac:

compare_exclusions="$compare_exclusions | gcc/ipa-cp\$(objext)"

Reply via email to