http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46794
Summary: ICE on valid code involving power of small integer
kinds
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: [email protected]
ReportedBy: [email protected]
The following reduced code ICEs:
PROGRAM main
IMPLICIT NONE
INTEGER(KIND=2) :: j
j = 1_2 + 1_2**j
END PROGRAM main
I get something like:
[/tmp]# gfortran-dev test.f03
test.f03: In function 'MAIN__':
test.f03:1:0: error: type mismatch in binary expression
integer(kind=2)
integer(kind=4)
integer(kind=2)
j = D.1476 + 1;
test.f03:1:0: internal compiler error: verify_gimple failed
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
The problem is that for "small" integer kinds (1 and 2) we still call the
library power routine for kind 4 but the result is not converted back to the
smaller integer kinds properly.
This seems to be a regression, with 4.3 and 4.5 the code compiles cleanly for
me.