[Bug fortran/49627] NINT(x,16) doesn't work (at all, ever, I don't think)

2018-10-24 Thread gs...@t-online.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49627

G. Steinmetz  changed:

   What|Removed |Added

 CC||gs...@t-online.de

--- Comment #6 from G. Steinmetz  ---

While pr65757 is solved, this still gives an ICE in my environment
in combination with a variable :


$ cat z1.f90
program test
  real(16) :: x = 2466840987.123067e0_16
  print *, nint(x, 16)
end


$ gfortran-9-20181021 -c z1.f90
z1.f90:3:0:

3 |print *, nint(x, 16)
  |
internal compiler error: in build_round_expr, at fortran/trans-intrinsic.c:396
0x702fec build_round_expr
../../gcc/fortran/trans-intrinsic.c:396
0x702fec build_fix_expr
../../gcc/fortran/trans-intrinsic.c:420
0x7030ca gfc_conv_intrinsic_int
../../gcc/fortran/trans-intrinsic.c:550
0x711947 gfc_conv_intrinsic_function(gfc_se*, gfc_expr*)
../../gcc/fortran/trans-intrinsic.c:9202
0x6f7d04 gfc_conv_function_expr
../../gcc/fortran/trans-expr.c:6864
0x6ec45a gfc_conv_expr(gfc_se*, gfc_expr*)
../../gcc/fortran/trans-expr.c:7998
0x6f1e05 gfc_conv_expr_reference(gfc_se*, gfc_expr*, bool)
../../gcc/fortran/trans-expr.c:8143
0x7182b7 gfc_trans_transfer(gfc_code*)
../../gcc/fortran/trans-io.c:2584
0x6bdbc7 trans_code
../../gcc/fortran/trans.c:2038
0x715dae build_dt
../../gcc/fortran/trans-io.c:2026
0x6bdba7 trans_code
../../gcc/fortran/trans.c:2010
0x6e51c4 gfc_generate_function_code(gfc_namespace*)
../../gcc/fortran/trans-decl.c:6505
0x673426 translate_all_program_units
../../gcc/fortran/parse.c:6125
0x673426 gfc_parse_file()
../../gcc/fortran/parse.c:6328
0x6ba3ff gfc_be_parse_file
../../gcc/fortran/f95-lang.c:204



Works with a parameter/constant instead :

$ cat z2.f90
program test
   real(16), parameter :: x = 2466840987.123067e0_16
   print *, nint(x, 16)
end

$ gfortran-9-20181021 -static-libgfortran z2.f90
$ a.out
 2466840987

[Bug fortran/49627] NINT(x,16) doesn't work (at all, ever, I don't think)

2016-03-19 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49627

kargl at gcc dot gnu.org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||kargl at gcc dot gnu.org
 Resolution|--- |DUPLICATE

--- Comment #5 from kargl at gcc dot gnu.org ---
Even though 49627 is older than 65757, the new
report actually discusses how to fix the bug.

*** This bug has been marked as a duplicate of bug 65757 ***

[Bug fortran/49627] NINT(x,16) doesn't work (at all, ever, I don't think)

2016-01-27 Thread dr.robert.kosik at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49627

dr.robert.kosik at gmail dot com changed:

   What|Removed |Added

 CC||dr.robert.kosik at gmail dot 
com

--- Comment #4 from dr.robert.kosik at gmail dot com ---
This Bug is still open in 2016-01-27 with gfortran 4.8.4

double precision :: X
integer(16) :: norm
norm = NINT(X,KIND=16)

internal compiler error: in build_round_expr, at fortran/trans-intrinsic.c:394
   norm = NINT(X,KIND=16)
 ^
Please submit a full bug report.

It works fine with other types of rounding, i.e., INT(X,16), FLOOR(X,16),
CEILING(X,16) compile ok.

[Bug fortran/49627] NINT(x,16) doesn't work (at all, ever, I don't think)

2013-01-07 Thread dominiq at lps dot ens.fr


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



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



   What|Removed |Added



 Status|UNCONFIRMED |NEW

   Last reconfirmed||2013-01-07

 Ever Confirmed|0   |1



--- Comment #3 from Dominique d'Humieres dominiq at lps dot ens.fr 2013-01-07 
23:02:06 UTC ---

Still here at revision 194996:



pr49627.f90: In function 'test14':

pr49627.f90:4:0: internal compiler error: in build_round_expr, at

fortran/trans-intrinsic.c:396

   print*,NINT(x,16)


[Bug fortran/49627] NINT(x,16) doesn't work (at all, ever, I don't think)

2011-07-24 Thread dfranke at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49627

Daniel Franke dfranke at gcc dot gnu.org changed:

   What|Removed |Added

 CC||dfranke at gcc dot gnu.org
   Severity|blocker |normal

--- Comment #2 from Daniel Franke dfranke at gcc dot gnu.org 2011-07-24 
20:03:56 UTC ---
Fortran bugs are never blockers.


[Bug fortran/49627] NINT(x,16) doesn't work (at all, ever, I don't think)

2011-07-04 Thread burnus at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49627

Tobias Burnus burnus at gcc dot gnu.org changed:

   What|Removed |Added

  Attachment #24672|application/octet-stream|text/plain
  mime type||

--- Comment #1 from Tobias Burnus burnus at gcc dot gnu.org 2011-07-04 
12:12:25 UTC ---
Comment on attachment 24672
  -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=24672
very short (5 line) program illlustrating problem

Fails with:

test14.f90:4:0: internal compiler error: in build_round_expr, at
fortran/trans-intrinsic.c:393

 388   if (resprec = LONG_TYPE_SIZE)
 389 longlong = false;
 390   else if (resprec = LONG_LONG_TYPE_SIZE)
 391 longlong = true;
 392   else
 393 gcc_unreachable ();

I think one needs to replace
  fn = builtin_decl_for_precision (BUILT_IN_LLROUND, argprec);
by something like
  fn = gfc_builtin_decl_for_float_kind (BUILT_IN_LROUND, ...)