public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "linux at carewolf dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/60788] Miscompilation of __builtin_clz with -mlzcnt
Date: Tue, 08 Apr 2014 16:27:00 -0000	[thread overview]
Message-ID: <bug-60788-4-jEAGc36xkW@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-60788-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60788

--- Comment #1 from Allan Jensen <linux at carewolf dot com> ---
Sorry. The optimization has nothing to do with it, it just causes the constant
expressions used for testing to be evaluated at compile time.

The real issue is that the lzcnt instruction does not return the number of
leading zeroes, but the bitwidth minus the number of leading zeroes. So the
mapping of _builtin_clz to lzcnt is simply naïve and incorrect.
>From gcc-bugs-return-448548-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Apr 08 16:31:29 2014
Return-Path: <gcc-bugs-return-448548-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 7130 invoked by alias); 8 Apr 2014 16:31:29 -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 7080 invoked by uid 48); 8 Apr 2014 16:31:26 -0000
From: "murali.marimekala at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/60459] Crash seen in _Unwind_VRS_Pop() for ARM platform
Date: Tue, 08 Apr 2014 16:31: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.2.1
X-Bugzilla-Keywords:
X-Bugzilla-Severity: critical
X-Bugzilla-Who: murali.marimekala at gmail dot com
X-Bugzilla-Status: WAITING
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: cc
Message-ID: <bug-60459-4-0aVh2wjLzY@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-60459-4@http.gcc.gnu.org/bugzilla/>
References: <bug-60459-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-04/txt/msg00568.txt.bz2
Content-length: 1380

http://gcc.gnu.org/bugzilla/show_bug.cgi?id`459

Murali <murali.marimekala at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |murali.marimekala at gmail dot com

--- Comment #5 from Murali <murali.marimekala at gmail dot com> ---
Hi Ramana,

I am working with Raghu and looking into the same crash issue.

Thanks for your suggestions till now. Due to some constraints , we cant move to
a new toolchain. We are looking forward to fix this issue in ARM9 toolchain
4.2.1.

Though we got a fix for this issue online, we need your expertise to port it to
our toolchain.

When we were searching for inputs, we came across following article.
https://sourceware.org/ml/libc-ports/2011-03/msg00045.html

In this article,  Ryosei Takagi was facing the same issue (at exact location)
and has provided a fix for it in __longjump.S.

This particular __longjump.S is not available in toolchain 4.2.1. I searched
for relevant code and couldnt find it.

Since we are not much familiar with this toolchain code, its taking more time
than expected to understand and port the code. So, need your valuable advise to
find the relevant location to port this fix.

If you need additional information, please let me know.

Thank you,
Murali


  reply	other threads:[~2014-04-08 16:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-08 16:18 [Bug target/60788] New: " linux at carewolf dot com
2014-04-08 16:27 ` linux at carewolf dot com [this message]
2014-04-08 16:59 ` [Bug target/60788] " hjl.tools at gmail dot com
2014-04-08 17:52 ` linux at carewolf 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-60788-4-jEAGc36xkW@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).