This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [4.5/4.6 Regression] ICE: segmentation fault in mio_expr


On 04/20/2010 04:26 PM, Paul Richard Thomas wrote:
>> You can remove the first assignment to "cl" here, because in the next
>> line it is assigned again! And why do you introduce this "cl" at all?
>>     
> To make the code neater - I figured two pointer assignments would not
> hurt the execution time too much but it looks much kinder on the eye.
>   

Introducing a pointer is OK, however:

! 		  gfc_charlen *cl = c->ts.u.cl;
! 		  cl = gfc_new_charlen (sym->ns, ifc->ts.u.cl);


In the first line you do the assignment "cl = c->ts.u.cl" - and in the
second line you "override" the assignment by doing: "cl =
gfc_new_charlen(...)". Note: The RHS does not use "cl".

Thus, the assignment in the first line is pointless and can thus be
removed. (Which is what Janus pointed out).

Tobias


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]