[Bug fortran/38669] [4.3/4.4 Regression] Array bounds violation for arguments of elemental subroutine

2010-11-10 Thread hubicka at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38669

--- Comment #14 from Jan Hubicka  2010-11-11 
00:17:38 UTC ---
Author: hubicka
Date: Thu Nov 11 00:17:34 2010
New Revision: 166579

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=166579
Log:

PR tree-optimize/38669
* gcc.dg/tree-ssa/pr38699.c

Added:
trunk/gcc/testsuite/gcc.dg/tree-ssa/pr38699.c
Modified:
trunk/gcc/testsuite/ChangeLog


[Bug fortran/38669] [4.3/4.4 Regression] Array bounds violation for arguments of elemental subroutine

2009-01-14 Thread mikael at gcc dot gnu dot org


--- Comment #13 from mikael at gcc dot gnu dot org  2009-01-14 21:12 ---
Fixed on trunk(4.4) and 4.3.
Thanks for the report!


-- 

mikael at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


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



[Bug fortran/38669] [4.3/4.4 Regression] Array bounds violation for arguments of elemental subroutine

2009-01-14 Thread mikael at gcc dot gnu dot org


--- Comment #12 from mikael at gcc dot gnu dot org  2009-01-14 20:53 ---
Subject: Bug 38669

Author: mikael
Date: Wed Jan 14 20:53:18 2009
New Revision: 143383

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=143383
Log:
2009-01-14  Mikael Morin  

PR fortran/35681
* ChangeLog: Fix function name.

PR fortran/38487
* dependency.c (gfc_check_argument_var_dependency):
Move the check for pointerness inside the if block
so that it doesn't affect the return value.

PR fortran/38669
* trans-stmt.c (gfc_trans_call):
Add the dependency code after the loop bounds calculation one.

2009-01-14  Mikael Morin  

PR fortran/38669
* gfortran.dg/elemental_dependency_3.f90: New test.
* gfortran.dg/elemental_subroutine_7.f90: New test.


Added:
   
branches/gcc-4_3-branch/gcc/testsuite/gfortran.dg/elemental_dependency_3.f90
   
branches/gcc-4_3-branch/gcc/testsuite/gfortran.dg/elemental_subroutine_7.f90
Modified:
branches/gcc-4_3-branch/gcc/fortran/ChangeLog
branches/gcc-4_3-branch/gcc/fortran/dependency.c
branches/gcc-4_3-branch/gcc/fortran/trans-stmt.c
branches/gcc-4_3-branch/gcc/testsuite/ChangeLog


-- 


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



[Bug fortran/38669] [4.3/4.4 Regression] Array bounds violation for arguments of elemental subroutine

2009-01-08 Thread rguenth at gcc dot gnu dot org


--- Comment #11 from rguenth at gcc dot gnu dot org  2009-01-08 23:01 
---
Huh, the regression state of this bug looks weird.  So we have a patch applied
on trunk, but known-to-fail is both 4.3.3 and 4.4.0 - but 4.3.2 works?  And
the target milestone is 4.4.0?  If it is really a regression on the branch
(4.3.3 vs. 4.3.2) it definitely should be 4.3.3.  Changed as such, to get on
the radar for 4.3.3 again.

Please adjust known-to-work and known-to-fail accordingly.


-- 

rguenth at gcc dot gnu dot org changed:

   What|Removed |Added

   Target Milestone|4.4.0   |4.3.3


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



[Bug fortran/38669] [4.3/4.4 Regression] Array bounds violation for arguments of elemental subroutine

2009-01-06 Thread mikael at gcc dot gnu dot org


--- Comment #10 from mikael at gcc dot gnu dot org  2009-01-06 21:57 ---
Subject: Bug 38669

Author: mikael
Date: Tue Jan  6 21:57:19 2009
New Revision: 143134

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=143134
Log:
2009-01-06  Mikael Morin  

PR fortran/38669
* gfortran.dg/elemental_dependency_3.f90:
Add the final tree dump cleanup.


Modified:
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gfortran.dg/elemental_dependency_3.f90


-- 


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



[Bug fortran/38669] [4.3/4.4 Regression] Array bounds violation for arguments of elemental subroutine

2009-01-05 Thread mikael at gcc dot gnu dot org


--- Comment #9 from mikael at gcc dot gnu dot org  2009-01-05 18:44 ---
Subject: Bug 38669

Author: mikael
Date: Mon Jan  5 18:44:09 2009
New Revision: 143084

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=143084
Log:
2009-01-05  Mikael Morin  

PR fortran/38669
PR fortran/38726
* gfortran.dg/elemental_subroutine_7.f90: 
Fix p values so that it can be used as vector subscript.


Modified:
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gfortran.dg/elemental_subroutine_7.f90


-- 


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



[Bug fortran/38669] [4.3/4.4 Regression] Array bounds violation for arguments of elemental subroutine

2009-01-05 Thread mikael at gcc dot gnu dot org


--- Comment #8 from mikael at gcc dot gnu dot org  2009-01-05 13:37 ---
(In reply to comment #7)
It caused PR 38726


-- 


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



[Bug fortran/38669] [4.3/4.4 Regression] Array bounds violation for arguments of elemental subroutine

2009-01-04 Thread mikael at gcc dot gnu dot org


--- Comment #7 from mikael at gcc dot gnu dot org  2009-01-04 19:12 ---
Subject: Bug 38669

Author: mikael
Date: Sun Jan  4 19:12:16 2009
New Revision: 143057

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=143057
Log:
2009-01-04  Mikael Morin  

PR fortran/35681
* ChangeLog-2008: Fix function name.

PR fortran/38487
* dependency.c (gfc_check_argument_var_dependency):
Move the check for pointerness inside the if block
so that it doesn't affect the return value.

PR fortran/38669
* trans-stmt.c (gfc_trans_call):
Add the dependency code after the loop bounds calculation one.

2009-01-04  Mikael Morin  

PR fortran/38669
* gfortran.dg/elemental_dependency_3.f90: New test.
* gfortran.dg/elemental_subroutine_7.f90: New test.


Added:
trunk/gcc/testsuite/gfortran.dg/elemental_dependency_3.f90
trunk/gcc/testsuite/gfortran.dg/elemental_subroutine_7.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/ChangeLog-2008
trunk/gcc/fortran/dependency.c
trunk/gcc/fortran/trans-stmt.c
trunk/gcc/testsuite/ChangeLog


-- 


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



[Bug fortran/38669] [4.3/4.4 Regression] Array bounds violation for arguments of elemental subroutine

2009-01-03 Thread mikael at gcc dot gnu dot org


--- Comment #6 from mikael at gcc dot gnu dot org  2009-01-04 00:40 ---
(In reply to comment #5)
> (In reply to comment #4)
> > Created an attachment (id=17016)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17016&action=view) [edit]
> > fix
> > 
> > Does anyone know the use of the block variable I remove in this patch?
> > 
> 
> Yes indeed.  When I wrote this function, this block of code needed to be 
> merged
> as  the comments says:
>   /* Generate the temporary.  Merge the block so that the
>  declarations are put at the right binding level.  */
> 
> The second sentence needs to go in your patch:-)
> 
> What I have no recall of is why the block had to be merged.  I believe that it
> was conditional on the intent of the argument.

That's not what I was asking, sorry. I'll try to be clearer. 
The block variable seems to hold nothing. 

271gfc_start_block (&block);
272tmp = gfc_typenode_for_spec (&e->ts);
273tmp = gfc_trans_create_temp_array (&se->pre, &se->post,
274   &tmp_loop, info, tmp,
275   false, true, false);
276gfc_add_modify_expr (&se->pre, size, tmp);
277tmp = fold_convert (pvoid_type_node, info->data);
278gfc_add_modify_expr (&se->pre, data, tmp);
279gfc_merge_block_scope (&block);

The above is your initial commit. 
As gfc_trans_create_temp_array is putting his code in se->pre and se->post, 
it looks like no code goes to the block variable which is useless then. 
Or do I miss something?

This is largely off-topic though. It is just something I wondered when I looked
at the code. 


-- 


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



[Bug fortran/38669] [4.3, 4.4 Regression] Array bounds violation for arguments of elemental subroutine

2008-12-31 Thread pault at gcc dot gnu dot org


--- Comment #5 from pault at gcc dot gnu dot org  2008-12-31 10:47 ---
(In reply to comment #4)
> Created an attachment (id=17016)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17016&action=view) [edit]
> fix
> 
> Does anyone know the use of the block variable I remove in this patch?
> 

Yes indeed.  When I wrote this function, this block of code needed to be merged
as  the comments says:
  /* Generate the temporary.  Merge the block so that the
 declarations are put at the right binding level.  */

The second sentence needs to go in your patch:-)

What I have no recall of is why the block had to be merged.  I believe that it
was conditional on the intent of the argument.

Cheers

Paul


-- 


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



[Bug fortran/38669] [4.3, 4.4 Regression] Array bounds violation for arguments of elemental subroutine

2008-12-30 Thread jakub at gcc dot gnu dot org


-- 

jakub at gcc dot gnu dot org changed:

   What|Removed |Added

   Priority|P3  |P4


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



[Bug fortran/38669] [4.3, 4.4 Regression] Array bounds violation for arguments of elemental subroutine

2008-12-30 Thread mikael at gcc dot gnu dot org


--- Comment #4 from mikael at gcc dot gnu dot org  2008-12-30 16:45 ---
Created an attachment (id=17016)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17016&action=view)
fix

Does anyone know the use of the block variable I remove in this patch?


-- 

mikael at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |mikael at gcc dot gnu dot
   |dot org |org
 Status|NEW |ASSIGNED


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



[Bug fortran/38669] [4.3, 4.4 Regression] Array bounds violation for arguments of elemental subroutine

2008-12-30 Thread mikael at gcc dot gnu dot org


--- Comment #3 from mikael at gcc dot gnu dot org  2008-12-30 15:02 ---
At revision 142760, there is no temporary, so there is no bug. 
That's something I missed in my patch, that's true. 
The bug is still there however.   
Change this:
call tq_tvgh (var_f% av (k_lev:,1), p(k_lev:))
to this:
call tq_tvgh (var_f% av (k_lev:,1), (p(k_lev:)))


-- 


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



[Bug fortran/38669] [4.3, 4.4 Regression] Array bounds violation for arguments of elemental subroutine

2008-12-30 Thread mikael at gcc dot gnu dot org


--- Comment #2 from mikael at gcc dot gnu dot org  2008-12-30 14:04 ---
without derived types:

program gfcbu84_main
! use gfcbug84
  implicit none
  integer   :: jplev, k_lev
  real :: p(42)
  real, pointer :: q(:)
  jplev = 42
  k_lev = 1
  allocate (q(jplev))
  call tq_tvgh (q(k_lev:), p(k_lev:))

  contains
  elemental subroutine tq_tvgh (t, p)
real ,intent (out):: t
real ,intent (in) :: p
t=p
  end subroutine tq_tvgh
end program gfcbu84_main




The bound temporaries (D.1559,D.1560) are used before being defined. 

integer(kind=8) D.1560;
integer(kind=8) D.1559;
integer(kind=8) D.1558;
real(kind=4)[0:] * D.1557;

D.1563 = (integer(kind=8)) k_lev;
D.1564 = q.dim[0].ubound;
parm.2.dtype = 281;
D.1566 = q.dim[0].stride;
parm.2.dim[0].lbound = 1;
parm.2.dim[0].ubound = (1 - D.1563) + D.1564;
parm.2.dim[0].stride = NON_LVALUE_EXPR ;
parm.2.data = (void *) &(*(real(kind=4)[0:] *) q.data)[(D.1563 -
q.dim[0].lbound) * D.1566];
parm.2.offset = 0;
D.1569 = D.1560 - D.1559;
atmp.3.dtype = 281;
atmp.3.dim[0].stride = 1;
atmp.3.dim[0].lbound = 0;
atmp.3.dim[0].ubound = D.1569;
(...)
D.1559 = (integer(kind=8)) k_lev;
D.1560 = q.dim[0].ubound;


My commit is probably the culprit (what else?), but I don't understand how it
could be.


-- 

mikael at gcc dot gnu dot org changed:

   What|Removed |Added

   Target Milestone|--- |4.4.0


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



[Bug fortran/38669] [4.3, 4.4 Regression] Array bounds violation for arguments of elemental subroutine

2008-12-30 Thread dfranke at gcc dot gnu dot org


--- Comment #1 from dfranke at gcc dot gnu dot org  2008-12-30 11:55 ---
Maybe:
r142766 | mikael | 2008-12-15 19:08:42 +0100 (Mon, 15 Dec 2008) | 14 lines

Added Mikael as CC.


-- 

dfranke at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||dfranke at gcc dot gnu dot
   ||org, mikael dot morin at
   ||tele2 dot fr


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



[Bug fortran/38669] [4.3, 4.4 Regression] Array bounds violation for arguments of elemental subroutine

2008-12-30 Thread tkoenig at gcc dot gnu dot org


-- 

tkoenig at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||tkoenig at gcc dot gnu dot
   ||org
 Status|UNCONFIRMED |NEW
 Ever Confirmed|0   |1
  Known to fail||4.3.3 4.4.0
  Known to work||4.3.2
   Last reconfirmed|-00-00 00:00:00 |2008-12-30 11:17:36
   date||
Summary|[Regression] Array bounds   |[4.3, 4.4 Regression] Array
   |violation for arguments of  |bounds violation for
   |elemental subroutine|arguments of elemental
   ||subroutine


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