public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "toon at moene dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/42108] [4.4/4.5 Regression] Vectorizer cannot deal with PAREN_EXPR gracefully, 50% performance regression
Date: Fri, 20 Nov 2009 19:45:00 -0000	[thread overview]
Message-ID: <20091120194530.25666.qmail@sourceware.org> (raw)
In-Reply-To: <bug-42108-9410@http.gcc.gnu.org/bugzilla/>



------- Comment #13 from toon at moene dot org  2009-11-20 19:45 -------
> The funny conditional initialization of countm1.6 makes the analysis of
> the number of iterations of this loop impossible (not to mention the
> conversions to character(kind=4)).

> Why does the frontend do induction variable "optimization" at all and
> not simply generate a loop with a non-unit counting IV?

It's not trying to be funny - it just follows the text of the Fortran Standard
(hey, what a concept !):

12   8.1.6.6.1    Loop initiation
13 1 When the DO statement is executed, the DO construct becomes active. If
loop-control is
14 2     [ , ] do-variable = scalar-int-expr 1 , scalar-int-expr 2 [ ,
scalar-int-expr 3 ]
15 3 the following steps are performed in sequence.
16          (1)    The initial parameter m1 , the terminal parameter m2 , and
the incrementation parameter m3 are
17                 of type integer with the same kind type parameter as the
do-variable. Their values are established
18                 by evaluating scalar-int-expr 1 , scalar-int-expr 2 , and
scalar-int-expr 3 , respectively, including, if ne-
19                 cessary, conversion to the kind type parameter of the
do-variable according to the rules for numeric
20                 conversion (Table 7.11). If scalar-int-expr 3 does not
appear, m3 has the value 1. The value of m3
21                 shall not be zero.
22          (2)    The DO variable becomes defined with the value of the
initial parameter m1 .
23          (3)    The iteration count is established and is the value of the
expression (m2 - m1 + m3 )/m3 , unless that
24                 value is negative, in which case the iteration count is 0.

Only interprocedural analysis can tell us that this is a simple loop only
executed 3 times (I got this wrong at first - it's *always* executed 3 times).


-- 


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


  parent reply	other threads:[~2009-11-20 19:45 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-19 16:01 [Bug fortran/42108] New: Performance drop from 4.3 to 4.4/4.5 sfilippone at uniroma2 dot it
2009-11-19 16:01 ` [Bug fortran/42108] " sfilippone at uniroma2 dot it
2009-11-19 16:50 ` [Bug tree-optimization/42108] [4.4/4.5 Regression] Vectorizer cannot deal with PAREN_EXPR gracefully, 50% performance regression rguenth at gcc dot gnu dot org
2009-11-19 17:17 ` sfilippone at uniroma2 dot it
2009-11-19 17:30 ` rguenther at suse dot de
2009-11-19 19:42 ` sfilippone at uniroma2 dot it
2009-11-19 19:53 ` toon at moene dot org
2009-11-19 22:33 ` anlauf at gmx dot de
2009-11-20  8:32 ` sfilippone at uniroma2 dot it
2009-11-20 13:45 ` dominiq at lps dot ens dot fr
2009-11-20 14:04 ` sfilippone at uniroma2 dot it
2009-11-20 14:12 ` sfilippone at uniroma2 dot it
2009-11-20 14:14 ` rguenth at gcc dot gnu dot org
2009-11-20 19:45 ` toon at moene dot org [this message]
2009-11-20 23:48 ` rguenth at gcc dot gnu dot org
2009-11-21 12:11 ` toon at moene dot org
2009-11-21 12:19 ` rguenther at suse dot de
2009-11-21 13:58 ` rguenth at gcc dot gnu dot org
2009-11-23  9:02 ` irar at il dot ibm dot com
2009-11-27 11:23 ` rguenth at gcc dot gnu dot org
2009-11-30  8:53 ` irar at il dot ibm dot com
2009-11-30  8:54 ` irar at il dot ibm dot com
2009-11-30 10:13 ` rguenther at suse dot de
2009-11-30 12:21 ` irar at il dot ibm dot com
2009-12-04 14:25 ` [Bug tree-optimization/42108] [4.4/4.5 Regression] " dominiq at lps dot ens dot fr
2009-12-13 23:48 ` matz at gcc dot gnu dot org
2009-12-14  4:55 ` matz at gcc dot gnu dot org
2009-12-14  5:26 ` matz at gcc dot gnu dot org
2009-12-14 10:51 ` dominiq at lps dot ens dot fr
2009-12-14 11:21 ` dominiq at lps dot ens dot fr
2009-12-14 11:23 ` rguenth at gcc dot gnu dot org
2009-12-14 11:50 ` rguenth at gcc dot gnu dot org
2009-12-14 12:27 ` rguenther at suse dot de
2009-12-14 12:30 ` rguenth at gcc dot gnu dot org
2009-12-14 12:58 ` rguenth at gcc dot gnu dot org
2009-12-14 16:58 ` matz at gcc dot gnu dot org
2009-12-15  7:10 ` tkoenig at gcc dot gnu dot org
2009-12-15 11:08 ` rguenth at gcc dot gnu dot org
2009-12-18 15:43 ` rguenth at gcc dot gnu dot org
2009-12-18 21:04 ` dominiq at lps dot ens dot fr
2009-12-18 21:40 ` matz at gcc dot gnu dot org
2009-12-18 23:44 ` rguenth at gcc dot gnu dot org
2009-12-19 11:25 ` rguenth at gcc dot gnu dot org
2009-12-19 19:29 ` rguenth at gcc dot gnu dot org
2009-12-19 19:41 ` rguenth at gcc dot gnu dot org
2009-12-19 21:10 ` rguenth at gcc dot gnu dot org
2010-01-21 13:15 ` jakub at gcc dot gnu dot org
2010-04-05 12:53 ` steven at gcc dot gnu dot org
2010-04-05 12:54 ` rguenther at suse dot de
2010-04-05 12:57 ` rguenther at suse dot de
2010-04-05 13:02 ` steven at gcc dot gnu dot org
2010-04-05 14:23 ` rguenth at gcc dot gnu dot org
2010-04-30  8:55 ` [Bug tree-optimization/42108] [4.4/4.5/4.6 " jakub at gcc dot gnu dot 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=20091120194530.25666.qmail@sourceware.org \
    --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).