This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/19334] ISHFT has the wrong type for constant values
- From: "tobi at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 9 Jan 2005 12:29:48 -0000
- Subject: [Bug fortran/19334] ISHFT has the wrong type for constant values
- References: <20050108200509.19334.pinskia@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From tobi at gcc dot gnu dot org 2005-01-09 12:29 -------
Hm,
I've instrumented the tree-dumper to print the widths and signednesses of
integer constants, i.e.
Index: tree-pretty-print.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-pretty-print.c,v
retrieving revision 2.52
diff -u -p -r2.52 tree-pretty-print.c
--- tree-pretty-print.c 9 Dec 2004 10:54:36 -0000 2.52
+++ tree-pretty-print.c 9 Jan 2005 12:20:44 -0000
@@ -532,6 +532,18 @@ dump_generic_node (pretty_printer *buffe
}
else
pp_wide_integer (buffer, TREE_INT_CST_LOW (node));
+
+ if (tree_int_cst_sgn (TYPE_MIN_VALUE (TREE_TYPE (node))) < 0)
+ {
+ /* signed type. */
+ pp_string (buffer, "_S");
+ }
+ else
+ {
+ /* unsigned type. */
+ pp_string (buffer, "_U");
+ }
+ pp_wide_integer (buffer, TYPE_PRECISION (TREE_TYPE (node)));
break;
case REAL_CST:
now for gfortran both with and without my patch I get:
[tobi@marktplatz tests]$ cat pr19334.f90.t02.original
MAIN__ ()
{
int1 k;
{
int1 C.454 = 0_S8;
c_i1 (&C.454);
}
}
c_i1 (i)
{
(void) 0_U32;
which looks correct. The same goes for the optimized dump:
[tobi@marktplatz tests]$ cat pr19334.f90.t63.optimized
;; Function MAIN__ (MAIN__)
Analyzing Edge Insertions.
MAIN__ ()
{
int1 C.454 = 0_S8;
int1 k;
<bb 0>:
c_i1 (&C.454);
return;
}
;; Function c_i1 (c_i1__)
Analyzing Edge Insertions.
c_i1 (i)
{
<bb 0>:
return;
}
Maybe this is an optimizer issue? Or is there something else I should be looking
for?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19334