* [PATCH] Fix gfc_trans_pointer_assign_need_temp (PR fortran/49698)
@ 2011-07-11 16:34 Jakub Jelinek
2011-07-11 16:38 ` Tobias Burnus
0 siblings, 1 reply; 2+ messages in thread
From: Jakub Jelinek @ 2011-07-11 16:34 UTC (permalink / raw)
To: fortran; +Cc: gcc-patches
Hi!
As the attached testcase (on x86-64) shows, inner_size is initialized to
1 of a wrong type, which results in verify_stmt ICEs because a PLUS has
one 64-bit and one 32-bit operand.
Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux.
Ok for trunk/4.6?
2011-07-11 Jakub Jelinek <jakub@redhat.com>
PR fortran/49698
* trans-stmt.c (gfc_trans_pointer_assign_need_temp): Initialize
inner_size to gfc_index_one_node instead of integer_one_node.
* gfortran.dg/pr49698.f90: New test.
--- gcc/fortran/trans-stmt.c.jj 2011-07-07 13:23:57.000000000 +0200
+++ gcc/fortran/trans-stmt.c 2011-07-11 10:53:34.000000000 +0200
@@ -3323,7 +3323,7 @@ gfc_trans_pointer_assign_need_temp (gfc_
count = gfc_create_var (gfc_array_index_type, "count");
gfc_add_modify (block, count, gfc_index_zero_node);
- inner_size = integer_one_node;
+ inner_size = gfc_index_one_node;
lss = gfc_walk_expr (expr1);
rss = gfc_walk_expr (expr2);
if (lss == gfc_ss_terminator)
--- gcc/testsuite/gfortran.dg/pr49698.f90.jj 2011-07-11 11:32:01.000000000 +0200
+++ gcc/testsuite/gfortran.dg/pr49698.f90 2011-07-11 11:21:53.000000000 +0200
@@ -0,0 +1,15 @@
+! PR fortran/49698
+! { dg-do compile }
+subroutine foo (x, y, z)
+ type S
+ integer, pointer :: e => null()
+ end type S
+ type T
+ type(S), dimension(:), allocatable :: a
+ end type T
+ type(T) :: x, y
+ integer :: z, i
+ forall (i = 1 : z)
+ y%a(i)%e => x%a(i)%e
+ end forall
+end subroutine foo
Jakub
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Fix gfc_trans_pointer_assign_need_temp (PR fortran/49698)
2011-07-11 16:34 [PATCH] Fix gfc_trans_pointer_assign_need_temp (PR fortran/49698) Jakub Jelinek
@ 2011-07-11 16:38 ` Tobias Burnus
0 siblings, 0 replies; 2+ messages in thread
From: Tobias Burnus @ 2011-07-11 16:38 UTC (permalink / raw)
To: Jakub Jelinek; +Cc: fortran, gcc-patches
On 07/11/2011 06:24 PM, Jakub Jelinek wrote:
> As the attached testcase (on x86-64) shows, inner_size is initialized to
> 1 of a wrong type, which results in verify_stmt ICEs because a PLUS has
> one 64-bit and one 32-bit operand.
>
> Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux.
> Ok for trunk/4.6?
OK. I would even claim the patch is obvious.
Thanks for taking care of this PR.
Tobias
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-07-11 16:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-11 16:34 [PATCH] Fix gfc_trans_pointer_assign_need_temp (PR fortran/49698) Jakub Jelinek
2011-07-11 16:38 ` Tobias Burnus
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).