public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/63599] "wrong" branch optimization with Ofast in a loop
Date: Mon, 20 Oct 2014 07:39:00 -0000	[thread overview]
Message-ID: <bug-63599-4-uUBAtnRyRg@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-63599-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
The tree level looks like this:
  t_13 = VEC_COND_EXPR <t_4 <= { 4.142135679721832275390625e-1,
4.142135679721832275390625e-1, 4.142135679721832275390625e-1,
4.142135679721832275390625e-1 }, t_4, _12>;
  ret_14 = VEC_COND_EXPR <t_4 > { 4.142135679721832275390625e-1,
4.142135679721832275390625e-1, 4.142135679721832275390625e-1,
4.142135679721832275390625e-1 }, { 7.85398185253143310546875e-1,
7.85398185253143310546875e-1, 7.85398185253143310546875e-1,
7.85398185253143310546875e-1 }, { 0.0, 0.0, 0.0, 0.0 }>;
  t_16 = _9 != 0 ? t_13 : t_4;
  ret_15 = _9 != 0 ? ret_14 : { 0.0, 0.0, 0.0, 0.0 };


>"movmskps	%xmm8, %edx"
> does not protect the code in the if block...
Yes it does just not the way you think it does.

Notice the last two statements are conditional expressions.

And that gets translated into the following:
    testl    %edx, %edx
    jne    .L9
    movaps    %xmm3, %xmm1
    pxor    %xmm2, %xmm2
.L9:

So if anything it is a missed optimization dealing with conditional moves with
vectors without a vector comparison.
>From gcc-bugs-return-464480-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Oct 20 07:39:48 2014
Return-Path: <gcc-bugs-return-464480-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 21144 invoked by alias); 20 Oct 2014 07:39:48 -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 20850 invoked by uid 55); 20 Oct 2014 07:39:44 -0000
From: "rguenther at suse dot de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/54488] tree loop invariant motion uses an excessive amount of memory
Date: Mon, 20 Oct 2014 07:44:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: tree-optimization
X-Bugzilla-Version: 4.8.0
X-Bugzilla-Keywords: memory-hog
X-Bugzilla-Severity: normal
X-Bugzilla-Who: rguenther at suse dot de
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-54488-4-RbaZEXwv7V@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-54488-4@http.gcc.gnu.org/bugzilla/>
References: <bug-54488-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-10/txt/msg01501.txt.bz2
Content-length: 638

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

--- Comment #6 from rguenther at suse dot de <rguenther at suse dot de> ---
On Sun, 19 Oct 2014, evgeniya.maenkova at gmail dot com wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?idT488
>
> --- Comment #5 from Evgeniya Maenkova <evgeniya.maenkova at gmail dot com> ---
> Also, I collect massif data and see no tree-ssa-lim in it (i mean in top
> contributors).
>
> So what do you think?
>
> (How did you measured 1,8Gb caused by lim? - this is for me to understand
> whether this bug is actual or not)

I basically watched 'top' with breakpoints at the start and end of LIM.


  reply	other threads:[~2014-10-20  7:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-20  7:35 [Bug tree-optimization/63599] New: " vincenzo.innocente at cern dot ch
2014-10-20  7:39 ` pinskia at gcc dot gnu.org [this message]
2014-10-20  9:17 ` [Bug target/63599] " vincenzo.innocente at cern dot ch
2014-10-20 10:07 ` glisse at gcc dot gnu.org
2014-10-20 17:29 ` jakub at gcc dot gnu.org
2024-03-12 23:06 ` pinskia at gcc dot gnu.org

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-63599-4-uUBAtnRyRg@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).