public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Kyrill Tkachov <kyrylo.tkachov@arm.com>
To: GCC Patches <gcc-patches@gcc.gnu.org>
Cc: Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>,
	 Richard Earnshaw <Richard.Earnshaw@arm.com>
Subject: Re: [PATCH][ARM] PR target/67929 Tighten vfp3_const_double_for_bits checks
Date: Mon, 26 Oct 2015 12:17:00 -0000	[thread overview]
Message-ID: <562E199F.3090801@arm.com> (raw)
In-Reply-To: <561E4941.6030204@arm.com>

Ping.

https://gcc.gnu.org/ml/gcc-patches/2015-10/msg01350.html
and the backport for 4.9/5
https://gcc.gnu.org/ml/gcc-patches/2015-10/msg01351.html

Thanks,
Kyrill


On 14/10/15 13:23, Kyrill Tkachov wrote:
> Hi all,
>
> This patch fixes the referenced PR by rewriting the vfp3_const_double_for_bits function in arm.c
> The function is supposed to accept positive CONST_DOUBLE rtxes whose value is an exact power of 2
> and whose log2 is between 1 and 32. That is values like 2.0, 4.0, 8.9, 16.0 etc...
>
> The current implementation seems to have been written under the assumption that exact_real_truncate returns
> false if the input value is not an exact integer, whereas in fact exact_real_truncate returns false if the
> truncation operation was not exact, which are different things. This would lead the function to accept any
> CONST_DOUBLE that can truncate to a power of 2, such as 4.9, 16.2 etc.
>
> In any case, I've rewritten this function and used the real_isinteger predicate to check if the real value
> is an exact integer.
>
> The testcase demonstrates the kind of wrong code that this patch addresses.
>
> This bug appears on GCC 5 and 4.9 as well, but due to the recent introduction of CONST_DOUBLE_REAL_VALUE
> this patch doesn't apply on those branches. I will soon post the backportable variant.
>
> Bootstrapped and tested on arm-none-linux-gnueabihf.
>
> Ok for trunk?
>
> Thanks,
> Kyrill
>
> 2015-10-12  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
>
>     PR target/67929
>     * config/arm/arm.c (vfp3_const_double_for_bits): Rewrite.
>     * config/arm/constraints.md (Dp): Update callsite.
>     * config/arm/predicates.md (const_double_vcvt_power_of_two): Likewise.
>
> 2015-10-12  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
>
>     PR target/67929
>     * gcc.target/arm/pr67929_1.c: New test.

  reply	other threads:[~2015-10-26 12:16 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-14 12:23 Kyrill Tkachov
2015-10-26 12:17 ` Kyrill Tkachov [this message]
2015-10-27 12:25 ` Ramana Radhakrishnan
2015-11-01 19:22   ` Yvan Roux
2015-11-02  8:38     ` Ramana Radhakrishnan
2015-11-02  8:51       ` Yvan Roux
2015-11-02  9:02         ` Christophe Lyon
2015-11-02  9:24           ` Ramana Radhakrishnan
2015-11-02  9:28             ` Yvan Roux
2015-11-02  9:30               ` Kyrill Tkachov
2015-11-02 11:36                 ` Kyrill Tkachov
2015-11-02 11:51                   ` Richard Earnshaw
2015-11-02  9:20       ` Kyrill Tkachov
2015-11-02  9:26         ` Ramana Radhakrishnan
2015-11-02 11:24           ` Richard Earnshaw

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=562E199F.3090801@arm.com \
    --to=kyrylo.tkachov@arm.com \
    --cc=Richard.Earnshaw@arm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=ramana.radhakrishnan@arm.com \
    /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).