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

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to John David Anglin from comment #0)
> Executing on host:
> /test/gnu/gcc/objdir/gcc/testsuite/gfortran/../../gfortran -B
> /test/gnu/gcc/objdir/gcc/testsuite/gfortran/../../
> -B/test/gnu/gcc/objdir/hppa2.
> 0w-hp-hpux11.11/./libgfortran/
> /test/gnu/gcc/gcc/gcc/testsuite/gfortran.dg/size_
> kind_2.f90  -fno-diagnostics-show-caret -fdiagnostics-color=never   -O 
> -fdump-t
> ree-original -S  -o size_kind_2.s    (timeout = 300)
> spawn /test/gnu/gcc/objdir/gcc/testsuite/gfortran/../../gfortran
> -B/test/gnu/gcc
> /objdir/gcc/testsuite/gfortran/../../
> -B/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.
> 11/./libgfortran/
> /test/gnu/gcc/gcc/gcc/testsuite/gfortran.dg/size_kind_2.f90 -f
> no-diagnostics-show-caret -fdiagnostics-color=never -O -fdump-tree-original
> -S -
> o size_kind_2.s
> PASS: gfortran.dg/size_kind_2.f90  -O  (test for excess errors)
> PASS: gfortran.dg/size_kind_2.f90  -O   scan-tree-dump original "static
> integer.
> kind=8. A..\\[2\\] = \\{2147483650, 2\\};"
> FAIL: gfortran.dg/size_kind_2.f90  -O   scan-tree-dump original "var2 =
> 42949673
> 00;"
> PASS: gfortran.dg/size_kind_2.f90  -O   scan-tree-dump original "var3 =
> 21474836
> 50;"
> 
> Test fails because var2 in original tree dump is ouput in hex:

That is usually the case when HWI is 32bits.  It can be fixed by
enhancing tree-pretty-print.c:pp_double_int to not print double-ints
as two concated hex numbers but as one "merged" base-10 value.

Care to give that a shot? ;)  (if you have HWI == 32bit and the host
has a HOST_WIDEST_INT of 64bit then you can just add a special case
covering HOST_WIDEST_INT == 2 * HOST_WIDE_INT and using the appropriate
HOST_WIDEST_INT_PRINT_DEC)

One possibility for the 2 * HWI printing path would be to go via
mpz_set_double_int and gmp_sprintf.  IMHO the HOST_WIDEST_INT == 2 *
HOST_WIDE_INT case is worth special-casing anyway.

> MAIN__ ()
> {
>   integer(kind=4) b[4];
>   integer(kind=8) var1[2];
>   integer(kind=8) var2;
>   integer(kind=8) var3;
> 
>   {
>     static integer(kind=8) A.0[2] = {2147483650, 2};
> 
>     (void) (MEM[(c_char * {ref-all})&var1] = MEM[(c_char * {ref-all})&A.0]);
>     var2 = 0x100000004;
>     var3 = 2147483650;
>   }
> }

Reply via email to