From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 66EA53857020; Thu, 15 Oct 2020 08:03:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 66EA53857020 From: "glaubitz at physik dot fu-berlin.de" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/97431] [SH] Python crashes with 'Segmentation fault with -finline-small-functions Date: Thu, 15 Oct 2020 08:03:09 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 10.2.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: glaubitz at physik dot fu-berlin.de X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Oct 2020 08:03:09 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D97431 --- Comment #3 from John Paul Adrian Glaubitz --- (In reply to Rich Felker from comment #1) > Do you have a complete disassembly of the function it crashed in and > register dump at the point of crash? That would help. Register dump: (gdb) info registers r0 0x296318e8 694360296 r1 0x1 1 r2 0x1041400 17044480 r3 0x3e8 1000 r4 0x2a15f490 706081936 r5 0x2a15f4a0 706081952 r6 0x5 5 r7 0x0 0 r8 0xffffffff -1 r9 0x4154e8 4281576 r10 0x2a15f490 706081936 r11 0x5 5 r12 0x299f367c 698300028 r13 0x8b8 2232 r14 0x2a15f4a0 706081952 r15 0x7bffea64 2080369252 pc 0x296318e8 694360296 pr 0x2964f740 694482752 gbr 0x29576d78 693595512 mach 0xa 10 macl 0x0 0 (gdb) Disassembled function: Dump of assembler code for function long_richcompare: 0x29631850 <+0>: mov.l r8,@-r15 0x29631852 <+2>: mova 0x296318e8 ,r0 0x29631854 <+4>: mov.l r12,@-r15 0x29631856 <+6>: mov.l @(4,r4),r1 0x29631858 <+8>: mov.l 0x296318e8 ,r12 ! 0x3c1d94 0x2963185a <+10>: add #64,r1 0x2963185c <+12>: mov.l @(20,r1),r2 0x2963185e <+14>: mov.l 0x296318ec ,r1 ! 0x1000000 0x29631860 <+16>: tst r1,r2 0x29631862 <+18>: bt.s 0x296318d8 0x29631864 <+20>: add r0,r12 0x29631866 <+22>: mov.l @(4,r5),r2 0x29631868 <+24>: add #64,r2 0x2963186a <+26>: mov.l @(20,r2),r2 0x2963186c <+28>: tst r1,r2 0x2963186e <+30>: bt.s 0x296318d8 0x29631870 <+32>: cmp/eq r5,r4 0x29631872 <+34>: bt.s 0x29631940 0x29631874 <+36>: mov #5,r1 0x29631876 <+38>: mov.l @(8,r4),r7 0x29631878 <+40>: mov.l @(8,r5),r1 0x2963187a <+42>: mov r7,r8 0x2963187c <+44>: cmp/eq r1,r7 0x2963187e <+46>: bf.s 0x296318e8 0x29631880 <+48>: sub r1,r8 0x29631882 <+50>: cmp/pz r7 0x29631884 <+52>: mov r7,r1 0x29631886 <+54>: bt 0x2963188a 0x29631888 <+56>: neg r7,r1 0x2963188a <+58>: mov r1,r2 0x2963188c <+60>: add r2,r2 0x2963188e <+62>: add #12,r2 0x29631890 <+64>: add r2,r4 0x29631892 <+66>: add r2,r5 0x29631894 <+68>: mov r1,r2 0x29631896 <+70>: mov #-1,r3 0x29631898 <+72>: add #-1,r1 0x2963189a <+74>: cmp/ge r3,r1 0x2963189c <+76>: bf.s 0x2963193c 0x2963189e <+78>: add #1,r2 0x296318a0 <+80>: dt r2 0x296318a2 <+82>: bt.s 0x296318ba 0x296318a4 <+84>: cmp/pz r7 0x296318a6 <+86>: add #-2,r4 0x296318a8 <+88>: add #-2,r5 0x296318aa <+90>: mov.w @r4,r1 0x296318ac <+92>: mov.w @r5,r3 0x296318ae <+94>: sub r3,r1 0x296318b0 <+96>: exts.w r1,r1 0x296318b2 <+98>: tst r1,r1 0x296318b4 <+100>: bt.s 0x296318a0 0x296318b6 <+102>: cmp/pz r7 0x296318b8 <+104>: mov r1,r8 0x296318ba <+106>: bt 0x296318be 0x296318bc <+108>: neg r8,r8 0x296318be <+110>: mov #5,r1 0x296318c0 <+112>: cmp/hi r1,r6 0x296318c2 <+114>: bf 0x296318f8 0x296318c4 <+116>: cmp/pz r8 0x296318c6 <+118>: bt 0x29631914 0x296318c8 <+120>: mov.l 0x296318f0 ,r0 ! 0= xa70 0x296318ca <+122>: mov.l @(r0,r12),r0 0x296318cc <+124>: mov.l @r0,r1 0x296318ce <+126>: add #1,r1 0x296318d0 <+128>: mov.l r1,@r0 0x296318d2 <+130>: mov.l @r15+,r12 0x296318d4 <+132>: rts 0x296318d6 <+134>: mov.l @r15+,r8 0x296318d8 <+136>: mov.l 0x296318f4 ,r0 ! 0= x8b8 0x296318da <+138>: mov.l @(r0,r12),r0 0x296318dc <+140>: mov.l @r0,r1 0x296318de <+142>: add #1,r1 0x296318e0 <+144>: mov.l r1,@r0 0x296318e2 <+146>: mov.l @r15+,r12 0x296318e4 <+148>: rts 0x296318e6 <+150>: mov.l @r15+,r8 =3D> 0x296318e8 <+152>: mov.l r9,@(16,r13) 0x296318ea <+154>: mov.b @(r0,r3),r0 0x296318ec <+156>: .word 0x0000 0x296318ee <+158>: .word 0x0100 0x296318f0 <+160>: .word 0x0a70 0x296318f2 <+162>: .word 0x0000 0x296318f4 <+164>: .word 0x08b8 0x296318f6 <+166>: .word 0x0000 0x296318f8 <+168>: mova 0x29631904 ,r0 0x296318fa <+170>: add r6,r6 0x296318fc <+172>: mov.w @(r0,r6),r6 0x296318fe <+174>: braf r6 0x29631900 <+176>: nop 0x29631902 <+178>: nop 0x29631904 <+180>: mov.l @(r0,r0),r0 0x29631906 <+182>: stc vbr,r0 0x29631908 <+184>: mov.l @(r0,r5),r0 0x2963190a <+186>: .word 0x0032 0x2963190c <+188>: sts pr,r0 0x2963190e <+190>: .word 0xffc2 0x29631910 <+192>: cmp/pz r8 0x29631912 <+194>: bt 0x296318c8 0x29631914 <+196>: mov.l 0x29631950 ,r0 ! 0= xb80 0x29631916 <+198>: mov.l @(r0,r12),r0 0x29631918 <+200>: mov.l @r0,r1 0x2963191a <+202>: add #1,r1 0x2963191c <+204>: mov.l r1,@r0 0x2963191e <+206>: mov.l @r15+,r12 0x29631920 <+208>: rts 0x29631922 <+210>: mov.l @r15+,r8 0x29631924 <+212>: cmp/pl r8 0x29631926 <+214>: bt 0x296318c8 0x29631928 <+216>: bra 0x29631914 0x2963192a <+218>: nop 0x2963192c <+220>: cmp/pl r8 0x2963192e <+222>: bt 0x29631914 0x29631930 <+224>: bra 0x296318c8 0x29631932 <+226>: nop 0x29631934 <+228>: tst r8,r8 0x29631936 <+230>: bf 0x29631914 0x29631938 <+232>: bra 0x296318c8 0x2963193a <+234>: nop 0x2963193c <+236>: bra 0x296318a0 0x2963193e <+238>: mov #1,r2 0x29631940 <+240>: cmp/hi r1,r6 0x29631942 <+242>: bt 0x296318e8 0x29631944 <+244>: mova 0x29631954 ,r0 0x29631946 <+246>: add r6,r6 0x29631948 <+248>: mov.w @(r0,r6),r6 0x2963194a <+250>: braf r6 0x2963194c <+252>: nop 0x2963194e <+254>: nop 0x29631950 <+256>: .word 0x0b80 0x29631952 <+258>: .word 0x0000 0x29631954 <+260>: .word 0xff7a 0x29631956 <+262>: .word 0xffc6 0x29631958 <+264>: .word 0xffc6 0x2963195a <+266>: .word 0xff7a 0x2963195c <+268>: .word 0xff7a 0x2963195e <+270>: .word 0xffc6 0x29631960 <+272>: tst r8,r8 0x29631962 <+274>: bf 0x296318c8 0x29631964 <+276>: bra 0x29631914 0x29631966 <+278>: nop End of assembler dump. C source of function can be found here: https://sources.debian.org/src/python3.9/3.9.0-1/Objects/longobject.c/?hl= =3D3031#L3031=