From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25512 invoked by alias); 24 Dec 2011 12:20:58 -0000 Received: (qmail 25494 invoked by uid 22791); 24 Dec 2011 12:20:56 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_VZ,TW_ZJ,TW_ZW X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 24 Dec 2011 12:20:43 +0000 From: "ubizjak at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/51667] [4.7 Regression] new FAIL: 27_io/basic_*stream/* execution test with -m32 Date: Sat, 24 Dec 2011 12:23:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ubizjak at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.7.0 X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-12/txt/msg02594.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51667 --- Comment #7 from Uros Bizjak 2011-12-24 12:20:24 UTC --- REE pass miscompiles std::ostream::operator<<(short): Dump of assembler code for function std::ostream::operator<<(short): => 0x001998f0 <+0>: push %ebx 0x001998f1 <+1>: sub $0x18,%esp 0x001998f4 <+4>: call 0x156e4b <__x86.get_pc_thunk.bx> 0x001998f9 <+9>: add $0x5a6fb,%ebx 0x001998ff <+15>: mov 0x20(%esp),%edx 0x00199903 <+19>: movzwl 0x24(%esp),%ecx 0x00199908 <+24>: mov %edx,(%esp) 0x0019990b <+27>: mov %ecx,0x4(%esp) 0x0019990f <+31>: call 0x154630 <_ZNSo9_M_insertIlEERSoT_@plt> 0x00199914 <+36>: add $0x18,%esp 0x00199917 <+39>: pop %ebx 0x00199918 <+40>: ret End of assembler dump. This is without REE pass: Dump of assembler code for function std::ostream::operator<<(short): => 0x00199960 <+0>: push %ebx 0x00199961 <+1>: sub $0x18,%esp 0x00199964 <+4>: mov 0x20(%esp),%edx 0x00199968 <+8>: call 0x156e4b <__x86.get_pc_thunk.bx> 0x0019996d <+13>: add $0x5b687,%ebx 0x00199973 <+19>: movzwl 0x24(%esp),%ecx 0x00199978 <+24>: mov (%edx),%eax 0x0019997a <+26>: mov -0xc(%eax),%eax 0x0019997d <+29>: mov 0xc(%edx,%eax,1),%eax 0x00199981 <+33>: and $0x4a,%eax 0x00199984 <+36>: cmp $0x8,%eax 0x00199987 <+39>: je 0x1999a8 0x00199989 <+41>: cmp $0x40,%eax 0x0019998c <+44>: je 0x1999a8 0x0019998e <+46>: movswl %cx,%ecx 0x00199991 <+49>: mov %ecx,0x4(%esp) 0x00199995 <+53>: mov %edx,(%esp) 0x00199998 <+56>: call 0x154630 <_ZNSo9_M_insertIlEERSoT_@plt> 0x0019999d <+61>: add $0x18,%esp 0x001999a0 <+64>: pop %ebx 0x001999a1 <+65>: ret 0x001999a2 <+66>: lea 0x0(%esi),%esi 0x001999a8 <+72>: movzwl %cx,%ecx 0x001999ab <+75>: mov %ecx,0x4(%esp) 0x001999af <+79>: mov %edx,(%esp) 0x001999b2 <+82>: call 0x154630 <_ZNSo9_M_insertIlEERSoT_@plt> 0x001999b7 <+87>: add $0x18,%esp 0x001999ba <+90>: pop %ebx 0x001999bb <+91>: ret End of assembler dump. Just break at _ZNSolsEs to see wrong code in action. Please also note movsl in good code.