This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: ICE using norm2 in quadruple-precision


On Thu, Sep 20, 2012 at 03:15:57PM -0300, Jorge D'ELIA wrote:
> 
> I have an ICE using norm2 in quadruple-precision 
> and 4.8.0 20120722 (experimental) version, with either
> 

Thanks for the report.  Reduced testcase

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

(gdb) run p.f90
Starting program: /usr/home/sgk/work/4x/libexec/gcc/x86_64-unknown-freebsd10.0/4.8.0/f951 p.f90
 test79
Program received signal SIGSEGV, Segmentation fault.
build_call_expr_loc_array (loc=516, fndecl=0x0, n=1, argarray=0x7fffffffc980)
    at ../../gcc4x/gcc/builtins.c:11152
11152   ../../gcc4x/gcc/builtins.c: No such file or directory.
(gdb) bt
#0  build_call_expr_loc_array (loc=516, fndecl=0x0, n=1, 
    argarray=0x7fffffffc980) at ../../gcc4x/gcc/builtins.c:11152
#1  0x00000000006606b5 in build_call_expr_loc (loc=516, fndecl=0x0, n=1)
    at ../../gcc4x/gcc/builtins.c:11185
#2  0x000000000060e19b in gfc_conv_intrinsic_arith (se=0x7fffffffd110, 
    expr=0x2030a6540, op=44611360, norm2=true)
    at ../../gcc4x/gcc/fortran/trans-intrinsic.c:2850
#3  0x000000000061c35c in gfc_conv_intrinsic_function (se=0x7fffffffd110, 
    expr=0x2030a6540) at ../../gcc4x/gcc/fortran/trans-intrinsic.c:6676
#4  0x0000000000604bf7 in gfc_trans_assignment_1 (expr1=0x2030a6480, 
    expr2=0x2030a6540, init_flag=false, dealloc=true)
    at ../../gcc4x/gcc/fortran/trans-expr.c:7279
#5  0x00000000005d1096 in trans_code (code=0x2030a66c0, cond=0x0)
    at ../../gcc4x/gcc/fortran/trans.c:1312
#6  0x00000000005f960a in gfc_generate_function_code (ns=0x203050c00)
    at ../../gcc4x/gcc/fortran/trans-decl.c:5361
#7  0x0000000000591fd4 in translate_all_program_units (
    main_in_tu=<optimized out>, gfc_global_ns_list=0x203050c00)
    at ../../gcc4x/gcc/fortran/parse.c:4466
#8  gfc_parse_file () at ../../gcc4x/gcc/fortran/parse.c:4680
#9  0x00000000005cc746 in gfc_be_parse_file ()
    at ../../gcc4x/gcc/fortran/f95-lang.c:191
#10 0x0000000000998ed6 in compile_file () at ../../gcc4x/gcc/toplev.c:546
#11 0x000000000099979b in do_compile () at ../../gcc4x/gcc/toplev.c:1863
#12 0x000000000099a255 in toplev_main (argc=2, argv=0x7fffffffd500)
    at ../../gcc4x/gcc/toplev.c:1939
#13 0x0000000000527cdd in _start ()

The relevant section of code in trans-intrinsic.c is

  if (norm2)
    {
      /* result = scale * sqrt(result).  */
      tree sqrt;
      sqrt = gfc_builtin_decl_for_float_kind (BUILT_IN_SQRT, expr->ts.kind);
      resvar = build_call_expr_loc (input_location,
				    sqrt, 1, resvar);
      resvar = fold_build2_loc (input_location, MULT_EXPR, type, scale, resvar);
    }

and sqrt = NULL.

-- 
Steve


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]