]> gcc.gnu.org Git - gcc.git/commitdiff
re PR debug/52048 (-fcompare-debug failure with -O2 -fcompare-debug -fnon-call-except...
authorJakub Jelinek <jakub@redhat.com>
Mon, 30 Jan 2012 13:47:38 +0000 (14:47 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 30 Jan 2012 13:47:38 +0000 (14:47 +0100)
PR debug/52048
* tree-ssa-tail-merge.c (local_def): Ignore debug uses.

* g++.dg/other/pr52048.C: New test.

From-SVN: r183723

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/other/pr52048.C [new file with mode: 0644]
gcc/tree-ssa-tail-merge.c

index e62c447b7b6034e6103f0af7ad4cbed78408e756..2bec9cb82ae59aa0fe1604b9b0a2f75c2336bd9c 100644 (file)
@@ -1,3 +1,8 @@
+2012-01-30  Jakub Jelinek  <jakub@redhat.com>
+
+       PR debug/52048
+       * tree-ssa-tail-merge.c (local_def): Ignore debug uses.
+
 2012-01-30  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/52045
index 65a9a7a0f54b79c7261418c2a78fcec94b39ac4b..e543e9a630a0135927f969cc64a58b359dd41657 100644 (file)
@@ -1,3 +1,8 @@
+2012-01-30  Jakub Jelinek  <jakub@redhat.com>
+
+       PR debug/52048
+       * g++.dg/other/pr52048.C: New test.
+
 2012-01-30  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/52045
diff --git a/gcc/testsuite/g++.dg/other/pr52048.C b/gcc/testsuite/g++.dg/other/pr52048.C
new file mode 100644 (file)
index 0000000..6bf51f1
--- /dev/null
@@ -0,0 +1,79 @@
+// PR debug/52048
+// { dg-do compile }
+// { dg-options "-fcompare-debug -fnon-call-exceptions -fno-tree-dominator-opts -O2" }
+
+template <typename T> struct A;
+template <typename T>
+struct A <T *>
+{
+  typedef T &a;
+};
+template <typename T>
+struct B
+{
+  typedef typename A <T>::a a;
+  a operator *() {}
+};
+template <typename T, typename U>
+bool operator != (B <T>, B <U>)
+{
+}
+template <typename T>
+struct C
+{
+  typedef T *c;
+  template <typename>
+  struct D { typedef C d; };
+};
+template <typename T, typename U> struct E
+{
+  typedef typename U::template D <T>::d e;
+};
+template <typename T, typename U = C <T> >
+struct F
+{
+  typedef E <T, U> b;
+  typedef typename b::e e;
+  typedef typename e::c c;
+  typedef B <c> i;
+  i begin ();
+  i end ();
+};
+class G;
+class H;
+struct I
+{
+  void *i;
+  template <typename T> T foo ();
+};
+struct J : public I
+{
+  virtual bool bar ();
+};
+class K {};
+struct L
+{
+  bool baz () {}
+};
+struct M
+{
+  K m1 (K);
+  K m2 (H *) {}
+};
+struct N : J
+{
+  bool bar (G &);
+};
+bool
+N::bar (G &)
+{
+  M m = foo <M> ();
+  F <H *> f;
+  for (F <H *>::i I = f.begin (), E = f.end (); I != E;)
+    {
+      H *h = *I;
+      L l;
+      if (l.baz ())
+       m.m1 (m.m2 (h));
+    }
+}
index 47dc0a6ffc8d3b34ffe427ddb0cf6a5e3c12e3d8..1f46b10a64e103691c0cd94db78e2d35014fb316 100644 (file)
@@ -371,6 +371,8 @@ local_def (tree val)
   res = true;
   FOR_EACH_IMM_USE_STMT (stmt, iter, val)
     {
+      if (is_gimple_debug (stmt))
+       continue;
       bb = gimple_bb (stmt);
       if (bb == def_bb)
        continue;
This page took 0.094087 seconds and 5 git commands to generate.