[Bug fortran/32046] [4.3 Regression] wrong code with -O2 for gfortran.dg/interface_12.f90 & result_in_spec_1.f90
fxcoudert at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Tue May 22 19:33:00 GMT 2007
------- Comment #6 from fxcoudert at gcc dot gnu dot org 2007-05-22 20:33 -------
(In reply to comment #5)
> D.1477 = (SAVE_EXPR <(<unnamed-unsigned:64>) (MAX_EXPR <D.1475, 0> + -1) +
> 1>) * 4;
Yup, the following patch fixes it. I think there might be other occurences of
such a problem (basically, every time we use TYPE_SIZE_UNIT to create an array
size or offset).
Index: trans-array.c
===================================================================
--- trans-array.c (revision 124858)
+++ trans-array.c (working copy)
@@ -687,7 +687,8 @@ gfc_trans_create_temp_array (stmtblock_t
nelem = size;
size = fold_build2 (MULT_EXPR, gfc_array_index_type, size,
- TYPE_SIZE_UNIT (gfc_get_element_type (type)));
+ fold_convert (gfc_array_index_type,
+ TYPE_SIZE_UNIT (gfc_get_element_type
(type))));
}
else
{
--
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|NEW |ASSIGNED
Last reconfirmed|2007-05-22 19:49:26 |2007-05-22 20:33:00
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32046
More information about the Gcc-bugs
mailing list