This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/33381] [4.2 regression] miscompilation casting signed long to void*

------- Comment #5 from rguenth at gcc dot gnu dot org  2007-09-21 13:36 -------
This was fixed by the introduction of pointer-plus, which removed all traces
of fold_used_pointer* in tree-scalar-evolution.c.

A safe patch would go along the following:

Index: tree-vrp.c
--- tree-vrp.c  (revision 128649)
+++ tree-vrp.c  (working copy)
@@ -2482,6 +2482,13 @@ adjust_range_with_scev (value_range_t *v
   if (vr->type == VR_ANTI_RANGE)

+  /* Don't try to feed SCEV with casts to pointer type.  */
+  if (TREE_CODE (stmt) == MODIFY_EXPR
+      && (TREE_CODE (TREE_OPERAND (stmt, 1)) == NOP_EXPR
+         || TREE_CODE (TREE_OPERAND (stmt, 1)) == CONVERT_EXPR)
+      && POINTER_TYPE_P (TREE_TYPE (TREE_OPERAND (stmt, 1))))
+    return;
   chrec = instantiate_parameters (loop, analyze_scalar_evolution (loop, var));


rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
         AssignedTo|unassigned at gcc dot gnu   |rguenth at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2007-09-11 11:31:46         |2007-09-21 13:36:53
               date|                            |

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]