This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/33732] gcc.c-torture/execute/longlong.c execution at -O3
- From: "danglin at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Oct 2007 00:43:55 -0000
- Subject: [Bug tree-optimization/33732] gcc.c-torture/execute/longlong.c execution at -O3
- References: <bug-33732-276@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from danglin at gcc dot gnu dot org 2007-10-22 00:43 -------
The actual code that is wrong is the following:
0x00010670 <main+176>: ldw 10(r20),r19
0x00010674 <main+180>: uaddcm r0,r23,r21
0x00010678 <main+184>: uaddcm r0,r24,r22
0x0001067c <main+188>: depw,z r19,30,31,r19
0x00010680 <main+192>: subi 1f,r22,r21
0x00010684 <main+196>: mtsar r21
0x00010688 <main+200>: depw,z r19,sar,32,r19
0x0001068c <main+204>: b,l 0x10648 <main+136>,r0
0x00010690 <main+208>: or r19,r21,r21
The 4.2 code is:
0x00010650 <main+192>: uaddcm r0,r21,ret0
0x00010654 <main+196>: uaddcm r0,r22,ret1
0x00010658 <main+200>: mtsar r22
0x0001065c <main+204>: ldw 10(r20),r20
0x00010660 <main+208>: ldw 4(r31),r19
0x00010664 <main+212>: subi 1f,ret1,ret1
0x00010668 <main+216>: shrpw r0,r19,sar,r24
0x0001066c <main+220>: depw,z r20,30,31,ret0
0x00010670 <main+224>: mtsar ret1
0x00010674 <main+228>: depw,z ret0,sar,32,ret0
0x00010678 <main+232>: b,l 0x10628 <main+152>,r0
0x0001067c <main+236>: or ret0,r24,r24
The 4.3 code is missing the load at 0x00010660 and the shift at
0x00010668. Also, the shift amount somehow ends up being or'ed
into the result of the calculation (r21), leading to the abort.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33732