Bug 37211 - TRANSFER to characters: Size checking
Summary: TRANSFER to characters: Size checking
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.4.0
: P3 normal
Target Milestone: ---
Assignee: Thomas Koenig
URL:
Keywords: diagnostic
Depends on:
Blocks: Fortran_character 31237
  Show dependency treegraph
 
Reported: 2008-08-23 16:57 UTC by Tobias Burnus
Modified: 2011-08-06 13:46 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2009-03-29 09:21:19


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Burnus 2008-08-23 16:57:47 UTC
For the following gfortran should print:
  "Intrinsic TRANSFER at %L has partly undefined result: "
  "source size %ld < result size %ld
but this does not work.

character(len=20) :: str
str = transfer(10,str)
end

Ditto for character( KIND=4  ,len=20)
Comment 1 Thomas Koenig 2011-08-04 23:08:34 UTC
I have a patch.
Comment 2 Dominique d'Humieres 2011-08-05 22:59:15 UTC
The commit seems to have gone to "[Bug middle-end/37221] Missed early loop-unroll optimization - causes 40% degradation on SPU".
Comment 3 Thomas Koenig 2011-08-05 23:06:22 UTC
Author: tkoenig
Date: Fri Aug  5 23:06:18 2011
New Revision: 177491

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=177491
Log:
2011-08-05  Thomas Koenig  <tkoenig@gcc.gnu.org>

        PR fortran/37211
        * fortran/ChangeLog:  Correct PR number from last commit.
        * testsuite/ChangeLog:  Likewise.


Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/testsuite/ChangeLog
Comment 4 Thomas Koenig 2011-08-05 23:09:50 UTC
*sigh* The real one was at

http://gcc.gnu.org/ml/gcc-cvs/2011-08/msg00498.html

Fixed on trunk, closing.
Comment 5 H.J. Lu 2011-08-06 13:40:25 UTC
On Linux/x86, I got

FAIL: gfortran.dg/c_ptr_tests_16.f90  -O  (test for excess errors)
Excess errors:
/export/gnu/import/git/gcc-x32/gcc/testsuite/gfortran.dg/c_ptr_tests_16.f90:58:9: Error: Can't convert INTEGER(4) to TYPE(c_funptr) at (1)
/export/gnu/import/git/gcc-x32/gcc/testsuite/gfortran.dg/c_ptr_tests_16.f90:49:11: Error: Can't convert INTEGER(4) to TYPE(c_ptr) at (1)
Comment 6 Mikael Morin 2011-08-06 13:46:58 UTC
(In reply to comment #5)
> On Linux/x86, I got
> 
> FAIL: gfortran.dg/c_ptr_tests_16.f90  -O  (test for excess errors)
> Excess errors:
> /export/gnu/import/git/gcc-x32/gcc/testsuite/gfortran.dg/c_ptr_tests_16.f90:58:9:
> Error: Can't convert INTEGER(4) to TYPE(c_funptr) at (1)
> /export/gnu/import/git/gcc-x32/gcc/testsuite/gfortran.dg/c_ptr_tests_16.f90:49:11:
> Error: Can't convert INTEGER(4) to TYPE(c_ptr) at (1)

Tracked in PR50004.