[Bug fortran/38181] calls to SIZE not optimized out of loops

2008-11-20 Thread jakub at gcc dot gnu dot org
--- Comment #8 from jakub at gcc dot gnu dot org 2008-11-20 12:07 --- Fixed. -- jakub at gcc dot gnu dot org changed: What|Removed |Added Status|NEW

[Bug fortran/38181] calls to SIZE not optimized out of loops

2008-11-20 Thread jv244 at cam dot ac dot uk
--- Comment #7 from jv244 at cam dot ac dot uk 2008-11-20 11:03 --- (In reply to comment #6) great.. thanks. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38181

[Bug fortran/38181] calls to SIZE not optimized out of loops

2008-11-20 Thread jakub at gcc dot gnu dot org
--- Comment #6 from jakub at gcc dot gnu dot org 2008-11-20 10:21 --- With this patch, I got: $ time ./test1 # 4.4 r142036 real0m3.291s user0m3.289s sys 0m0.002s $ time ./test2 # 4.4 r142037 real0m1.327s user0m1.325s sys 0m0.002s -- http://gcc.gnu.org/bugzi

[Bug fortran/38181] calls to SIZE not optimized out of loops

2008-11-20 Thread jakub at gcc dot gnu dot org
--- Comment #5 from jakub at gcc dot gnu dot org 2008-11-20 09:44 --- Subject: Bug 38181 Author: jakub Date: Thu Nov 20 09:42:35 2008 New Revision: 142037 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=142037 Log: PR fortran/38181 * trans-intrinsic.c (gfc_conv_in

[Bug fortran/38181] calls to SIZE not optimized out of loops

2008-11-20 Thread jv244 at cam dot ac dot uk
--- Comment #4 from jv244 at cam dot ac dot uk 2008-11-20 08:53 --- so I guess this is up to the front end to generate 'better' code for size -- jv244 at cam dot ac dot uk changed: What|Removed |Added ---

[Bug fortran/38181] calls to SIZE not optimized out of loops

2008-11-19 Thread jakub at gcc dot gnu dot org
--- Comment #3 from jakub at gcc dot gnu dot org 2008-11-19 22:32 --- Certainly in this case inlining size1 is a good idea and easily doable. The reason why the actual argument's descriptor isn't used is that it might have different lower bounds (while size doesn't care about that, other

[Bug fortran/38181] calls to SIZE not optimized out of loops

2008-11-19 Thread dominiq at lps dot ens dot fr
--- Comment #2 from dominiq at lps dot ens dot fr 2008-11-19 21:38 --- It seems that the problem is a missed vectorization. For INTEGER FUNCTION F1(a) integer :: a(:,:), m, n m=SIZE(a,1) n=SIZE(a,2) F1=0 DO k=1,n DO j=1,m F1=F1+a(j,k) ENDDO ENDDO END FUNCTION F1 I

[Bug fortran/38181] calls to SIZE not optimized out of loops

2008-11-19 Thread rguenth at gcc dot gnu dot org
--- Comment #1 from rguenth at gcc dot gnu dot org 2008-11-19 20:39 --- Why is size1 not always inlined? Why is a new temporary array descriptor constructed and passed instead of using that for a? Note that the latter cannot be optimized by the compiler. Note that this is also the rea