------- Comment #1 from burnus at gcc dot gnu dot org 2010-08-01 16:52 ------- ! --- FOUR ---- (also occurs for Octopus)
subroutine t2(b,c) implicit none REAL :: b(3,3),c(3) c = matmul(b, c) end subroutine That's a pattern I see quite often: LHS variable on the RHS as second (or first) argument to MATMUL. However, no temporary is needed - but one probably needs to handle this carefully and it depends how one generates the MATMUL internally. While most implementation ways should work, one probably can program it such that avoiding a temporary will lead to wrong results ... Additionally, one should confirm that it works with-fexternal-blas As a variant: The same but with one or two items TRANSPOSEd - or CONJugated. ! --- FIVE --- (Found in octopus, www.tddft.org [GPL]) if(any(shape(a).ne.shape(b))) then That generates two temporaries - one for each SHAPE. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45159