public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "ubizjak at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug go/61871] FAIL: regexp from libgo testsuite on non-split stack targets
Date: Sun, 16 Nov 2014 11:54:00 -0000	[thread overview]
Message-ID: <bug-61871-4-AbXiwxaXON@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-61871-4@http.gcc.gnu.org/bugzilla/>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="UTF-8", Size: 7899 bytes --]

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

--- Comment #5 from Uroš Bizjak <ubizjak at gmail dot com> ---
The testcase now fails also on i686-linux-gnu (Fedora 20, x86_64 with -m32):

runtime: memory allocated by OS (0xef4f1000) not in usable range
[0x18200000,0x98200000)
runtime: out of memory: cannot allocate 72744960-byte block (496762880 in use)
fatal error: out of memory

goroutine 32 [running]:
runtime_dopanic
    /home/uros/gcc-svn/trunk/libgo/runtime/panic.c:131
runtime_throw
    /home/uros/gcc-svn/trunk/libgo/runtime/panic.c:193
largealloc
    /home/uros/gcc-svn/trunk/libgo/runtime/malloc.goc:288
runtime_mallocgc
    /home/uros/gcc-svn/trunk/libgo/runtime/malloc.goc:234
__go_alloc
    /home/uros/gcc-svn/trunk/libgo/runtime/malloc.goc:332
__go_append
    /home/uros/gcc-svn/trunk/libgo/runtime/go-append.c:63
regexp.onePassCopy
   
/ssd/uros/gcc-build/x86_64-unknown-linux-gnu/32/libgo/gotest24887/test/onepass.go:227
regexp.compileOnePass
   
/ssd/uros/gcc-build/x86_64-unknown-linux-gnu/32/libgo/gotest24887/test/onepass.go:573
regexp.compile
   
/ssd/uros/gcc-build/x86_64-unknown-linux-gnu/32/libgo/gotest24887/test/regexp.go:168
regexp.Compile
   
/ssd/uros/gcc-build/x86_64-unknown-linux-gnu/32/libgo/gotest24887/test/regexp.go:118
regexp.MustCompile
   
/ssd/uros/gcc-build/x86_64-unknown-linux-gnu/32/libgo/gotest24887/test/regexp.go:219
regexp.TestOnePassCutoff
   
/ssd/uros/gcc-build/x86_64-unknown-linux-gnu/32/libgo/gotest24887/test/all_test.go:478
testing.tRunner
    /home/uros/gcc-svn/trunk/libgo/go/testing/testing.go:422
kickoff
    /home/uros/gcc-svn/trunk/libgo/runtime/proc.c:212
panic during panic

goroutine 32 [running]:
runtime_dopanic
    /home/uros/gcc-svn/trunk/libgo/runtime/panic.c:131
runtime_startpanic
    /home/uros/gcc-svn/trunk/libgo/runtime/panic.c:100
runtime_throw
    /home/uros/gcc-svn/trunk/libgo/runtime/panic.c:191
runtime_mallocgc
    /home/uros/gcc-svn/trunk/libgo/runtime/malloc.goc:121
__go_alloc
    /home/uros/gcc-svn/trunk/libgo/runtime/malloc.goc:332
callback
    /home/uros/gcc-svn/trunk/libgo/runtime/go-caller.c:50
dwarf_lookup_pc
    /home/uros/gcc-svn/trunk/libbacktrace/dwarf.c:2838
dwarf_fileline
    /home/uros/gcc-svn/trunk/libbacktrace/dwarf.c:2877
backtrace_pcinfo
    /home/uros/gcc-svn/trunk/libbacktrace/fileline.c:176
__go_file_line
    /home/uros/gcc-svn/trunk/libgo/runtime/go-caller.c:137
runtime_printcreatedby
    /home/uros/gcc-svn/trunk/libgo/runtime/proc.c:595
runtime_dopanic
    /home/uros/gcc-svn/trunk/libgo/runtime/panic.c:132
runtime_throw
    /home/uros/gcc-svn/trunk/libgo/runtime/panic.c:193
largealloc
    /home/uros/gcc-svn/trunk/libgo/runtime/malloc.goc:288
runtime_mallocgc
    /home/uros/gcc-svn/trunk/libgo/runtime/malloc.goc:234
__go_alloc
    /home/uros/gcc-svn/trunk/libgo/runtime/malloc.goc:332
__go_append
    /home/uros/gcc-svn/trunk/libgo/runtime/go-append.c:63
regexp.onePassCopy
   
/ssd/uros/gcc-build/x86_64-unknown-linux-gnu/32/libgo/gotest24887/test/onepass.go:227
regexp.compileOnePass
   
/ssd/uros/gcc-build/x86_64-unknown-linux-gnu/32/libgo/gotest24887/test/onepass.go:573
regexp.compile
   
/ssd/uros/gcc-build/x86_64-unknown-linux-gnu/32/libgo/gotest24887/test/regexp.go:168
regexp.Compile
   
/ssd/uros/gcc-build/x86_64-unknown-linux-gnu/32/libgo/gotest24887/test/regexp.go:118
regexp.MustCompile
   
/ssd/uros/gcc-build/x86_64-unknown-linux-gnu/32/libgo/gotest24887/test/regexp.go:219
regexp.TestOnePassCutoff
   
/ssd/uros/gcc-build/x86_64-unknown-linux-gnu/32/libgo/gotest24887/test/all_test.go:478
testing.tRunner
    /home/uros/gcc-svn/trunk/libgo/go/testing/testing.go:422
kickoff
    /home/uros/gcc-svn/trunk/libgo/runtime/proc.c:212
stack trace unavailable
FAIL: regexp
>From gcc-bugs-return-466947-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Nov 16 12:20:11 2014
Return-Path: <gcc-bugs-return-466947-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 29763 invoked by alias); 16 Nov 2014 12:20:10 -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 29689 invoked by uid 48); 16 Nov 2014 12:20:04 -0000
From: "gcc-bugzilla at mkarcher dot dialup.fu-berlin.de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/63783] [4.9/5 Regression] [SH] Miscompilation of boolean negation on SH4 using -O2
Date: Sun, 16 Nov 2014 12:20: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: 4.9.1
X-Bugzilla-Keywords: wrong-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: gcc-bugzilla at mkarcher dot dialup.fu-berlin.de
X-Bugzilla-Status: NEW
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: attachments.created
Message-ID: <bug-63783-4-GkKmutpIdU@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-63783-4@http.gcc.gnu.org/bugzilla/>
References: <bug-63783-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/msg01419.txt.bz2
Content-length: 2164

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

--- Comment #10 from Michael Karcher <gcc-bugzilla at mkarcher dot dialup.fu-berlin.de> ---
Created attachment 33991
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id3991&actioníit
Fix logical negation of registers, SImode only

In fact, it turns out, you were right. I implemented the solution you suggest
(quite hacky, as I only implemented it for SImode, I was too lazy to look up
whether there are nice patterns for testing DImode operands into T), and
compared assembler outputs. In fact, the duplicate test instruction is NOT
eliminated in my first patch, but it is with your code after fixing.

So the approach of special-casing compare-to-zero seems to have a positive
effect.

Assembler output:

buggy:
        tst     r4,r4
        bf      .L2      ; initial if, jumps if "flag" is nonzero
; Branch for zero "flag"
        mov.l   .L10,r1  ; loads address of val
        mov.l   @r1,r1   ; loads value of val
; Common code for zero or non-zero flag
.L3:
        tst     r1,r1    ; combined test
        bt      .L8      ; if zero, skip increment
        mov.l   .L11,r2  ; load address of true_count
        mov.l   @r2,r1   ; load, increment, store true_count
        add     #1,r1
        mov.l   r1,@r2
; Label for skipping increment of true_count
.L8:
        rts
        .align 1
; branch for non-zero "flag"
.L2:
        mov.l   .L12,r1  ; load address of decision_result
        mov.l   @r1,r1   ; load data of decision_result
        tst     r1,r1    ; tst/movt logical negation before
        bra     .L3      ; jumping to common code
        movt    r1


With my earlier patch removing the "compare-to-zero" logic completely, the
assembler output changes as following (CAPS comments on changes):

...
        mov.l   @r1,r1   ; loads value of val
        tst     r1,r1    ; TEST ONLY FOR FLAG == 0
; Common code for zero or non-zero flag
.L3:
        bt      .L8      ; if zero, skip increment
...
        tst     r1,r1    ; tst/movt logical negation before
        movt    r1
        bra     .L3      ; jumping to common code
        tst     r1,r1    ; TEST ONLY FOR FLAG != 0


  parent reply	other threads:[~2014-11-16 11:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-61871-4@http.gcc.gnu.org/bugzilla/>
2014-08-05 14:31 ` ubizjak at gmail dot com
2014-08-07 11:58 ` ubizjak at gmail dot com
2014-08-07 12:13 ` ubizjak at gmail dot com
2014-08-07 13:38 ` ubizjak at gmail dot com
2014-11-16 11:54 ` ubizjak at gmail dot com [this message]
2015-01-05 16:13 ` ian at gcc dot gnu.org
2015-01-05 23:16 ` ubizjak at gmail dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-61871-4-AbXiwxaXON@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).