This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/20923] Compile time is high for the following code


------- Additional Comments From tobi at gcc dot gnu dot org  2005-05-19 22:14 -------
ugh, it is quadratic, only the inner array constructor gets expanded. And this
is where the <= 100 restriction I alluded to above comes in.  For n = 100 the
relevant line from the -fdump-parse-tree output looks like:
      ASSIGN vect(:) __convert_i4_r4[[(((/ ((/ (+ (+ 1 j) 3) , (+ (+ 2 j) 3) ,
(+ (+ 3 j) 3) , (+ (+ 4 j) 3) , (+ (+ 5 j) 3) , (+ (+ 6 j) 3) , (+ (+ 7 j) 3) ,
(+ (+ 8 j) 3) , (+ (+ 9 j) 3) , (+ (+ 10 j) 3) , (+ (+ 11 j) 3) , (+ (+ 12 j)
3), (+ (+ 13 j) 3) , (+ (+ 14 j) 3) , (+ (+ 15 j) 3) , (+ (+ 16 j) 3) , (+ (+ 17
j) 3) , (+ (+ 18 j) 3) , (+ (+ 19 j) 3) , (+ (+ 20 j) 3) , (+ (+ 21 j) 3) , (+
(+ 22 j) 3) , (+ (+ 23 j) 3) , (+ (+ 24 j) 3) , (+ (+ 25 j) 3) , (+ (+ 26 j) 3)
,(+ (+ 27 j) 3) , (+ (+ 28 j) 3) , (+ (+ 29 j) 3) , (+ (+ 30 j) 3) , (+ (+ 31
j)3) , (+ (+ 32 j) 3) , (+ (+ 33 j) 3) , (+ (+ 34 j) 3) , (+ (+ 35 j) 3) , (+ (+
36 j) 3) , (+ (+ 37 j) 3) , (+ (+ 38 j) 3) , (+ (+ 39 j) 3) , (+ (+ 40 j) 3) ,
(+ (+ 41 j) 3) , (+ (+ 42 j) 3) , (+ (+ 43 j) 3) , (+ (+ 44 j) 3) , (+ (+ 45 j)
3) , (+ (+ 46 j) 3) , (+ (+ 47 j) 3) , (+ (+ 48 j) 3) , (+ (+ 49 j) 3) , (+ (+
50j) 3) , (+ (+ 51 j) 3) , (+ (+ 52 j) 3) , (+ (+ 53 j) 3) , (+ (+ 54 j) 3) , (+
(+ 55 j) 3) , (+ (+ 56 j) 3) , (+ (+ 57 j) 3) , (+ (+ 58 j) 3) , (+ (+ 59 j) 3)
, (+ (+ 60 j) 3) , (+ (+ 61 j) 3) , (+ (+ 62 j) 3) , (+ (+ 63 j) 3) , (+ (+ 64
j) 3) , (+ (+ 65 j) 3) , (+ (+ 66 j) 3) , (+ (+ 67 j) 3) , (+ (+ 68 j) 3) , (+
(+69 j) 3) , (+ (+ 70 j) 3) , (+ (+ 71 j) 3) , (+ (+ 72 j) 3) , (+ (+ 73 j) 3) ,
(+ (+ 74 j) 3) , (+ (+ 75 j) 3) , (+ (+ 76 j) 3) , (+ (+ 77 j) 3) , (+ (+ 78 j)
3) , (+ (+ 79 j) 3) , (+ (+ 80 j) 3) , (+ (+ 81 j) 3) , (+ (+ 82 j) 3) , (+ (+
83 j) 3) , (+ (+ 84 j) 3) , (+ (+ 85 j) 3) , (+ (+ 86 j) 3) , (+ (+ 87 j) 3) ,
(+(+ 88 j) 3) , (+ (+ 89 j) 3) , (+ (+ 90 j) 3) , (+ (+ 91 j) 3) , (+ (+ 92 j)
3), (+ (+ 93 j) 3) , (+ (+ 94 j) 3) , (+ (+ 95 j) 3) , (+ (+ 96 j) 3) , (+ (+ 97
j) 3) , (+ (+ 98 j) 3) , (+ (+ 99 j) 3) , (+ (+ 100 j) 3) /) j=1,100,1) /)))]]

while for n = 101 it loks like:
     ASSIGN vect(:) __convert_i4_r4[[(((/ ((/ ((/ (+ (+ i j) 3) /) i=1,101,1) /)
j=1,101,1) /)))]]

IOW the array constructor is not expanded any longer, but still the compilation
takes longer :-(

-- 


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]