public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libfortran/60706] New: FAIL: gfortran.dg/size_kind_2.f90  -O   scan-tree-dump original "var2 = 42949673 00;"
@ 2014-03-29 19:38 danglin at gcc dot gnu.org
  2014-03-31  8:40 ` [Bug libfortran/60706] " rguenth at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: danglin at gcc dot gnu.org @ 2014-03-29 19:38 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 60706
           Summary: FAIL: gfortran.dg/size_kind_2.f90  -O   scan-tree-dump
                    original "var2 = 42949673 00;"
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libfortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: danglin at gcc dot gnu.org
              Host: hppa2.0w-hp-hpux11.11
            Target: hppa2.0w-hp-hpux11.11
             Build: hppa2.0w-hp-hpux11.11

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:

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;
  }
}


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

* [Bug libfortran/60706] FAIL: gfortran.dg/size_kind_2.f90  -O   scan-tree-dump original "var2 = 42949673 00;"
  2014-03-29 19:38 [Bug libfortran/60706] New: FAIL: gfortran.dg/size_kind_2.f90 -O scan-tree-dump original "var2 = 42949673 00;" danglin at gcc dot gnu.org
@ 2014-03-31  8:40 ` rguenth at gcc dot gnu.org
  2014-03-31  8:53 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-03-31  8:40 UTC (permalink / raw)
  To: gcc-bugs

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;
>   }
> }


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

* [Bug libfortran/60706] FAIL: gfortran.dg/size_kind_2.f90  -O   scan-tree-dump original "var2 = 42949673 00;"
  2014-03-29 19:38 [Bug libfortran/60706] New: FAIL: gfortran.dg/size_kind_2.f90 -O scan-tree-dump original "var2 = 42949673 00;" danglin at gcc dot gnu.org
  2014-03-31  8:40 ` [Bug libfortran/60706] " rguenth at gcc dot gnu.org
@ 2014-03-31  8:53 ` rguenth at gcc dot gnu.org
  2014-04-03  0:41 ` dave.anglin at bell dot net
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-03-31  8:53 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Like this.  If that works for you it's pre-approved.  Only implements the
special-case (the gmp path would probably have a lot of testsuite fallout?).
I don't have a suitable target to test this on where the path isn't optimized
away.

Index: gcc/tree-pretty-print.c
===================================================================
--- gcc/tree-pretty-print.c     (revision 208954)
+++ gcc/tree-pretty-print.c     (working copy)
@@ -3465,6 +3467,12 @@ pp_double_int (pretty_printer *pp, doubl
     pp_wide_integer (pp, d.low);
   else if (d.fits_uhwi ())
     pp_unsigned_wide_integer (pp, d.low);
+  else if (HOST_BITS_PER_DOUBLE_INT == HOST_BITS_PER_WIDEST_INT)
+    pp_scalar (pp,
+              uns ? HOST_WIDEST_INT_PRINT_UNSIGNED :
HOST_WIDEST_INT_PRINT_DEC,
+              (HOST_WIDEST_INT)
+                (((unsigned HOST_WIDEST_INT) d.high << HOST_BITS_PER_WIDE_INT)
+                 | d.low));
   else
     {
       unsigned HOST_WIDE_INT low = d.low;


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

* [Bug libfortran/60706] FAIL: gfortran.dg/size_kind_2.f90  -O   scan-tree-dump original "var2 = 42949673 00;"
  2014-03-29 19:38 [Bug libfortran/60706] New: FAIL: gfortran.dg/size_kind_2.f90 -O scan-tree-dump original "var2 = 42949673 00;" danglin at gcc dot gnu.org
  2014-03-31  8:40 ` [Bug libfortran/60706] " rguenth at gcc dot gnu.org
  2014-03-31  8:53 ` rguenth at gcc dot gnu.org
@ 2014-04-03  0:41 ` dave.anglin at bell dot net
  2014-04-03 10:25 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: dave.anglin at bell dot net @ 2014-04-03  0:41 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from dave.anglin at bell dot net ---
On 31-Mar-14, at 4:53 AM, rguenth at gcc dot gnu.org wrote:

> Like this.  If that works for you it's pre-approved.  Only  
> implements the
> special-case (the gmp path would probably have a lot of testsuite  
> fallout?).
> I don't have a suitable target to test this on where the path isn't  
> optimized
> away.

Fails on hppa64-hp-hpux11.11:

In file included from ../../gcc/gcc/tree-pretty-print.h:25:0,
                  from ../../gcc/gcc/tree-pretty-print.c:28:
../../gcc/gcc/tree-pretty-print.c: In function 'void  
pp_double_int(pretty_printe
r*, double_int, bool)':
../../gcc/gcc/hwint.h:16:52: error: left shift count >= width of type  
[-Werror]
  #define HOST_BITS_PER_LONG  (CHAR_BIT * SIZEOF_LONG)
                                                     ^
../../gcc/gcc/pretty-print.h:257:54: note: in definition of macro  
'pp_scalar'
        sprintf (pp_buffer (PP)->digit_buffer, FORMAT, SCALAR); \
                                                       ^
../../gcc/gcc/hwint.h:60:35: note: in expansion of macro  
'HOST_BITS_PER_LONG'
  #   define HOST_BITS_PER_WIDE_INT HOST_BITS_PER_LONG
                                    ^
../../gcc/gcc/tree-pretty-print.c:3472:43: note: in expansion of macro  
'HOST_BIT
S_PER_WIDE_INT'
     (((unsigned HOST_WIDEST_INT) d.high << HOST_BITS_PER_WIDE_INT)
                                            ^

--
John David Anglin    dave.anglin@bell.net


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

* [Bug libfortran/60706] FAIL: gfortran.dg/size_kind_2.f90  -O   scan-tree-dump original "var2 = 42949673 00;"
  2014-03-29 19:38 [Bug libfortran/60706] New: FAIL: gfortran.dg/size_kind_2.f90 -O scan-tree-dump original "var2 = 42949673 00;" danglin at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2014-04-03  0:41 ` dave.anglin at bell dot net
@ 2014-04-03 10:25 ` rguenth at gcc dot gnu.org
  2014-04-03 13:57 ` dave.anglin at bell dot net
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-04-03 10:25 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
But I guess from your comment that it fixed the testcase on
hppa2.0w-hp-hpux11.11?


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

* [Bug libfortran/60706] FAIL: gfortran.dg/size_kind_2.f90  -O   scan-tree-dump original "var2 = 42949673 00;"
  2014-03-29 19:38 [Bug libfortran/60706] New: FAIL: gfortran.dg/size_kind_2.f90 -O scan-tree-dump original "var2 = 42949673 00;" danglin at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2014-04-03 10:25 ` rguenth at gcc dot gnu.org
@ 2014-04-03 13:57 ` dave.anglin at bell dot net
  2014-04-08 12:57 ` rguenth at gcc dot gnu.org
  2014-04-08 12:57 ` rguenth at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: dave.anglin at bell dot net @ 2014-04-03 13:57 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from dave.anglin at bell dot net ---
On 4/3/2014 6:25 AM, rguenth at gcc dot gnu.org wrote:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60706
>
> --- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
> But I guess from your comment that it fixed the testcase on
> hppa2.0w-hp-hpux11.11?
>
Yes, it did.


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

* [Bug libfortran/60706] FAIL: gfortran.dg/size_kind_2.f90  -O   scan-tree-dump original "var2 = 42949673 00;"
  2014-03-29 19:38 [Bug libfortran/60706] New: FAIL: gfortran.dg/size_kind_2.f90 -O scan-tree-dump original "var2 = 42949673 00;" danglin at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2014-04-08 12:57 ` rguenth at gcc dot gnu.org
@ 2014-04-08 12:57 ` rguenth at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-04-08 12:57 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |FIXED

--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed.


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

* [Bug libfortran/60706] FAIL: gfortran.dg/size_kind_2.f90  -O   scan-tree-dump original "var2 = 42949673 00;"
  2014-03-29 19:38 [Bug libfortran/60706] New: FAIL: gfortran.dg/size_kind_2.f90 -O scan-tree-dump original "var2 = 42949673 00;" danglin at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2014-04-03 13:57 ` dave.anglin at bell dot net
@ 2014-04-08 12:57 ` rguenth at gcc dot gnu.org
  2014-04-08 12:57 ` rguenth at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-04-08 12:57 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> ---
Author: rguenth
Date: Tue Apr  8 12:57:07 2014
New Revision: 209216

URL: http://gcc.gnu.org/viewcvs?rev=209216&root=gcc&view=rev
Log:
2014-04-08  Richard Biener  <rguenther@suse.de>

    PR middle-end/60706
    * tree-pretty-print.c (pp_double_int): For HWI32 hosts with
    a 64bit widest int print double-int similar to on HWI64 hosts.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/tree-pretty-print.c


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

end of thread, other threads:[~2014-04-08 12:57 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-29 19:38 [Bug libfortran/60706] New: FAIL: gfortran.dg/size_kind_2.f90 -O scan-tree-dump original "var2 = 42949673 00;" danglin at gcc dot gnu.org
2014-03-31  8:40 ` [Bug libfortran/60706] " rguenth at gcc dot gnu.org
2014-03-31  8:53 ` rguenth at gcc dot gnu.org
2014-04-03  0:41 ` dave.anglin at bell dot net
2014-04-03 10:25 ` rguenth at gcc dot gnu.org
2014-04-03 13:57 ` dave.anglin at bell dot net
2014-04-08 12:57 ` rguenth at gcc dot gnu.org
2014-04-08 12:57 ` rguenth 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).