public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Michael Matz <matz@suse.de>
To: Dominique Dhumieres <dominiq@lps.ens.fr>
Cc: paul.richard.thomas@gmail.com, gcc-patches@gcc.gnu.org,
	fortran@gcc.gnu.org
Subject: Re: Implement stack arrays even for unknown sizes
Date: Fri, 15 Apr 2011 12:38:00 -0000	[thread overview]
Message-ID: <Pine.LNX.4.64.1104151428390.1989@wotan.suse.de> (raw)
In-Reply-To: <20110414210403.F14F23BE18@mailhost.lps.ens.fr>

Hi,

On Thu, 14 Apr 2011, Dominique Dhumieres wrote:

> I have forgotten to mentionned that I have a variant of fatigue
> in which I have done the inlining manually along with few other
> optimizations and the timing for it is
> 
> [macbook] lin/test% gfc -Ofast fatigue_v8.f90
> [macbook] lin/test% time a.out > /dev/null
> 2.793u 0.002s 0:02.79 100.0%	0+0k 0+1io 0pf+0w
> [macbook] lin/test% gfc -Ofast -fwhole-program fatigue_v8.f90
> [macbook] lin/test% time a.out > /dev/null
> 2.680u 0.003s 0:02.68 100.0%	0+0k 0+2io 0pf+0w
> [macbook] lin/test% gfc -Ofast -fwhole-program -flto fatigue_v8.f90
> [macbook] lin/test% time a.out > /dev/null
> 2.671u 0.002s 0:02.67 100.0%	0+0k 0+2io 0pf+0w
> [macbook] lin/test% gfc -Ofast -fwhole-program -fstack-arrays fatigue_v8.f90
> [macbook] lin/test% time a.out > /dev/null
> 2.680u 0.003s 0:02.68 100.0%	0+0k 0+2io 0pf+0w
> [macbook] lin/test% gfc -Ofast -fwhole-program -flto -fstack-arrays fatigue_v8.f90
> [macbook] lin/test% time a.out > /dev/null
> 2.677u 0.003s 0:02.68 99.6%	0+0k 0+0io 0pf+0w
> 
> So the timing of the original code with 
> -Ofast -finline-limit=600 -fwhole-program -flto -fstack-arrays
> is quite close to this lower bound.
> 
> I have also looked at the failure for gfortran.dg/elemental_dependency_1.f90
> and it seems due to a spurious integer(kind=4) A.37[4]; (and friends) in

Yes, this is due to the DECL_EXPR statement which is rendered by the 
dumper just the same as a normal decl.  The testcase looks for exactly one 
such decl, but with -fstack-arrays there are exactly two for each such 
array.

>     integer(kind=4) A.37[4];

So, this is the normal decl.

>     atmp.36.dim[0].ubound = 3;
>         integer(kind=4) A.37[4];

And this is the DECL_EXPR statement, which then actually is transformed 
into the stack_save/alloca/stack_restore sequence.


Ciao,
Michael.

  reply	other threads:[~2011-04-15 12:31 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-09 10:08 Dominique Dhumieres
2011-04-09 12:17 ` Paul Richard Thomas
2011-04-10 13:29   ` Dominique Dhumieres
2011-04-11 11:49     ` Michael Matz
2011-04-11 11:58       ` Axel Freyn
2011-04-11 13:35       ` Eric Botcazou
2011-04-11 14:06         ` Dominique Dhumieres
2011-04-11 14:59         ` Michael Matz
2011-04-11 16:04   ` Michael Matz
2011-04-11 16:45     ` Steven Bosscher
2011-04-12 11:54       ` Michael Matz
2011-04-12 12:42         ` N.M. Maclaren
2011-04-11 16:46     ` Dominique Dhumieres
2011-04-11 16:59     ` H.J. Lu
2011-04-11 17:06       ` N.M. Maclaren
2011-04-11 18:28     ` Tobias Burnus
2011-04-11 21:18     ` Dominique Dhumieres
2011-04-12  6:23     ` Paul Richard Thomas
2011-04-12  6:35       ` Dominique Dhumieres
2011-04-13  9:42         ` Paul Richard Thomas
2011-04-13 10:38           ` Richard Guenther
2011-04-13 11:13             ` Richard Guenther
2011-04-14 13:32               ` Dominique Dhumieres
2011-04-13 13:46             ` Paul Richard Thomas
2011-04-14 13:59         ` Michael Matz
2011-04-14 15:28           ` Michael Matz
2011-04-14 19:29             ` Dominique Dhumieres
2011-04-15  2:01             ` Dominique Dhumieres
2011-04-15 12:38               ` Michael Matz [this message]
2011-04-15 14:06                 ` Dominique Dhumieres
2011-04-15 15:19                   ` Michael Matz
2011-04-15 15:26                     ` Jerry DeLisle
2011-04-15 22:41                       ` Michael Matz
2011-04-14 20:23     ` Tobias Burnus
2011-04-14 20:30       ` Tobias Burnus
  -- strict thread matches above, loose matches on Subject: below --
2011-04-08 21:29 Michael Matz
2011-04-09  8:21 ` N.M. Maclaren
2011-04-09  8:51   ` Magnus Fromreide
2011-04-09  9:02   ` Eric Botcazou
2011-04-09  9:49     ` N.M. Maclaren

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=Pine.LNX.4.64.1104151428390.1989@wotan.suse.de \
    --to=matz@suse.de \
    --cc=dominiq@lps.ens.fr \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=paul.richard.thomas@gmail.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).