public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/63718] New: ARM Thumb1 bootstrap fail after fuse-caller-save info in cprop-hardreg
@ 2014-11-03  7:32 joey.ye at arm dot com
  2014-11-03  8:15 ` [Bug rtl-optimization/63718] " joey.ye at arm dot com
                   ` (16 more replies)
  0 siblings, 17 replies; 18+ messages in thread
From: joey.ye at arm dot com @ 2014-11-03  7:32 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 63718
           Summary: ARM Thumb1 bootstrap fail after fuse-caller-save info
                    in cprop-hardreg
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: joey.ye at arm dot com

architecture option: --with-arch=armv4t --with-mode=thumb
BOOT_CFLAGS="-O2 -g"

(Stage2) Error message:
src/gcc/trunk/libgcc/libgcc2.c: In function ‘__mulvdi3’:
src/gcc/trunk/libgcc/libgcc2.h:209:20: internal compiler error: Segmentation
fault

First bad version: trunk@216365
Date:   Fri Oct 17 06:36:45 2014 +0000

    Use fuse-caller-save info in cprop-hardreg

    2014-10-17  Tom de Vries  <tom@codesourcery.com>

        PR rtl-optimization/61605
        * regcprop.c (copyprop_hardreg_forward_1): Use
        regs_invalidated_by_this_call instead of regs_invalidated_by_call.

        * gcc.target/i386/fuse-caller-save.c: Update addition check.  Add movl
        absence check.
>From gcc-bugs-return-465606-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Nov 03 08:13:37 2014
Return-Path: <gcc-bugs-return-465606-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 18044 invoked by alias); 3 Nov 2014 08:13:35 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 17995 invoked by uid 48); 3 Nov 2014 08:13:30 -0000
From: "joey.ye at arm dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/63718] ARM Thumb1 bootstrap fail after fuse-caller-save info in cprop-hardreg
Date: Mon, 03 Nov 2014 08:13:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: rtl-optimization
X-Bugzilla-Version: 5.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: joey.ye at arm dot com
X-Bugzilla-Status: UNCONFIRMED
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: <bug-63718-4-FEE3rgk39y@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-63718-4@http.gcc.gnu.org/bugzilla/>
References: <bug-63718-4@http.gcc.gnu.org/bugzilla/>
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: 2014-11/txt/msg00078.txt.bz2
Content-length: 1322

https://gcc.gnu.org/bugzilla/show_bug.cgi?idc718

--- Comment #1 from Joey Ye <joey.ye at arm dot com> ---
Challenging to reduce a small case, as inlining impacts optimization behavior.
Trying to describe the problem as clear as possible.

Problemetic generated code:
        mov     r0, r10
        mov     r1, r3
        mov     r2, r8
        str     r3, [sp, #8]
        bl      _ZL17bmp_iter_set_init
        mov     r3, r9
        ldr     r4, [r0, #12]   <--- r0 is used after call, which is clobbered
implicitly

_ZL17bmp_iter_set_init:
        ...
        pop     {r4}
        pop     {r0}     <--- clobbering r0, which is implicit from RTL view
        bx      r0

Prototype of bmp_iter_set_init:
static inline void  <--- return void
bmp_iter_set_init (bitmap_iterator *bi, const_bitmap map,
                   unsigned start_bit, unsigned *bit_no)

1. thumb1 (arch=armv4t) sometimes clobbers r0-r3 on return, with logic in
arm.c:thumb_exit

2. Behavior in 1 is implicit to RTL. A typical thumb1 return RTL will be
(jump_insn (unspec_volatile [
            (return)
        ] VUNSPEC_EPILOGUE))

3. Other RTLs in caller do not modifies all r0-r3

4. After 216365 copyprop_hardreg_forward_1 believes r0-r3 are not clobbered
during call. Bang!

Attached reduced RTL dump of cprop_hardreg and the previous pass.


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2014-12-02 17:18 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-03  7:32 [Bug rtl-optimization/63718] New: ARM Thumb1 bootstrap fail after fuse-caller-save info in cprop-hardreg joey.ye at arm dot com
2014-11-03  8:15 ` [Bug rtl-optimization/63718] " joey.ye at arm dot com
2014-11-03  8:16 ` joey.ye at arm dot com
2014-11-03  8:38 ` joey.ye at arm dot com
2014-11-03  9:19 ` [Bug rtl-optimization/63718] [5 Regression] " rguenth at gcc dot gnu.org
2014-11-03 10:17 ` vries at gcc dot gnu.org
2014-11-03 10:26 ` joey.ye at arm dot com
2014-11-04  1:46 ` joey.ye at arm dot com
2014-11-10  1:57 ` joey.ye at arm dot com
2014-11-10  7:50 ` vries at gcc dot gnu.org
2014-11-18 15:08 ` vries at gcc dot gnu.org
2014-11-18 15:09 ` vries at gcc dot gnu.org
2014-11-19 17:44 ` vries at gcc dot gnu.org
2014-11-20  2:34 ` joey.ye at arm dot com
2014-11-20 12:46 ` rguenth at gcc dot gnu.org
2014-11-24 17:06 ` vries at gcc dot gnu.org
2014-12-02 14:13 ` joey.ye at arm dot com
2014-12-02 17:18 ` vries at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).