public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/54656] New: ICE with software REAL(16) for NORM2
@ 2012-09-21 13:55 burnus at gcc dot gnu.org
  2012-09-21 13:58 ` [Bug fortran/54656] " dominiq at lps dot ens.fr
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-09-21 13:55 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 54656
           Summary: ICE with software REAL(16) for NORM2
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: burnus@gcc.gnu.org
                CC: jdelia@intec.unl.edu.ar


Reported by Jorge D'ELIA at http://gcc.gnu.org/ml/fortran/2012-09/msg00075.html

  program test79
    implicit none
    real(16) :: d(10), z
    d = 1
    z = norm2 (d)  ! ICE (segfault)
  end program test79



The problem is the following code in trans-intrinsic.c's
gfc_conv_intrinsic_arith:

  if (norm2)
    {
      /* result = scale * sqrt(result).  */
      tree sqrt;
      sqrt = gfc_builtin_decl_for_float_kind (BUILT_IN_SQRT, expr->ts.kind);

as sqrt == NULL_TREE.

Seemingly, the proper way to call the quad functions is to use
gfc_conv_intrinsic_lib_function.

Only a small subset gets a decl and is thus available in the struct
gfc_intrinsic_map, which is accessed in gfc_builtin_decl_for_float_kind.

The struct gets set gfc_build_intrinsic_lib_fndecls, but that only handles
OTHER_BUILTIN - and not DEFINE_MATH_BUILTIN_C, which is needed for SQRT.


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

* [Bug fortran/54656] ICE with software REAL(16) for NORM2
  2012-09-21 13:55 [Bug fortran/54656] New: ICE with software REAL(16) for NORM2 burnus at gcc dot gnu.org
@ 2012-09-21 13:58 ` dominiq at lps dot ens.fr
  2013-10-26  4:28 ` burnus at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: dominiq at lps dot ens.fr @ 2012-09-21 13:58 UTC (permalink / raw)
  To: gcc-bugs


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

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-09-21
     Ever Confirmed|0                           |1

--- Comment #1 from Dominique d'Humieres <dominiq at lps dot ens.fr> 2012-09-21 13:57:49 UTC ---
Confirmed.


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

* [Bug fortran/54656] ICE with software REAL(16) for NORM2
  2012-09-21 13:55 [Bug fortran/54656] New: ICE with software REAL(16) for NORM2 burnus at gcc dot gnu.org
  2012-09-21 13:58 ` [Bug fortran/54656] " dominiq at lps dot ens.fr
@ 2013-10-26  4:28 ` burnus at gcc dot gnu.org
  2015-08-16 19:32 ` fxcoudert at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: burnus at gcc dot gnu.org @ 2013-10-26  4:28 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Again reported at
https://groups.google.com/forum/#!topic/comp.lang.fortran/kvEJ5ZC-qjM


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

* [Bug fortran/54656] ICE with software REAL(16) for NORM2
  2012-09-21 13:55 [Bug fortran/54656] New: ICE with software REAL(16) for NORM2 burnus at gcc dot gnu.org
  2012-09-21 13:58 ` [Bug fortran/54656] " dominiq at lps dot ens.fr
  2013-10-26  4:28 ` burnus at gcc dot gnu.org
@ 2015-08-16 19:32 ` fxcoudert at gcc dot gnu.org
  2015-08-16 19:47 ` fxcoudert at gcc dot gnu.org
  2015-08-16 19:51 ` fxcoudert at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: fxcoudert at gcc dot gnu.org @ 2015-08-16 19:32 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54656

Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2012-09-21 00:00:00         |2015-8-16
                 CC|                            |fxcoudert at gcc dot gnu.org
           Assignee|unassigned at gcc dot gnu.org      |fxcoudert at gcc dot gnu.org

--- Comment #3 from Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> ---
Index: trans-intrinsic.c
===================================================================
--- trans-intrinsic.c   (revision 226924)
+++ trans-intrinsic.c   (working copy)
@@ -676,6 +676,11 @@ gfc_build_intrinsic_lib_fndecls (void)
 #undef DEFINE_MATH_BUILTIN
 #undef DEFINE_MATH_BUILTIN_C

+    /* There is one built-in we defined manually, because it gets called
+       with builtin_decl_for_precision() or builtin_decl_for_float_type()
+       even though it is not an OTHER_BUILTIN: it is SQRT.  */
+    quad_decls[BUILT_IN_SQRT] = define_quad_builtin ("sqrtq", func_1, true);
+
   }

   /* Add GCC builtin functions.  */


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

* [Bug fortran/54656] ICE with software REAL(16) for NORM2
  2012-09-21 13:55 [Bug fortran/54656] New: ICE with software REAL(16) for NORM2 burnus at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2015-08-16 19:32 ` fxcoudert at gcc dot gnu.org
@ 2015-08-16 19:47 ` fxcoudert at gcc dot gnu.org
  2015-08-16 19:51 ` fxcoudert at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: fxcoudert at gcc dot gnu.org @ 2015-08-16 19:47 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54656

--- Comment #4 from Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> ---
Author: fxcoudert
Date: Sun Aug 16 19:47:02 2015
New Revision: 226929

URL: https://gcc.gnu.org/viewcvs?rev=226929&root=gcc&view=rev
Log:
        PR fortran/54656

        * trans-intrinsic.c (gfc_build_intrinsic_lib_fndecls): Add decl
        for quadruple precision BUILT_IN_SQRT.

        * gfortran.dg/norm_4.f90: Rename to...
        * gfortran.dg/norm2_4.f90: this.
        * gfortran.dg/norm2_5.f90: New test.

Added:
    trunk/gcc/testsuite/gfortran.dg/norm2_4.f90
      - copied unchanged from r226894,
trunk/gcc/testsuite/gfortran.dg/norm_4.f90
    trunk/gcc/testsuite/gfortran.dg/norm2_5.f90
Removed:
    trunk/gcc/testsuite/gfortran.dg/norm_4.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/trans-intrinsic.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug fortran/54656] ICE with software REAL(16) for NORM2
  2012-09-21 13:55 [Bug fortran/54656] New: ICE with software REAL(16) for NORM2 burnus at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2015-08-16 19:47 ` fxcoudert at gcc dot gnu.org
@ 2015-08-16 19:51 ` fxcoudert at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: fxcoudert at gcc dot gnu.org @ 2015-08-16 19:51 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54656

Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |6.0

--- Comment #5 from Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> ---
Fixed on trunk. Probably not worth a backport.


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

end of thread, other threads:[~2015-08-16 19:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-21 13:55 [Bug fortran/54656] New: ICE with software REAL(16) for NORM2 burnus at gcc dot gnu.org
2012-09-21 13:58 ` [Bug fortran/54656] " dominiq at lps dot ens.fr
2013-10-26  4:28 ` burnus at gcc dot gnu.org
2015-08-16 19:32 ` fxcoudert at gcc dot gnu.org
2015-08-16 19:47 ` fxcoudert at gcc dot gnu.org
2015-08-16 19:51 ` fxcoudert at gcc dot gnu.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).