+2008-05-28 Rafael Espindola <espindola@google.com>
+
+ * see.c (see_def_extension_not_merged): Use copy_rtx_if_shared to avoid
+ invalid sharing.
+
2008-05-28 Richard Guenther <rguenther@suse.de>
PR tree-optimization/36339
/* The manipulation succeeded. Store the new manipulated reference. */
+ /* It is possible for dest_reg to appear multiple times in ref_copy. In this
+ case, ref_copy now has invalid sharing. Copying solves the problem.
+ We don't use copy_rtx as an optimization for the common case (no sharing).
+ We can't just use copy_rtx_if_shared since it does nothing on INSNs.
+ Another possible solution would be to make validate_replace_rtx_1
+ public and use it instead of replace_rtx. */
+ reset_used_flags (PATTERN (ref_copy));
+ reset_used_flags (REG_NOTES (ref_copy));
+ PATTERN (ref_copy) = copy_rtx_if_shared (PATTERN (ref_copy));
+ REG_NOTES (ref_copy) = copy_rtx_if_shared (REG_NOTES (ref_copy));
+
/* Try to simplify the new manipulated insn. */
validate_simplify_insn (ref_copy);
+2008-05-28 Rafael Espindola <espindola@google.com>
+
+ * gcc.dg/20080528-1.c: New test.
+
2008-05-28 Arnaud Charlet <charlet@adacore.com>
* gnat.dg/old_errors.adb, gnat.dg/deep_old.adb: Adjust.
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2 -fsee" } */
+
+unsigned long g(int a, int b) {
+ return a / b;
+}
+unsigned long f(long int a) {
+ return g(a, 1<<13);
+}