Bug 20713 - Not pad parameter strings.
Summary: Not pad parameter strings.
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.1.0
: P2 normal
Target Milestone: 4.0.0
Assignee: fengwang
URL:
Keywords: wrong-code
Depends on:
Blocks:
 
Reported: 2005-04-01 12:58 UTC by fengwang
Modified: 2005-04-05 13:24 UTC (History)
1 user (show)

See Also:
Host: i686-pc-linux
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-04-01 13:17:55


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description fengwang 2005-04-01 12:58:18 UTC
character(len = 10),parameter:: a = 'hello'
print *, a, "world"
end

the output:
helloworld.
Comment 1 Andrew Pinski 2005-04-01 13:17:55 UTC
Confirmed.
Comment 2 GCC Commits 2005-04-05 08:55:10 UTC
Subject: Bug 20713

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	fengwang@gcc.gnu.org	2005-04-05 08:54:50

Modified files:
	gcc/fortran    : array.c decl.c match.h 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/gfortran.dg: pr15959.f90 string_pad_trunc.f90 

Log message:
	2005-04-05  Feng Wang  <fengwang@nudt.edu.cn>
	
	PR fortran/15959
	PR fortran/20713
	
	* array.c (resolve_character_array_constructor): New function. Set
	constant character array's character length.
	(gfc_resolve_array_constructor): Use it.
	* decl.c (add_init_expr_to_sym): Set symbol and initializer character
	length.
	(gfc_set_constant_character_len): New function. Set constant character
	expression according the given length.
	* match.h (gfc_set_constant_character_len): Add prototype.
	
	2005-04-05  Feng Wang  <fengwang@nudt.edu.cn>
	
	* gfortran.dg/pr15959.f90: New test.
	* gfortran.dg/string_pad_trunc.f90: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/array.c.diff?cvsroot=gcc&r1=1.13&r2=1.14
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/decl.c.diff?cvsroot=gcc&r1=1.33&r2=1.34
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/match.h.diff?cvsroot=gcc&r1=1.10&r2=1.11
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.5282&r2=1.5283
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/pr15959.f90.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/string_pad_trunc.f90.diff?cvsroot=gcc&r1=NONE&r2=1.1

Comment 3 GCC Commits 2005-04-05 09:04:04 UTC
Subject: Bug 20713

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-4_0-branch
Changes by:	fengwang@gcc.gnu.org	2005-04-05 09:03:51

Modified files:
	gcc/fortran    : array.c decl.c match.h 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/gfortran.dg: pr15959.f90 string_pad_trunc.f90 

Log message:
	2005-04-05  Feng Wang  <fengwang@nudt.edu.cn>
	
	PR fortran/15959
	PR fortran/20713
	
	* array.c (resolve_character_array_constructor): New function. Set
	constant character array's character length.
	(gfc_resolve_array_constructor): Use it.
	* decl.c (add_init_expr_to_sym): Set symbol and initializer character
	length.
	(gfc_set_constant_character_len): New function. Set constant character
	expression according the given length.
	* match.h (gfc_set_constant_character_len): Add prototype.
	
	2005-04-05  Feng Wang  <fengwang@nudt.edu.cn>
	
	* gfortran.dg/pr15959.f90: New test.
	* gfortran.dg/string_pad_trunc.f90: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/array.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.13&r2=1.13.8.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/decl.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.31&r2=1.31.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/match.h.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.10&r2=1.10.36.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.5084.2.100&r2=1.5084.2.101
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/pr15959.f90.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/string_pad_trunc.f90.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.2.1

Comment 4 Andrew Pinski 2005-04-05 13:24:05 UTC
Fixed.