Summary: | wrong results for structure assignment of character components when left and right sides overlap | ||
---|---|---|---|
Product: | gcc | Reporter: | Dick Hendrickson <dick.hendrickson> |
Component: | fortran | Assignee: | Paul Thomas <pault> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | gcc-bugs |
Priority: | P3 | Keywords: | wrong-code |
Version: | 4.4.0 | ||
Target Milestone: | --- | ||
Host: | Target: | ||
Build: | Known to work: | ||
Known to fail: | Last reconfirmed: | 2009-01-22 15:00:32 | |
Bug Depends on: | |||
Bug Blocks: | 32834 |
Description
Dick Hendrickson
2009-01-19 17:52:16 UTC
Confirm. ICE with 4.1.x and 4.2.x and wrong code with 4.3.x and 4.4. Thanks for the report. (In reply to comment #1) > Confirm. ICE with 4.1.x and 4.2.x and wrong code with 4.3.x and 4.4. > > Thanks for the report. > The character length is being incorrectly set to 1 for the failing assignments; ie. the last argument of the memmove is 1. I'm on to it. Paul Copy of http://gcc.gnu.org/ml/fortran/2009-01/msg00333.html: > Bootstrapped and regtested on FC9/x86_64 - OK for 4.5? Works as advertised on i686-apple-darwin9 (32 and 64 bit modes) without regression. Since the patch fixes a wrong code, should not it be commited in 4.4 (still 2 P1)? Thanks for the patch. Dominique AFAICT this patch has not been reviewed. Subject: Bug 38915 Author: pault Date: Tue Mar 31 20:03:23 2009 New Revision: 145370 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=145370 Log: 2009-03-31 Paul Thomas <pault@gcc.gnu.org> PR fortran/38915 * trans-expr.c (gfc_trans_assignment_1): Ensure temporaries have a string_length. 2009-03-31 Paul Thomas <pault@gcc.gnu.org> PR fortran/38915 * gfortran.dg/char_length_15.f90: New test. Added: trunk/gcc/testsuite/gfortran.dg/char_length_15.f90 Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/trans-expr.c trunk/gcc/testsuite/ChangeLog Could the patch be back-ported to 4.4 (4.3?)? TIA. Fixed on trunk. I am prepared to backport but the mood appears to be against it. Thanks for the report. Paul |