public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/40728]  New: Bogus error "Error: Can't convert UNKNOWN to REAL(8) at (1)"
@ 2009-07-12 22:16 burnus at gcc dot gnu dot org
  2009-07-12 22:19 ` [Bug fortran/40728] " burnus at gcc dot gnu dot org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: burnus at gcc dot gnu dot org @ 2009-07-12 22:16 UTC (permalink / raw)
  To: gcc-bugs

If one runs the attached Fortran 2008 program with GCC 4.4 and default options
one gets:
  Error: 'x' argument of 'acos' intrinsic at (1) must be REAL
for the complex arguments, which is OK.

However, using -std=f2003 one gets additionally warnings of the kind:

  r4 = asinh(r4)
       1
Error: Can't convert UNKNOWN to REAL(4) at (1)

Which are completely bogus. (The attached file is a testcase for the complex
acos etc. implementation for PR 33197.)


-- 
           Summary: Bogus error "Error: Can't convert UNKNOWN to REAL(8) at
                    (1)"
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Keywords: rejects-valid, diagnostic
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: burnus at gcc dot gnu dot org


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


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

* [Bug fortran/40728] Bogus error "Error: Can't convert UNKNOWN to REAL(8) at (1)"
  2009-07-12 22:16 [Bug fortran/40728] New: Bogus error "Error: Can't convert UNKNOWN to REAL(8) at (1)" burnus at gcc dot gnu dot org
@ 2009-07-12 22:19 ` burnus at gcc dot gnu dot org
  2009-07-22  8:12 ` burnus at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: burnus at gcc dot gnu dot org @ 2009-07-12 22:19 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from burnus at gcc dot gnu dot org  2009-07-12 22:19 -------
Created an attachment (id=18181)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18181&action=view)
Test case


-- 


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


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

* [Bug fortran/40728] Bogus error "Error: Can't convert UNKNOWN to REAL(8) at (1)"
  2009-07-12 22:16 [Bug fortran/40728] New: Bogus error "Error: Can't convert UNKNOWN to REAL(8) at (1)" burnus at gcc dot gnu dot org
  2009-07-12 22:19 ` [Bug fortran/40728] " burnus at gcc dot gnu dot org
@ 2009-07-22  8:12 ` burnus at gcc dot gnu dot org
  2009-07-22  8:38 ` burnus at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: burnus at gcc dot gnu dot org @ 2009-07-22  8:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from burnus at gcc dot gnu dot org  2009-07-22 08:11 -------
The error comes about since with -std=2003, asinh is not an available
intrinsic. Solution for the testcase/attached file: "-fall-intrinsics" or
removal of a(sin,cos,tan)h - which were added only with F2008 though the REAL
version was a GNU extension before.

 * * *

Current result (4.4, 4.5):

  Error: Can't convert UNKNOWN to REAL(4) at (1)


Expected: A better error message such as gfortran 4.2 had ["Regression"]:

  Error: Function 'asinh' at (1) has no IMPLICIT type


If one enables implicit typing (or explicitly types the function), one gets the
expected:
  undefined reference to `asinh_'

And if one uses "abcd", one gets the old 4.2 error. I tried to trace the
problem - with out success so far. At least the function gfc_is_intrinsic seems
to work.


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|rejects-valid               |


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


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

* [Bug fortran/40728] Bogus error "Error: Can't convert UNKNOWN to REAL(8) at (1)"
  2009-07-12 22:16 [Bug fortran/40728] New: Bogus error "Error: Can't convert UNKNOWN to REAL(8) at (1)" burnus at gcc dot gnu dot org
  2009-07-12 22:19 ` [Bug fortran/40728] " burnus at gcc dot gnu dot org
  2009-07-22  8:12 ` burnus at gcc dot gnu dot org
@ 2009-07-22  8:38 ` burnus at gcc dot gnu dot org
  2009-07-23  8:52 ` burnus at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: burnus at gcc dot gnu dot org @ 2009-07-22  8:38 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from burnus at gcc dot gnu dot org  2009-07-22 08:38 -------
Found it: In "resolve_function" one has:

      switch (procedure_kind (sym))
        {
        case PTYPE_GENERIC: ...
        case PTYPE_SPECIFIC: ...
        case PTYPE_UNKNOWN: ...

The correct branch would be "PTYPE_UNKNOWN", which correctly give the error.
But "procedure_kind" calls "generic_sym", which in turns calls:

  if (sym->attr.generic ||
      (sym->attr.intrinsic && gfc_generic_intrinsic (sym->name)))
    return 1;

The gfc_generic_intrinsic justs checks:
  sym = gfc_find_function (name);
  return (sym == NULL) ? 0 : sym->generic;

Expected: In the latter, one needs to add a
  gfc_check_intrinsic_standard (sym, NULL, true, 

Analogously for: gfc_specific_intrinsic.


-- 


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


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

* [Bug fortran/40728] Bogus error "Error: Can't convert UNKNOWN to REAL(8) at (1)"
  2009-07-12 22:16 [Bug fortran/40728] New: Bogus error "Error: Can't convert UNKNOWN to REAL(8) at (1)" burnus at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2009-07-22  8:38 ` burnus at gcc dot gnu dot org
@ 2009-07-23  8:52 ` burnus at gcc dot gnu dot org
  2010-04-18 15:28 ` dominiq at lps dot ens dot fr
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: burnus at gcc dot gnu dot org @ 2009-07-23  8:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from burnus at gcc dot gnu dot org  2009-07-23 08:52 -------
Hmm, to early, the gfc_*_intrinsic are not called, unless attr.intrinsic is
set. The but the issue is indeed that they are regarded as PTYPE_SPECIFIC and
not as PTYPE_UNKNOWN, as a printf in resolve_function shows - the question is
only why.

 * * *

The following program causes an ICE in gfc_typenode_for_spec due to BT_UNKNOWN
-- and no warning/error is shown before ("gfortran -std=f95"):

implicit none
real :: r
r = 0.4
print *, atanh(r)
end


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-invalid-code


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


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

* [Bug fortran/40728] Bogus error "Error: Can't convert UNKNOWN to REAL(8) at (1)"
  2009-07-12 22:16 [Bug fortran/40728] New: Bogus error "Error: Can't convert UNKNOWN to REAL(8) at (1)" burnus at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2009-07-23  8:52 ` burnus at gcc dot gnu dot org
@ 2010-04-18 15:28 ` dominiq at lps dot ens dot fr
  2010-04-22 18:33 ` tkoenig at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: dominiq at lps dot ens dot fr @ 2010-04-18 15:28 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from dominiq at lps dot ens dot fr  2010-04-18 15:28 -------
Both the bogus error and the ICE (also with std=f95) are still there. The PR
should be marked NEW.


-- 


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


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

* [Bug fortran/40728] Bogus error "Error: Can't convert UNKNOWN to REAL(8) at (1)"
  2009-07-12 22:16 [Bug fortran/40728] New: Bogus error "Error: Can't convert UNKNOWN to REAL(8) at (1)" burnus at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2010-04-18 15:28 ` dominiq at lps dot ens dot fr
@ 2010-04-22 18:33 ` tkoenig at gcc dot gnu dot org
  2010-05-06 21:06 ` dfranke at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2010-04-22 18:33 UTC (permalink / raw)
  To: gcc-bugs



-- 

tkoenig at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2010-04-22 18:33:25
               date|                            |


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


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

* [Bug fortran/40728] Bogus error "Error: Can't convert UNKNOWN to REAL(8) at (1)"
  2009-07-12 22:16 [Bug fortran/40728] New: Bogus error "Error: Can't convert UNKNOWN to REAL(8) at (1)" burnus at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2010-04-22 18:33 ` tkoenig at gcc dot gnu dot org
@ 2010-05-06 21:06 ` dfranke at gcc dot gnu dot org
  2010-05-07 15:37 ` dfranke at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2010-05-06 21:06 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from dfranke at gcc dot gnu dot org  2010-05-06 21:06 -------
Patch:
    http://gcc.gnu.org/ml/fortran/2010-05/msg00040.html


-- 

dfranke at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |dfranke at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2010-04-22 18:33:25         |2010-05-06 21:06:27
               date|                            |


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


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

* [Bug fortran/40728] Bogus error "Error: Can't convert UNKNOWN to REAL(8) at (1)"
  2009-07-12 22:16 [Bug fortran/40728] New: Bogus error "Error: Can't convert UNKNOWN to REAL(8) at (1)" burnus at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2010-05-06 21:06 ` dfranke at gcc dot gnu dot org
@ 2010-05-07 15:37 ` dfranke at gcc dot gnu dot org
  2010-05-07 18:13 ` dfranke at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2010-05-07 15:37 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from dfranke at gcc dot gnu dot org  2010-05-07 15:37 -------
Subject: Bug 40728

Author: dfranke
Date: Fri May  7 15:36:45 2010
New Revision: 159155

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=159155
Log:
gcc/fortran/:
2010-05-07  Daniel Franke  <franke.daniel@gmail.com>

        PR fortran/40728
        * intrinc.c (gfc_is_intrinsic): Do not prematurely mark symbol
        as external


gcc/testsuite/:
2010-05-07  Daniel Franke  <franke.daniel@gmail.com>

        PR fortran/40728
        * gfortran.dg/coarray_1.f90: Fixed error message.
        * gfortran.dg/selected_char_kind_3.f90: Fixed error message.
        * gfortran.dg/intrinsic_std_1.f90: Fixed bogus message.
        * gfortran.dg/intrinsic_std_5.f90: New.


Added:
    trunk/gcc/testsuite/gfortran.dg/intrinsic_std_5.f03
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/intrinsic.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gfortran.dg/coarray_1.f90
    trunk/gcc/testsuite/gfortran.dg/intrinsic_std_1.f90
    trunk/gcc/testsuite/gfortran.dg/selected_char_kind_3.f90


-- 


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


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

* [Bug fortran/40728] Bogus error "Error: Can't convert UNKNOWN to REAL(8) at (1)"
  2009-07-12 22:16 [Bug fortran/40728] New: Bogus error "Error: Can't convert UNKNOWN to REAL(8) at (1)" burnus at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2010-05-07 15:37 ` dfranke at gcc dot gnu dot org
@ 2010-05-07 18:13 ` dfranke at gcc dot gnu dot org
  2010-05-12 10:12 ` dfranke at gcc dot gnu dot org
  2010-05-12 10:12 ` dfranke at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2010-05-07 18:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from dfranke at gcc dot gnu dot org  2010-05-07 18:12 -------
*** Bug 43539 has been marked as a duplicate of this bug. ***


-- 

dfranke at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dominiq at lps dot ens dot
                   |                            |fr


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


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

* [Bug fortran/40728] Bogus error "Error: Can't convert UNKNOWN to REAL(8) at (1)"
  2009-07-12 22:16 [Bug fortran/40728] New: Bogus error "Error: Can't convert UNKNOWN to REAL(8) at (1)" burnus at gcc dot gnu dot org
                   ` (9 preceding siblings ...)
  2010-05-12 10:12 ` dfranke at gcc dot gnu dot org
@ 2010-05-12 10:12 ` dfranke at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2010-05-12 10:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from dfranke at gcc dot gnu dot org  2010-05-12 10:12 -------
Subject: Bug 40728

Author: dfranke
Date: Wed May 12 10:11:50 2010
New Revision: 159306

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=159306
Log:
gcc/fortran/:
2010-05-12  Daniel Franke  <franke.daniel@gmail.com>

        PR fortran/40728
        * intrinc.c (gfc_is_intrinsic): Do not prematurely mark symbol
        as external.

gcc/testsuite/:
2010-05-12  Daniel Franke  <franke.daniel@gmail.com>

        PR fortran/40728
        * gfortran.dg/selected_char_kind_3.f90: Fixed error message.
        * gfortran.dg/intrinsic_std_1.f90: Fixed bogus message.
        * gfortran.dg/intrinsic_std_5.f03: New.


Added:
    branches/gcc-4_5-branch/gcc/testsuite/gfortran.dg/intrinsic_std_5.f03
Modified:
    branches/gcc-4_5-branch/gcc/fortran/ChangeLog
    branches/gcc-4_5-branch/gcc/fortran/intrinsic.c
    branches/gcc-4_5-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_5-branch/gcc/testsuite/gfortran.dg/intrinsic_std_1.f90
    branches/gcc-4_5-branch/gcc/testsuite/gfortran.dg/selected_char_kind_3.f90


-- 


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


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

* [Bug fortran/40728] Bogus error "Error: Can't convert UNKNOWN to REAL(8) at (1)"
  2009-07-12 22:16 [Bug fortran/40728] New: Bogus error "Error: Can't convert UNKNOWN to REAL(8) at (1)" burnus at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2010-05-07 18:13 ` dfranke at gcc dot gnu dot org
@ 2010-05-12 10:12 ` dfranke at gcc dot gnu dot org
  2010-05-12 10:12 ` dfranke at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2010-05-12 10:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from dfranke at gcc dot gnu dot org  2010-05-12 10:12 -------
Fixed in 4.5 and trunk. Closing.


-- 

dfranke at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.5.1


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


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

end of thread, other threads:[~2010-05-12 10:12 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-12 22:16 [Bug fortran/40728] New: Bogus error "Error: Can't convert UNKNOWN to REAL(8) at (1)" burnus at gcc dot gnu dot org
2009-07-12 22:19 ` [Bug fortran/40728] " burnus at gcc dot gnu dot org
2009-07-22  8:12 ` burnus at gcc dot gnu dot org
2009-07-22  8:38 ` burnus at gcc dot gnu dot org
2009-07-23  8:52 ` burnus at gcc dot gnu dot org
2010-04-18 15:28 ` dominiq at lps dot ens dot fr
2010-04-22 18:33 ` tkoenig at gcc dot gnu dot org
2010-05-06 21:06 ` dfranke at gcc dot gnu dot org
2010-05-07 15:37 ` dfranke at gcc dot gnu dot org
2010-05-07 18:13 ` dfranke at gcc dot gnu dot org
2010-05-12 10:12 ` dfranke at gcc dot gnu dot org
2010-05-12 10:12 ` dfranke 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).