This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/29543] Poor code generated for arrays with variable bounds
- From: "ebotcazou at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Oct 2006 06:45:14 -0000
- Subject: [Bug tree-optimization/29543] Poor code generated for arrays with variable bounds
- References: <bug-29543-318@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from ebotcazou at gcc dot gnu dot org 2006-10-22 06:45 -------
> The test case that has been attached shows a FORTRAN and Ada program that are
> equivalent (within their matrix multiply loop). The Ada one runs about 2x
> slower with about 3x the number of machine instructions in the inner loop.
Why do you go through an indirection in Ada? Just write:
type Real_Matrix is array(Integer range <>,Integer range <>) of Float;
N : Positive := Positive'Value (Argument (1));
G : Ada.Numerics.Float_Random.Generator;
A,B,C : Real_Matrix (1..N, 1..N);
Start, Finish : Ada.Calendar.Time;
Sum : Float := 0.0;
and you'll probably significantly narrow the gap.
--
ebotcazou at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ebotcazou at gcc dot gnu dot
| |org
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2006-10-22 06:45:13
date| |
Summary|Ada produces substantially |Poor code generated for
|slower code than FORTRAN for|arrays with variable bounds
|identical inputs - looping |
|over double subscripted |
|arrays |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29543