This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/32046] [4.3 Regression] wrong code with -O2 for gfortran.dg/interface_12.f90 & result_in_spec_1.f90
- From: "fxcoudert at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 May 2007 19:33:01 -0000
- Subject: [Bug fortran/32046] [4.3 Regression] wrong code with -O2 for gfortran.dg/interface_12.f90 & result_in_spec_1.f90
- References: <bug-32046-13404@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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