* [Bug fortran/19334] ISHFT has the wrong type for constant values
2005-01-08 20:05 [Bug fortran/19334] New: ISHFT has the wrong type for constant values pinskia at gcc dot gnu dot org
@ 2005-01-08 20:07 ` pinskia at gcc dot gnu dot org
2005-01-08 20:33 ` pinskia at gcc dot gnu dot org
` (16 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-08 20:07 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-01-08 20:06 -------
This is just a reduction of the "gfortran.dg/g77/f90-intrinsic-bit.f" test.
reference testresults (not from me):
http://gcc.gnu.org/ml/gcc-testresults/2005-01/msg00348.html
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2005-01-08 20:06:57
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19334
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug fortran/19334] ISHFT has the wrong type for constant values
2005-01-08 20:05 [Bug fortran/19334] New: ISHFT has the wrong type for constant values pinskia at gcc dot gnu dot org
2005-01-08 20:07 ` [Bug fortran/19334] " pinskia at gcc dot gnu dot org
@ 2005-01-08 20:33 ` pinskia at gcc dot gnu dot org
2005-01-08 20:33 ` pinskia at gcc dot gnu dot org
` (15 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-08 20:33 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-01-08 20:33 -------
Oh, one more thing from PR 19335, -fmerge-constants is what causes it to fail.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19334
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug fortran/19334] ISHFT has the wrong type for constant values
2005-01-08 20:05 [Bug fortran/19334] New: ISHFT has the wrong type for constant values pinskia at gcc dot gnu dot org
2005-01-08 20:07 ` [Bug fortran/19334] " pinskia at gcc dot gnu dot org
2005-01-08 20:33 ` pinskia at gcc dot gnu dot org
@ 2005-01-08 20:33 ` pinskia at gcc dot gnu dot org
2005-01-08 20:47 ` tobi at gcc dot gnu dot org
` (14 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-08 20:33 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-01-08 20:32 -------
*** Bug 19335 has been marked as a duplicate of this bug. ***
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |coudert at clipper dot ens
| |dot fr
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19334
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug fortran/19334] ISHFT has the wrong type for constant values
2005-01-08 20:05 [Bug fortran/19334] New: ISHFT has the wrong type for constant values pinskia at gcc dot gnu dot org
` (2 preceding siblings ...)
2005-01-08 20:33 ` pinskia at gcc dot gnu dot org
@ 2005-01-08 20:47 ` tobi at gcc dot gnu dot org
2005-01-09 2:16 ` pinskia at gcc dot gnu dot org
` (13 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: tobi at gcc dot gnu dot org @ 2005-01-08 20:47 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From tobi at gcc dot gnu dot org 2005-01-08 20:47 -------
Created an attachment (id=7906)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=7906&action=view)
Putative patch
2005-01-08 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de>
PR fortran/19334
* trans-intrinsic.c (gfc_conv_intrinsic_ishft): Correct type-safety
problem.
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |tobi at gcc dot gnu dot org
|dot org |
Status|NEW |ASSIGNED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19334
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug fortran/19334] ISHFT has the wrong type for constant values
2005-01-08 20:05 [Bug fortran/19334] New: ISHFT has the wrong type for constant values pinskia at gcc dot gnu dot org
` (3 preceding siblings ...)
2005-01-08 20:47 ` tobi at gcc dot gnu dot org
@ 2005-01-09 2:16 ` pinskia at gcc dot gnu dot org
2005-01-09 11:57 ` tobi at gcc dot gnu dot org
` (12 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-09 2:16 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-01-09 02:16 -------
nope, this patch did not fix it.
--
What |Removed |Added
----------------------------------------------------------------------------
Keywords|patch |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19334
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug fortran/19334] ISHFT has the wrong type for constant values
2005-01-08 20:05 [Bug fortran/19334] New: ISHFT has the wrong type for constant values pinskia at gcc dot gnu dot org
` (4 preceding siblings ...)
2005-01-09 2:16 ` pinskia at gcc dot gnu dot org
@ 2005-01-09 11:57 ` tobi at gcc dot gnu dot org
2005-01-09 12:29 ` tobi at gcc dot gnu dot org
` (11 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: tobi at gcc dot gnu dot org @ 2005-01-09 11:57 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From tobi at gcc dot gnu dot org 2005-01-09 11:56 -------
Is the reduced testcase also not fixed by the patch, or is this a new issue?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19334
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug fortran/19334] ISHFT has the wrong type for constant values
2005-01-08 20:05 [Bug fortran/19334] New: ISHFT has the wrong type for constant values pinskia at gcc dot gnu dot org
` (5 preceding siblings ...)
2005-01-09 11:57 ` tobi at gcc dot gnu dot org
@ 2005-01-09 12:29 ` tobi at gcc dot gnu dot org
2005-01-09 12:30 ` tobi at gcc dot gnu dot org
` (10 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: tobi at gcc dot gnu dot org @ 2005-01-09 12:29 UTC (permalink / raw)
To: gcc-bugs
------- 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
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug fortran/19334] ISHFT has the wrong type for constant values
2005-01-08 20:05 [Bug fortran/19334] New: ISHFT has the wrong type for constant values pinskia at gcc dot gnu dot org
` (6 preceding siblings ...)
2005-01-09 12:29 ` tobi at gcc dot gnu dot org
@ 2005-01-09 12:30 ` tobi at gcc dot gnu dot org
2005-01-09 15:29 ` pinskia at gcc dot gnu dot org
` (9 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: tobi at gcc dot gnu dot org @ 2005-01-09 12:30 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From tobi at gcc dot gnu dot org 2005-01-09 12:30 -------
also, I'm on i686, which could be making a difference even though it shouldn't
at this stage.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19334
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug fortran/19334] ISHFT has the wrong type for constant values
2005-01-08 20:05 [Bug fortran/19334] New: ISHFT has the wrong type for constant values pinskia at gcc dot gnu dot org
` (7 preceding siblings ...)
2005-01-09 12:30 ` tobi at gcc dot gnu dot org
@ 2005-01-09 15:29 ` pinskia at gcc dot gnu dot org
2005-01-09 15:36 ` Tobias dot Schlueter at physik dot uni-muenchen dot de
` (8 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-09 15:29 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-01-09 15:29 -------
int1 C.454 = 0_S8;
The 8 is where the problem is, it is just plainly wrong, it should be 1.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19334
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug fortran/19334] ISHFT has the wrong type for constant values
2005-01-08 20:05 [Bug fortran/19334] New: ISHFT has the wrong type for constant values pinskia at gcc dot gnu dot org
` (8 preceding siblings ...)
2005-01-09 15:29 ` pinskia at gcc dot gnu dot org
@ 2005-01-09 15:36 ` Tobias dot Schlueter at physik dot uni-muenchen dot de
2005-01-09 15:47 ` [Bug target/19334] " pinskia at gcc dot gnu dot org
` (7 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Tobias dot Schlueter at physik dot uni-muenchen dot de @ 2005-01-09 15:36 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From Tobias dot Schlueter at physik dot uni-muenchen dot de 2005-01-09 15:36 -------
Subject: Re: ISHFT has the wrong type for constant values
pinskia at gcc dot gnu dot org wrote:
> ------- Additional Comments From pinskia at gcc dot gnu dot org 2005-01-09 15:29 -------
> int1 C.454 = 0_S8;
>
> The 8 is where the problem is, it is just plainly wrong, it should be 1.
>
8 bits, unless I'm completely mistaken.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19334
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug target/19334] ISHFT has the wrong type for constant values
2005-01-08 20:05 [Bug fortran/19334] New: ISHFT has the wrong type for constant values pinskia at gcc dot gnu dot org
` (9 preceding siblings ...)
2005-01-09 15:36 ` Tobias dot Schlueter at physik dot uni-muenchen dot de
@ 2005-01-09 15:47 ` pinskia at gcc dot gnu dot org
2005-01-09 16:51 ` coudert at clipper dot ens dot fr
` (6 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-09 15:47 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-01-09 15:47 -------
Then this must be a target bug, I will look into it.
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|tobi at gcc dot gnu dot org |pinskia at gcc dot gnu dot
| |org
Component|fortran |target
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19334
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug target/19334] ISHFT has the wrong type for constant values
2005-01-08 20:05 [Bug fortran/19334] New: ISHFT has the wrong type for constant values pinskia at gcc dot gnu dot org
` (10 preceding siblings ...)
2005-01-09 15:47 ` [Bug target/19334] " pinskia at gcc dot gnu dot org
@ 2005-01-09 16:51 ` coudert at clipper dot ens dot fr
2005-01-09 19:21 ` [Bug target/19334] darwin backend places some CONST_DECLs in the wrong section pinskia at gcc dot gnu dot org
` (5 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: coudert at clipper dot ens dot fr @ 2005-01-09 16:51 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From coudert at clipper dot ens dot fr 2005-01-09 16:50 -------
Reduced case (from FP19335) still fails on powerpc-darwin with Tobias' patch.
The output from gfortran -fdump-tree-gimple (I hope this was the right thing to
do) is the same with and without -fmerge-constants, though the second fails at
link time. Here is the tree, with Tobias' modification to the pretty printer:
MAIN__ ()
{
int1 k;
k = 0_S8;
_gfortran_filename = "reduced.f";
_gfortran_line = 3_S32;
_gfortran_ioparm.unit = 6_S32;
_gfortran_ioparm.list_format = 1_S32;
_gfortran_st_write ();
{
int1 C.417 = 0_S8;
_gfortran_transfer_integer (&C.417, 1_S32);
}
_gfortran_st_write_done ();
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19334
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug target/19334] darwin backend places some CONST_DECLs in the wrong section
2005-01-08 20:05 [Bug fortran/19334] New: ISHFT has the wrong type for constant values pinskia at gcc dot gnu dot org
` (11 preceding siblings ...)
2005-01-09 16:51 ` coudert at clipper dot ens dot fr
@ 2005-01-09 19:21 ` pinskia at gcc dot gnu dot org
2005-01-09 19:28 ` tobi at gcc dot gnu dot org
` (4 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-09 19:21 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-01-09 19:21 -------
Here is a reduced testcase now without ISHFT:
call c_i1(0_1)
end
--
What |Removed |Added
----------------------------------------------------------------------------
Summary|ISHFT has the wrong type for|darwin backend places some
|constant values |CONST_DECLs in the wrong
| |section
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19334
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug target/19334] darwin backend places some CONST_DECLs in the wrong section
2005-01-08 20:05 [Bug fortran/19334] New: ISHFT has the wrong type for constant values pinskia at gcc dot gnu dot org
` (12 preceding siblings ...)
2005-01-09 19:21 ` [Bug target/19334] darwin backend places some CONST_DECLs in the wrong section pinskia at gcc dot gnu dot org
@ 2005-01-09 19:28 ` tobi at gcc dot gnu dot org
2005-01-09 19:31 ` pinskia at gcc dot gnu dot org
` (3 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: tobi at gcc dot gnu dot org @ 2005-01-09 19:28 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From tobi at gcc dot gnu dot org 2005-01-09 19:28 -------
(In reply to comment #12)
> The output from gfortran -fdump-tree-gimple (I hope this was the right thing to
> do)
-fdump-tree-original gives you the output of the frontend, so if the frontend
produces crap, it will be in this dump. In your case it didn't make a
difference, but usually the gimple dump is much harder to read because the
originial generic gets converted to ssa form (single static assignment). IIUC,
of course.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19334
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug target/19334] darwin backend places some CONST_DECLs in the wrong section
2005-01-08 20:05 [Bug fortran/19334] New: ISHFT has the wrong type for constant values pinskia at gcc dot gnu dot org
` (13 preceding siblings ...)
2005-01-09 19:28 ` tobi at gcc dot gnu dot org
@ 2005-01-09 19:31 ` pinskia at gcc dot gnu dot org
2005-01-09 20:07 ` pinskia at gcc dot gnu dot org
` (2 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-09 19:31 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-01-09 19:31 -------
(In reply to comment #14)
> (In reply to comment #12)
> > The output from gfortran -fdump-tree-gimple (I hope this was the right thing to
> > do)
>
> -fdump-tree-original gives you the output of the frontend, so if the frontend
> produces crap, it will be in this dump. In your case it didn't make a
> difference, but usually the gimple dump is much harder to read because the
> originial generic gets converted to ssa form (single static assignment). IIUC,
> of course.
Actually -fdump-tree-gimple dumps gimple form which is a lowered form of generic (not all the way
down but slightly more, in that gimple have a simplified grammar per statement and generic).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19334
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug target/19334] darwin backend places some CONST_DECLs in the wrong section
2005-01-08 20:05 [Bug fortran/19334] New: ISHFT has the wrong type for constant values pinskia at gcc dot gnu dot org
` (14 preceding siblings ...)
2005-01-09 19:31 ` pinskia at gcc dot gnu dot org
@ 2005-01-09 20:07 ` pinskia at gcc dot gnu dot org
2005-01-13 0:47 ` pinskia at gcc dot gnu dot org
2005-01-13 0:48 ` cvs-commit at gcc dot gnu dot org
17 siblings, 0 replies; 19+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-09 20:07 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-01-09 20:07 -------
Patch here: <http://gcc.gnu.org/ml/gcc-patches/2005-01/msg00491.html>.
--
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |patch
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19334
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug target/19334] darwin backend places some CONST_DECLs in the wrong section
2005-01-08 20:05 [Bug fortran/19334] New: ISHFT has the wrong type for constant values pinskia at gcc dot gnu dot org
` (15 preceding siblings ...)
2005-01-09 20:07 ` pinskia at gcc dot gnu dot org
@ 2005-01-13 0:47 ` pinskia at gcc dot gnu dot org
2005-01-13 0:48 ` cvs-commit at gcc dot gnu dot org
17 siblings, 0 replies; 19+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-13 0:47 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-01-13 00:47 -------
Fixed.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
Target Milestone|--- |4.0.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19334
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug target/19334] darwin backend places some CONST_DECLs in the wrong section
2005-01-08 20:05 [Bug fortran/19334] New: ISHFT has the wrong type for constant values pinskia at gcc dot gnu dot org
` (16 preceding siblings ...)
2005-01-13 0:47 ` pinskia at gcc dot gnu dot org
@ 2005-01-13 0:48 ` cvs-commit at gcc dot gnu dot org
17 siblings, 0 replies; 19+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-01-13 0:48 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2005-01-13 00:47 -------
Subject: Bug 19334
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: pinskia@gcc.gnu.org 2005-01-13 00:47:45
Modified files:
gcc : ChangeLog
gcc/config : darwin.c
Log message:
2005-01-12 Andrew Pinski <pinskia@physics.uc.edu>
PR target/19334
* config/darwin.c (machopic_select_section): Use TYPE_SIZE_UNIT instead
of TYPE_SIZE where we mean the number of bytes.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.7104&r2=2.7105
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/darwin.c.diff?cvsroot=gcc&r1=1.104&r2=1.105
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19334
^ permalink raw reply [flat|nested] 19+ messages in thread