aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2017-04-19 18:32:02 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2017-04-19 18:32:02 +0200
commitf19e6a9c0b51bb432f9754d489f369ab9c9ac052 (patch)
treef4d4845cd009ac8566bc78439f6aebb91075984a
parent541035a63b8adc3900ca0d335382c2808228f191 (diff)
downloadgcc-f19e6a9c0b51bb432f9754d489f369ab9c9ac052.zip
gcc-f19e6a9c0b51bb432f9754d489f369ab9c9ac052.tar.gz
gcc-f19e6a9c0b51bb432f9754d489f369ab9c9ac052.tar.bz2
re PR debug/80461 (ICE in modified_type_die, at dwarf2out.c:12566)
PR debug/80461 * dwarf2out.c (modified_type_die, gen_type_die_with_usage): Check for t with zero TYPE_QUALS_NO_ADDR_SPACE. * g++.dg/debug/pr80461.C: New test. From-SVN: r247002
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/dwarf2out.c18
-rw-r--r--gcc/testsuite/ChangeLog3
-rw-r--r--gcc/testsuite/g++.dg/debug/pr80461.C42
4 files changed, 59 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 32af94d..6b17e9a 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,9 @@
2017-04-19 Jakub Jelinek <jakub@redhat.com>
+ PR debug/80461
+ * dwarf2out.c (modified_type_die, gen_type_die_with_usage):
+ Check for t with zero TYPE_QUALS_NO_ADDR_SPACE.
+
PR debug/80436
* tree-ssa-loop-manip.c (find_uses_to_rename_def): Ignore debug uses.
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 27fb9f0..98c5157 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -12690,7 +12690,9 @@ modified_type_die (tree type, int cv_quals, bool reverse,
but try to canonicalize. */
tree main = TYPE_MAIN_VARIANT (type);
for (tree t = main; t; t = TYPE_NEXT_VARIANT (t))
- if (check_base_type (t, main) && check_lang_type (t, type))
+ if (TYPE_QUALS_NO_ADDR_SPACE (t) == 0
+ && check_base_type (t, main)
+ && check_lang_type (t, type))
return lookup_type_die (t);
return lookup_type_die (type);
}
@@ -24580,13 +24582,13 @@ gen_type_die_with_usage (tree type, dw_die_ref context_die,
but try to canonicalize. */
tree main = TYPE_MAIN_VARIANT (type);
for (tree t = main; t; t = TYPE_NEXT_VARIANT (t))
- {
- if (check_base_type (t, main) && check_lang_type (t, type))
- {
- type = t;
- break;
- }
- }
+ if (TYPE_QUALS_NO_ADDR_SPACE (t) == 0
+ && check_base_type (t, main)
+ && check_lang_type (t, type))
+ {
+ type = t;
+ break;
+ }
}
else if (TREE_CODE (type) != VECTOR_TYPE
&& TREE_CODE (type) != ARRAY_TYPE)
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 4c68324..048541d 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,8 @@
2017-04-19 Jakub Jelinek <jakub@redhat.com>
+ PR debug/80461
+ * g++.dg/debug/pr80461.C: New test.
+
PR c++/80459
* c-c++-common/opaque-vector.c (SIZEOF_MAXINT): Define.
(f): Don't test long double vectors if __SIZEOF_LONG_DOUBLE__
diff --git a/gcc/testsuite/g++.dg/debug/pr80461.C b/gcc/testsuite/g++.dg/debug/pr80461.C
new file mode 100644
index 0000000..df7b422
--- /dev/null
+++ b/gcc/testsuite/g++.dg/debug/pr80461.C
@@ -0,0 +1,42 @@
+// PR debug/80461
+// { dg-do compile }
+// { dg-options "-g -O" }
+
+template <typename> class A;
+struct B
+{
+ template <typename T, typename U>
+ static bool foo (U T::*) {}
+};
+template <typename, typename> class J;
+template <typename T, typename U, typename V, typename... W>
+class J<V (W...), U T::*> : public J<void(), U T::*> {};
+template <typename T, typename U, typename... W>
+class J<void(W...), U T::*> : public B {};
+template <typename V, typename... W> struct A<V (W...)>
+{
+ template <typename, typename> using K = int;
+ template <typename L, typename = K<int, void>, typename = K<int, void>> A (L);
+};
+template <typename V, typename... W>
+template <typename L, typename, typename>
+A<V (W...)>::A (L x) { J<V (), L>::foo (x); }
+struct N;
+volatile int v;
+
+template <class O, class P>
+void
+bar ()
+{
+ O q;
+ A<P> f = q;
+ v++;
+}
+
+void
+baz ()
+{
+ bar<int (N::*) (...) &, int()> ();
+ bar<int (N::*) (...) const &, int()> ();
+ bar<int (N::*) (...) volatile &, int()> ();
+}