Bug 20063 - n*'xxxx' disables padding
Summary: n*'xxxx' disables padding
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.0.0
: P2 normal
Target Milestone: 4.0.2
Assignee: Not yet assigned to anyone
URL:
Keywords: wrong-code
: 20798 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-02-18 20:49 UTC by Dale Ranta
Modified: 2005-07-25 12:53 UTC (History)
2 users (show)

See Also:
Host: powerpc-apple-darwin7.8.0
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-06-06 00:16:23


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dale Ranta 2005-02-18 20:49:46 UTC
I get this error with the Macintosh gfortran from the 20050213 package with some
of my programs.

[dranta:~/tests/gfortran] dir% gfortran -c block.f
/var/tmp//ccu5xNom.s:28:Bad Absolute Expression, absolute 0 assumed.
/var/tmp//ccu5xNom.s:28:Repeat < 0, .space ignored
/var/tmp//ccu5xNom.s:88:Bad Absolute Expression, absolute 0 assumed.
/var/tmp//ccu5xNom.s:88:Repeat < 0, .space ignored
[dranta:~/tests/gfortran] dir% cat  block.f
      block data blkdat
      character*8 names                                                 vax
      common/vfile/names(60)                                            vax
      data names / 'rstxyz', 'disk05', 'disk06', 'thrxyz', '      ',    noto
     1             '      ', 'disk01', 'disk02', 'n3plot', 'n3dump',    noto
     2             'disk11', 'disk12', 'strxyz', 'n3runr', 'itrcnt',    noto
     3             '      ', '      ', 'xyz123', 28*'      ',           noto
     4             'n3dhsp','n3data', 10*'      ', 'tty', '      '/     noto
      end
Comment 1 Steve Kargl 2005-02-18 21:01:21 UTC
Your code compiles fine on amd64-*-freebsd where I'm using a gfortran
form 20050218 sources.  I do get a warning though

troutmask:kargl[205] /usr/tmp/sgk/bin/gfc -c e.f
/var/tmp/ccvV0Vua.s: Assembler messages:
/var/tmp/ccvV0Vua.s:39: Warning: .space repeat count is zero, ignored
/var/tmp/ccvV0Vua.s:99: Warning: .space repeat count is zero, ignored

I suspect that this a target specific bug or it could be related to
a serious bug introduced on 2/13 and fix last night.
Comment 2 Andrew Pinski 2005-02-18 21:06:33 UTC
Confirmed, reduced to:
      block data blkdat
      character*8 names
      common/vfile/names(3)
      data names / 'a',2*'    '/
      end
Comment 3 Andrew Pinski 2005-02-18 21:07:54 UTC
(In reply to comment #1)
> Your code compiles fine on amd64-*-freebsd where I'm using a gfortran
> form 20050218 sources.  I do get a warning though
Darwin's as treats those warnings as errors as they really should as this is a bug
in the front-end.
If you take a look at my reduced testcase and look at the assembly ouput you will see that
the assembly outputed is wrong.
Comment 4 Tobias Schlüter 2005-02-18 21:35:58 UTC
From the generated assembly
        .ascii  "a       "
        .zero   4294967292
        .ascii  "    "
        .zero   4
        .ascii  "    "
        .zero   4
        .zero   4
i.e. the elements that are filled in with a repeat count are not padded to the
correct length.
Comment 5 Tobias Schlüter 2005-02-18 21:37:22 UTC
Well, more precisely: they're zero-padded instead of being padded with blanks.
Comment 6 Andrew Pinski 2005-04-06 18:27:04 UTC
*** Bug 20798 has been marked as a duplicate of this bug. ***
Comment 7 Giovanni Bajo 2005-07-09 15:48:00 UTC
This will likely change to an ICE in varasm.c after my CONSTRUCTOR patch goes 
in.
Comment 8 CVS Commits 2005-07-25 07:51:19 UTC
Subject: Bug 20063

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	jakub@gcc.gnu.org	2005-07-25 07:51:12

Modified files:
	gcc/fortran    : ChangeLog data.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/gfortran.fortran-torture/execute: data_4.f90 

Log message:
	PR fortran/20063
	* data.c (gfc_assign_data_value_range): Call
	create_character_initializer if last_ts is a character type.
	
	* gfortran.fortran-torture/execute/data_4.f90: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/ChangeLog.diff?cvsroot=gcc&r1=1.501&r2=1.502
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/data.c.diff?cvsroot=gcc&r1=1.13&r2=1.14
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.5813&r2=1.5814
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.fortran-torture/execute/data_4.f90.diff?cvsroot=gcc&r1=NONE&r2=1.1

Comment 9 CVS Commits 2005-07-25 08:47:09 UTC
Subject: Bug 20063

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-4_0-branch
Changes by:	jakub@gcc.gnu.org	2005-07-25 08:47:01

Modified files:
	gcc/fortran    : ChangeLog data.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/gfortran.fortran-torture/execute: data_4.f90 

Log message:
	PR fortran/20063
	* data.c (gfc_assign_data_value_range): Call
	create_character_initializer if last_ts is a character type.
	
	* gfortran.fortran-torture/execute/data_4.f90: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.335.2.94&r2=1.335.2.95
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/data.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.11&r2=1.11.10.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.299&r2=1.5084.2.300
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.fortran-torture/execute/data_4.f90.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.2.1

Comment 10 Andrew Pinski 2005-07-25 12:53:28 UTC
Fixed.