public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/34028] Type mismatch with optimization of ISHFT
2007-11-08 13:20 [Bug fortran/34028] New: Type mismatch with optimization of ISHFT fxcoudert at gcc dot gnu dot org
@ 2007-11-08 13:20 ` fxcoudert at gcc dot gnu dot org
2007-11-08 15:33 ` fxcoudert at gcc dot gnu dot org
2007-11-08 15:35 ` fxcoudert at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-11-08 13:20 UTC (permalink / raw)
To: gcc-bugs
--
fxcoudert at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |fxcoudert at gcc dot gnu dot
|dot org |org
Status|UNCONFIRMED |ASSIGNED
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2007-11-08 13:20:40
date| |
Target Milestone|--- |4.3.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34028
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug fortran/34028] New: Type mismatch with optimization of ISHFT
@ 2007-11-08 13:20 fxcoudert at gcc dot gnu dot org
2007-11-08 13:20 ` [Bug fortran/34028] " fxcoudert at gcc dot gnu dot org
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-11-08 13:20 UTC (permalink / raw)
To: gcc-bugs
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2307 bytes --]
Happens on x86-linux, with both -m32 and -m64. Spotted by running the testsuite
with -fdefault-integer-8.
$ cat intrinsic_bitops.f90
implicit none
integer(kind=4) :: k, o
o = 0
k = 12
if (ishft (k, o+2_8) .ne. 48_8) call abort
end
$ gfortran -O2 intrinsic_bitops.f90
intrinsic_bitops.f90: In function MAIN__:
intrinsic_bitops.f90:1: error: type mismatch in comparison expression
logical4
int8
int4
if (D.864 <= 31)
{
if (o >= -2)
{
D.862 = (int8) o;
D.863 = D.862 + 2;
D.864 = ABS_EXPR <D.863>;
D.866 = k << D.864;
iftmp.2 = D.866 != 48;
}
else
{
k.3 = (<unnamed-unsigned:32>) k;
D.862 = (int8) o;
D.863 = D.862 + 2;
D.864 = ABS_EXPR <D.863>;
D.868 = k.3 >> D.864;
iftmp.2 = D.868 != 48;
}
iftmp.1 = iftmp.2;
}
else
{
iftmp.1 = 1;
}
intrinsic_bitops.f90:1: internal compiler error: verify_gimple failed
The tree dump is:
ABS_EXPR <(int8) o + 2> <= 31 ? o >= -2 ? k << ABS_EXPR <(int8) o + 2> != 48 :
(<unnamed-unsigned:32>) k >> ABS_EXPR <(int8) o + 2> != 48 : 1
The problem arises from the fact that 31 above is int4, while ABS_EXPR <(int8)
o + 2> is int8. The following patch fixes it:
Index: trans-intrinsic.c
===================================================================
--- trans-intrinsic.c (revision 129869)
+++ trans-intrinsic.c (working copy)
@@ -2533,7 +2533,7 @@ gfc_conv_intrinsic_ishft (gfc_se * se, g
/* The Fortran standard allows shift widths <= BIT_SIZE(I), whereas
gcc requires a shift width < BIT_SIZE(I), so we have to catch this
special case. */
- num_bits = build_int_cst (TREE_TYPE (args[0]), TYPE_PRECISION (type));
+ num_bits = build_int_cst (TREE_TYPE (args[1]), TYPE_PRECISION (type));
cond = fold_build2 (GE_EXPR, boolean_type_node, width, num_bits);
--
Summary: Type mismatch with optimization of ISHFT
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Keywords: ice-on-valid-code, patch
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: fxcoudert at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34028
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug fortran/34028] Type mismatch with optimization of ISHFT
2007-11-08 13:20 [Bug fortran/34028] New: Type mismatch with optimization of ISHFT fxcoudert at gcc dot gnu dot org
2007-11-08 13:20 ` [Bug fortran/34028] " fxcoudert at gcc dot gnu dot org
@ 2007-11-08 15:33 ` fxcoudert at gcc dot gnu dot org
2007-11-08 15:35 ` fxcoudert at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-11-08 15:33 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from fxcoudert at gcc dot gnu dot org 2007-11-08 15:33 -------
Subject: Bug 34028
Author: fxcoudert
Date: Thu Nov 8 15:33:23 2007
New Revision: 130003
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=130003
Log:
PR fortran/34028
* trans-intrinsic.c (gfc_conv_intrinsic_ishft): Use correct type.
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/trans-intrinsic.c
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34028
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug fortran/34028] Type mismatch with optimization of ISHFT
2007-11-08 13:20 [Bug fortran/34028] New: Type mismatch with optimization of ISHFT fxcoudert at gcc dot gnu dot org
2007-11-08 13:20 ` [Bug fortran/34028] " fxcoudert at gcc dot gnu dot org
2007-11-08 15:33 ` fxcoudert at gcc dot gnu dot org
@ 2007-11-08 15:35 ` fxcoudert at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-11-08 15:35 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from fxcoudert at gcc dot gnu dot org 2007-11-08 15:35 -------
Fixed.
--
fxcoudert at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34028
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-11-08 15:35 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-08 13:20 [Bug fortran/34028] New: Type mismatch with optimization of ISHFT fxcoudert at gcc dot gnu dot org
2007-11-08 13:20 ` [Bug fortran/34028] " fxcoudert at gcc dot gnu dot org
2007-11-08 15:33 ` fxcoudert at gcc dot gnu dot org
2007-11-08 15:35 ` fxcoudert at gcc dot gnu dot 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).