[Bug fortran/42831] Unnecessary array temporary produced

2010-10-02 Thread tkoenig at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42831

--- Comment #4 from Thomas Koenig tkoenig at gcc dot gnu.org 2010-10-02 
08:00:55 UTC ---
Author: tkoenig
Date: Sat Oct  2 08:00:50 2010
New Revision: 164900

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=164900
Log:
2010-10-02  Thomas Koenig  tkoe...@gcc.gnu.org

PR fortran/42831
* gfortran.dg/dependency_37.f90:  New test.


Added:
trunk/gcc/testsuite/gfortran.dg/dependency_37.f90
Modified:
trunk/gcc/testsuite/ChangeLog


[Bug fortran/42831] Unnecessary array temporary produced

2010-10-02 Thread tkoenig at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42831

Thomas Koenig tkoenig at gcc dot gnu.org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED

--- Comment #5 from Thomas Koenig tkoenig at gcc dot gnu.org 2010-10-02 
08:06:21 UTC ---
Test case committed.

Closing.


[Bug fortran/42831] Unnecessary array temporary produced

2010-09-13 Thread tkoenig at gcc dot gnu dot org


--- Comment #2 from tkoenig at gcc dot gnu dot org  2010-09-13 18:59 ---
This doesn't seem to happen any more.

Can we close this?


-- 

tkoenig at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||tkoenig at gcc dot gnu dot
   ||org


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



[Bug fortran/42831] Unnecessary array temporary produced

2010-09-13 Thread jakub at gcc dot gnu dot org


--- Comment #3 from jakub at gcc dot gnu dot org  2010-09-13 19:04 ---
Perhaps a testcase should be added (either with -Warray-temporaries or scanning
dumps) to make sure we don't regress here?


-- 


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



[Bug fortran/42831] Unnecessary array temporary produced

2010-05-09 Thread dfranke at gcc dot gnu dot org


--- Comment #1 from dfranke at gcc dot gnu dot org  2010-05-09 22:13 ---
Somewhat reduced testcase below.

Note that the temporary depends on the POINTER attribute of 'table'. If POINTER
and corresponding ALLOCATE are removed, there is no more temporary array. Also,
if CENTIMETER is changed to simple REAL, but 'table' is still a POINTER, the
temporary is omitted.


module UnitValue_Module
  type :: UnitValue
real  :: Value = 1.0
  end type

  interface operator(*)
module procedure ProductReal_LV
  end interface operator(*)

  interface assignment(=)
module procedure Assign_LV_Real
  end interface assignment(=)
contains

  elemental function ProductReal_LV(Multiplier, Multiplicand) result(P_R_LV)
real, intent(in):: Multiplier
type(UnitValue), intent(in) :: Multiplicand
type(UnitValue) :: P_R_LV
P_R_LV%Value = Multiplier * Multiplicand%Value
  end function ProductReal_LV

  elemental subroutine Assign_LV_Real(LeftHandSide, RightHandSide)
real, intent(inout) :: LeftHandSide
type(UnitValue), intent(in) :: RightHandSide
LeftHandSide = RightHandSide%Value
  end subroutine Assign_LV_Real
end module UnitValue_Module

program TestProgram
  use UnitValue_Module

  type :: TableForm
real, dimension(:,:), allocatable :: RealData
  end type TableForm

  REAL :: CENTIMETER
  type(TableForm), pointer :: Table

  allocate(Table)
  allocate(Table%RealData(10,5))

  CENTIMETER = 42
  Table%RealData = 1
  Table%RealData(:,1) = Table%RealData(:,1) * CENTIMETER
end program TestProgram


-- 

dfranke at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||dfranke at gcc dot gnu dot
   ||org
OtherBugsDependingO||36854
  nThis||
   Severity|normal  |enhancement
 Status|UNCONFIRMED |NEW
 Ever Confirmed|0   |1
   Last reconfirmed|-00-00 00:00:00 |2010-05-09 22:13:05
   date||


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