From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 56744 invoked by alias); 10 Apr 2015 15:25:25 -0000 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 Received: (qmail 56653 invoked by uid 48); 10 Apr 2015 15:25:22 -0000 From: "evstupac at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/65710] [4.9/5 Regression] Thumb1 ICE caused by no register to spill Date: Fri, 10 Apr 2015 15:25:00 -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: 5.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: evstupac at gmail dot com X-Bugzilla-Status: REOPENED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.9.3 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-04/txt/msg00862.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65710 --- Comment #13 from Stupachenko Evgeny --- The issue reproduced with -march=corei7 as well. Currently the hottest loop looks as following: L1. mov (%esp),%ebp /* potentially redundant. */ and $0x7fff,%ebp movzwl 0x400(%esi,%ebp,2),%ecx mov %ecx,(%esp) cmp %ecx,0x4(%esp) /* Why not reuse ebp? */ jae 380 subl $0x1,0x8(%esp) je 380 mov (%esp),%ebp /* ebp could contain correct value (if reused above). */ add %edi,%ebp cmp 0x0(%ebp,%ebx,1),%al jne L1 movzbl 0xf(%esp),%edx cmp -0x1(%ebp,%ebx,1),%dl jne L1 Unnecessary fills and spills of ebp added. Before the patch the loop was 2 instruction shorter. L1. and $0x7fff,%edx movzwl 0x400(%esi,%edx,2),%edx cmp %edx,0x4(%esp) jae 3c0 sub $0x1,%ebp je 3c0 lea (%edi,%edx,1),%ecx movzbl (%esp),%eax cmp (%ecx,%ebx,1),%al jne L1 movzbl 0xb(%esp),%eax cmp -0x1(%ecx,%ebx,1),%al jne L1. Please let me know if you need dumps.