The attached and committed patch updates gfortran expression dumper to do something sensible with a gfc_expr that is a BT_BOZ basic type. That is, for
program a real :: x = real(b'10101') real :: y = real(o'4444') real :: z = real(z'abcd') print *, x, y, z end program a if one is in gdb, you now get (in gfc_boz2real). (gdb) call debug(x) b'10101' (BOZ 0) (gdb) call debug(x) o'4444' (BOZ 0) (gdb) call debug(x) z'abcd' (BOZ 0) 2019-10-23 Steven G. Kargl <ka...@gcc.gnu.org> dump-parse-tree.c (show_expr): Add dumping of BT_BOZ constants. -- Steve
Index: gcc/fortran/dump-parse-tree.c =================================================================== --- gcc/fortran/dump-parse-tree.c (revision 277296) +++ gcc/fortran/dump-parse-tree.c (working copy) @@ -559,6 +559,16 @@ show_expr (gfc_expr *p) fputc (')', dumpfile); break; + case BT_BOZ: + if (p->boz.rdx == 2) + fputs ("b'", dumpfile); + else if (p->boz.rdx == 8) + fputs ("o'", dumpfile); + else + fputs ("z'", dumpfile); + fprintf (dumpfile, "%s'", p->boz.str); + break; + case BT_HOLLERITH: fprintf (dumpfile, HOST_WIDE_INT_PRINT_DEC "H", p->representation.length);