re PR rtl-optimization/28243 (internal consistency failure when building fontforge...
authorEric Botcazou <ebotcazou@libertysurf.fr>
Tue, 12 Sep 2006 21:48:40 +0000 (23:48 +0200)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Tue, 12 Sep 2006 21:48:40 +0000 (21:48 +0000)
PR rtl-optimization/28243
* combine.c (distribute_notes) <REG_DEAD>: Do not consider SETs past
the insn to which the note was originally attached.

From-SVN: r116906

gcc/ChangeLog
gcc/combine.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr28243.c [new file with mode: 0644]

index 35c029b188a6cee8ccce6f66f12aed99fea37e42..41aa22178fb27747d81b6103cf61cb60e229207d 100644 (file)
@@ -1,3 +1,9 @@
+2006-09-12  Eric Botcazou  <ebotcazou@libertysurf.fr>
+
+       PR rtl-optimization/28243
+       * combine.c (distribute_notes) <REG_DEAD>: Do not consider SETs past
+       the insn to which the note was originally attached.
+
 2006-09-12  Andrew Pinski  <pinskia@physics.uc.edu>
            Roger Sayle  <roger@eyesopen.com>
 
index 0f4ea02970f15c62893bfc49e6b0f5a04238f669..e85e9d1c4775c98cdc85098fa02be47a7b82ba74 100644 (file)
@@ -12165,12 +12165,14 @@ distribute_notes (rtx notes, rtx from_insn, rtx i3, rtx i2, rtx elim_i2,
                      continue;
                    }
 
-                 /* If the register is being set at TEM, see if that is all
-                    TEM is doing.  If so, delete TEM.  Otherwise, make this
-                    into a REG_UNUSED note instead. Don't delete sets to
-                    global register vars.  */
-                 if ((REGNO (XEXP (note, 0)) >= FIRST_PSEUDO_REGISTER
-                      || !global_regs[REGNO (XEXP (note, 0))])
+                 /* If TEM is a (reaching) definition of the use to which the
+                    note was attached, see if that is all TEM is doing.  If so,
+                    delete TEM.  Otherwise, make this into a REG_UNUSED note
+                    instead.  Don't delete sets to global register vars.  */
+                 if ((!from_insn
+                      || INSN_CUID (tem) < INSN_CUID (from_insn))
+                     && (REGNO (XEXP (note, 0)) >= FIRST_PSEUDO_REGISTER
+                         || !global_regs[REGNO (XEXP (note, 0))])
                      && reg_set_p (XEXP (note, 0), PATTERN (tem)))
                    {
                      rtx set = single_set (tem);
index 7764fb05ab2df43a4aa0ed52fb4f66d8c28f6d26..81f7c7fbc55b2b0ca22b251b20752fa9927d3253 100644 (file)
@@ -1,3 +1,7 @@
+2006-09-12  Eric Botcazou  <ebotcazou@libertysurf.fr>
+
+       * gcc.dg/pr28243.c: New test.
+
 2006-09-12  Paul Thomas  <pault@gcc.gnu.org>
 
        PR fortran/28971
diff --git a/gcc/testsuite/gcc.dg/pr28243.c b/gcc/testsuite/gcc.dg/pr28243.c
new file mode 100644 (file)
index 0000000..f74f86e
--- /dev/null
@@ -0,0 +1,51 @@
+/* PR rtl-optimization/28243 */
+/* Reported by Mike Frysinger <vapier@gentoo.org> */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftracer -fPIC" } */
+
+struct displayfuncs {
+  void (*init) ();
+} funcs;
+
+struct gpsdisplay {
+  struct displayfuncs *funcs;
+};
+
+static void PSMyArc(double cx, double cy, double radx, double rady, double sa,
+                   double ta)
+{
+  double ea;
+  double temp;
+  ea = sa + ta;
+  while (sa < ea) {
+    temp = ((sa + 90) / 90) * 90;
+    PSDoArc(cx, sa, ea < temp ? ea : temp);
+    sa = temp;
+  }
+}
+
+static void PSDrawElipse()
+{
+  float cx;
+  float cy;
+  float radx;
+  float rady;
+  if (radx != rady)
+    PSMyArc(cx, cy, radx, rady, 0, 360);
+}
+
+static void PSDrawFillCircle()
+{
+  PSDrawElipse();
+}
+
+static struct displayfuncs psfuncs[] = {
+  PSDrawFillCircle
+};
+
+void _GPSDraw_CreateDisplay()
+{
+  struct gpsdisplay *gdisp;
+  gdisp->funcs = (void *)&psfuncs;
+}