[Bug fortran/45159] Unnecessary temporaries

dominiq at lps dot ens dot fr gcc-bugzilla@gcc.gnu.org
Tue Aug 10 08:45:00 GMT 2010



------- Comment #17 from dominiq at lps dot ens dot fr  2010-08-10 08:45 -------
With the patch in comment#16, there is no temporary created for the code in
comment #15, but one is created for

  a(10:16:1) = a(11:17)

This seems to be fixed if I replace

+      if (r_stride)                                                        
+       identical_strides = gfc_dep_compare_expr (l_stride, r_stride) == 1; 
+      else                                                                 
+       identical_strides = gfc_expr_is_one (l_stride, 0) == 0;             

with

+      if (r_stride)                                                        
+       identical_strides = gfc_dep_compare_expr (l_stride, r_stride) == 1; 
+      else                                                                 
+       identical_strides = gfc_expr_is_one (l_stride, 0) == 1;             

I think that

+       identical_strides = gfc_dep_compare_expr (l_stride, r_stride) == 1; 

should also be replaced with

+       identical_strides = gfc_dep_compare_expr (l_stride, r_stride) == 0; 


-- 


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



More information about the Gcc-bugs mailing list