From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13846 invoked by alias); 25 Mar 2008 12:44:52 -0000 Received: (qmail 13671 invoked by uid 48); 25 Mar 2008 12:44:09 -0000 Date: Tue, 25 Mar 2008 12:44:00 -0000 Message-ID: <20080325124409.13670.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/27997] Fortran 2003: Support type-spec for array constructor In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "d at domob dot eu" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2008-03/txt/msg01976.txt.bz2 ------- Comment #6 from d at domob dot eu 2008-03-25 12:44 ------- After looking at the assembly dump, the problem with the strings seems to be that the literals are stored packed to each other in the data section and the array constructor simply lists the pointers to them and sets the length value to 7; thus, the shorter strings get the following character (that happens to be the first one of the next string) appended to them. Could we resolve this problem by keeping track for each string literal in which content it will accessed and padding them with spaces to the longest used length when dumping to the data section? Possibly when gfc_convert_expr is called on a string literal? BTW, is this a problem that affects other things also, for instance, user defined records? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27997