On Linux/Intel64, gcc 4.4 revision 132592 miscompiles 172.mgrid in SPEC CPU 2K
with -O2 -ffast-math. This part of change:

Index: gcc/fortran/trans-array.c
===================================================================
--- gcc/fortran/trans-array.c   (revision 132591)
+++ gcc/fortran/trans-array.c   (revision 132592)
@@ -3937,10 +3949,10 @@ gfc_trans_array_bounds (tree type, gfc_s

          /* Make sure that negative size arrays are translated
             to being zero size.  */
-         tmp = build2 (GE_EXPR, boolean_type_node,
-                       stride, gfc_index_zero_node);
-         tmp = build3 (COND_EXPR, gfc_array_index_type, tmp,
-                       stride, gfc_index_zero_node);
+         tmp = fold_build2 (GE_EXPR, boolean_type_node,
+                            stride, gfc_index_zero_node);
+         tmp = fold_build3 (COND_EXPR, gfc_array_index_type, tmp,
+                            stride, gfc_index_zero_node);
          gfc_add_modify_expr (pblock, stride, tmp);
         }

miscompiles RESID, which has nested loops on 3-d arrays. Does it ring a bell?


-- 
           Summary: [4.4 Regression]: Revision 132592 miscompiles 172.mgrid
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: hjl dot tools at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35418

Reply via email to