public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/25049]  New: better diagnostic needed
@ 2005-11-26 17:45 jv244 at cam dot ac dot uk
  2005-11-26 19:03 ` [Bug fortran/25049] TRANSPOSE not allowed in initialisation expression fxcoudert at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: jv244 at cam dot ac dot uk @ 2005-11-26 17:45 UTC (permalink / raw)
  To: gcc-bugs

using GNU Fortran 95 (GCC) 4.1.0 20051126 (prerelease)  with '-g -pedantic
-std=f95', I get a bad / no diagnostic for the following invalid code:

module M
  integer, parameter ::   A(2,2)=0
  integer, parameter, dimension(2,2) :: B = TRANSPOSE(A)
end module M
END


-- 
           Summary: better diagnostic needed
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jv244 at cam dot ac dot uk


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25049


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug fortran/25049] TRANSPOSE not allowed in initialisation expression
  2005-11-26 17:45 [Bug fortran/25049] New: better diagnostic needed jv244 at cam dot ac dot uk
@ 2005-11-26 19:03 ` fxcoudert at gcc dot gnu dot org
  2006-06-20  4:31 ` pault at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2005-11-26 19:03 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from fxcoudert at gcc dot gnu dot org  2005-11-26 19:03 -------
ICE on this one, may be related to PR18769. Still a diagnostic bug too.

## g95 ##
In file foo.f90:3

  integer, parameter, dimension(2,2) :: B = TRANSPOSE(A)
                                                     1
Error: Function 'transpose' cannot appear in an initialization expression at
(1)
## Intel ##
fortcom: Error: foo.f90, line 3: This intrinsic function is invalid in constant
expressions.   [TRANSPOSE]
  integer, parameter, dimension(2,2) :: B = TRANSPOSE(A)
--------------------------------------------^
compilation aborted for foo.f90 (code 1)
## Portland ##
PGF90-S-0459-Target of NULL() assignment must be a pointer (foo.f90: 3)
PGF90-S-0066-Too few data constants in initialization statement (foo.f90: 3)
  0 inform,   0 warnings,   2 severes, 0 fatal for m
## Sun ##

module M
       ^
"foo.f90", Line = 1, Column = 8: ERROR: The compiler has detected errors in
module "M".  No module information file will be created for this module.

  integer, parameter, dimension(2,2) :: B = TRANSPOSE(A)
                                            ^
"foo.f90", Line = 3, Column = 45: ERROR: Intrinsic function "TRANSPOSE" is not
allowed in an initialization expression.


-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |ice-on-invalid-code
   Last reconfirmed|0000-00-00 00:00:00         |2005-11-26 19:03:39
               date|                            |
            Summary|better diagnostic needed    |TRANSPOSE not allowed in
                   |                            |initialisation expression


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25049


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug fortran/25049] TRANSPOSE not allowed in initialisation expression
  2005-11-26 17:45 [Bug fortran/25049] New: better diagnostic needed jv244 at cam dot ac dot uk
  2005-11-26 19:03 ` [Bug fortran/25049] TRANSPOSE not allowed in initialisation expression fxcoudert at gcc dot gnu dot org
@ 2006-06-20  4:31 ` pault at gcc dot gnu dot org
  2006-06-23  4:47 ` pault at gcc dot gnu dot org
  2006-06-23 15:40 ` pault at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-06-20  4:31 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pault at gcc dot gnu dot org  2006-06-20 04:31 -------
Subject: Bug 25049

Author: pault
Date: Tue Jun 20 04:30:48 2006
New Revision: 114802

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=114802
Log:
2006-06-20  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/25049
        PR fortran/25050
        * check.c (non_init_transformational): New function.
        (find_substring_ref): New function to signal use of disallowed
        transformational intrinsic in an initialization expression.
        (gfc_check_all_any): Call previous if initialization expr.
        (gfc_check_count): The same.
        (gfc_check_cshift): The same.
        (gfc_check_dot_product): The same.
        (gfc_check_eoshift): The same.
        (gfc_check_minloc_maxloc): The same.
        (gfc_check_minval_maxval): The same.
        (gfc_check_gfc_check_product_sum): The same.
        (gfc_check_pack): The same.
        (gfc_check_spread): The same.
        (gfc_check_transpose): The same.
        (gfc_check_unpack): The same.

        PR fortran/18769
        *intrinsic.c (add_functions): Add gfc_simplify_transfer.
        *intrinsic.h : Add prototype for gfc_simplify_transfer.
        *simplify.c (gfc_simplify_transfer) : New function to act as
        placeholder for eventual implementation.  Emit error for now.

        PR fortran/16206
        * expr.c (find_array_element): Eliminate condition on length of
        offset. Add bounds checking. Rearrange exit. Return try and
        put gfc_constructor result as an argument.
        (find_array_section): New function.
        (find_substring_ref): New function.
        (simplify_const_ref): Add calls to previous.
        (simplify_parameter_variable): Return on NULL expr.
        (gfc_simplify_expr): Only call gfc_expand_constructor for full
        arrays.

        PR fortran/20876
        * match.c (gfc_match_forall): Add missing locus to gfc_code.

2006-06-20  Paul Thomas  <pault@gcc.gnu.org>

        PR libfortran/28005
        * m4/matmul.m4: aystride = 1 does not uniquely detect the
        presence of a temporary transpose; an array element in the
        first dimension produces the same signature.  Detect this
        using the rank of a and add specific code.
        * generated/matmul_r4.c: Regenerate.
        * generated/matmul_r8.c: Regenerate.
        * generated/matmul_r10.c: Regenerate.
        * generated/matmul_r16.c: Regenerate.
        * generated/matmul_c4.c: Regenerate.
        * generated/matmul_c8.c: Regenerate.
        * generated/matmul_c10.c: Regenerate.
        * generated/matmul_c16.c: Regenerate.
        * generated/matmul_i4.c: Regenerate.
        * generated/matmul_i8.c: Regenerate.
        * generated/matmul_i16.c: Regenerate.

2006-06-20  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/16206
        * gfortran.dg/array_initializer_1.f90: New test.

        PR fortran/28005
        * gfortran.dg/matmul_3.f90: New test.


Added:
    trunk/gcc/testsuite/gfortran.dg/array_initializer_1.f90
    trunk/gcc/testsuite/gfortran.dg/matmul_3.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/check.c
    trunk/gcc/fortran/expr.c
    trunk/gcc/fortran/intrinsic.c
    trunk/gcc/fortran/intrinsic.h
    trunk/gcc/fortran/match.c
    trunk/gcc/fortran/simplify.c
    trunk/gcc/testsuite/ChangeLog
    trunk/libgfortran/ChangeLog
    trunk/libgfortran/generated/matmul_c10.c
    trunk/libgfortran/generated/matmul_c16.c
    trunk/libgfortran/generated/matmul_c4.c
    trunk/libgfortran/generated/matmul_c8.c
    trunk/libgfortran/generated/matmul_i16.c
    trunk/libgfortran/generated/matmul_i4.c
    trunk/libgfortran/generated/matmul_i8.c
    trunk/libgfortran/generated/matmul_r10.c
    trunk/libgfortran/generated/matmul_r16.c
    trunk/libgfortran/generated/matmul_r4.c
    trunk/libgfortran/generated/matmul_r8.c
    trunk/libgfortran/m4/matmul.m4


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25049


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug fortran/25049] TRANSPOSE not allowed in initialisation expression
  2005-11-26 17:45 [Bug fortran/25049] New: better diagnostic needed jv244 at cam dot ac dot uk
  2005-11-26 19:03 ` [Bug fortran/25049] TRANSPOSE not allowed in initialisation expression fxcoudert at gcc dot gnu dot org
  2006-06-20  4:31 ` pault at gcc dot gnu dot org
@ 2006-06-23  4:47 ` pault at gcc dot gnu dot org
  2006-06-23 15:40 ` pault at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-06-23  4:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pault at gcc dot gnu dot org  2006-06-23 04:47 -------
Subject: Bug 25049

Author: pault
Date: Fri Jun 23 04:46:50 2006
New Revision: 114925

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=114925
Log:
2006-06-23  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/25049
        PR fortran/25050
        * check.c (non_init_transformational): New function.
        (find_substring_ref): New function to signal use of disallowed
        transformational intrinsic in an initialization expression.
        (gfc_check_all_any): Call previous if initialization expr.
        (gfc_check_count): The same.
        (gfc_check_cshift): The same.
        (gfc_check_dot_product): The same.
        (gfc_check_eoshift): The same.
        (gfc_check_minloc_maxloc): The same.
        (gfc_check_minval_maxval): The same.
        (gfc_check_gfc_check_product_sum): The same.
        (gfc_check_pack): The same.
        (gfc_check_spread): The same.
        (gfc_check_transpose): The same.
        (gfc_check_unpack): The same.

        PR fortran/18769
        *intrinsic.c (add_functions): Add gfc_simplify_transfer.
        *intrinsic.h : Add prototype for gfc_simplify_transfer.
        *simplify.c (gfc_simplify_transfer) : New function to act as
        placeholder for eventual implementation.  Emit error for now.

        PR fortran/16206
        * expr.c (find_array_element): Eliminate condition on length of
        offset. Add bounds checking. Rearrange exit. Return try and
        put gfc_constructor result as an argument.
        (find_array_section): New function.
        (find_substring_ref): New function.
        (simplify_const_ref): Add calls to previous.
        (simplify_parameter_variable): Return on NULL expr.
        (gfc_simplify_expr): Only call gfc_expand_constructor for full
        arrays.

        PR fortran/20876
        * match.c (gfc_match_forall): Add missing locus to gfc_code.

2006-06-23  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/16206
        * gfortran.dg/array_initializer_1.f90: New test.

Added:
    branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/array_initializer_1.f90
Modified:
    branches/gcc-4_1-branch/gcc/fortran/ChangeLog
    branches/gcc-4_1-branch/gcc/fortran/check.c
    branches/gcc-4_1-branch/gcc/fortran/expr.c
    branches/gcc-4_1-branch/gcc/fortran/intrinsic.c
    branches/gcc-4_1-branch/gcc/fortran/intrinsic.h
    branches/gcc-4_1-branch/gcc/fortran/match.c
    branches/gcc-4_1-branch/gcc/fortran/simplify.c
    branches/gcc-4_1-branch/gcc/testsuite/ChangeLog


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25049


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug fortran/25049] TRANSPOSE not allowed in initialisation expression
  2005-11-26 17:45 [Bug fortran/25049] New: better diagnostic needed jv244 at cam dot ac dot uk
                   ` (2 preceding siblings ...)
  2006-06-23  4:47 ` pault at gcc dot gnu dot org
@ 2006-06-23 15:40 ` pault at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-06-23 15:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pault at gcc dot gnu dot org  2006-06-23 15:40 -------
Fixed on trunk and 4.1

Paul


-- 

pault at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25049


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-06-23 15:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-26 17:45 [Bug fortran/25049] New: better diagnostic needed jv244 at cam dot ac dot uk
2005-11-26 19:03 ` [Bug fortran/25049] TRANSPOSE not allowed in initialisation expression fxcoudert at gcc dot gnu dot org
2006-06-20  4:31 ` pault at gcc dot gnu dot org
2006-06-23  4:47 ` pault at gcc dot gnu dot org
2006-06-23 15:40 ` pault at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).