Clear version_info_node in delete_function_version.
authorMartin Liska <mliska@suse.cz>
Thu, 7 Nov 2019 09:44:21 +0000 (10:44 +0100)
committerMartin Liska <marxin@gcc.gnu.org>
Thu, 7 Nov 2019 09:44:21 +0000 (09:44 +0000)
2019-11-07  Martin Liska  <mliska@suse.cz>

PR c++/92354
* cgraph.c (delete_function_version): Clear global
variable version_info_node if equal to deleted
function.
2019-11-07  Martin Liska  <mliska@suse.cz>

PR c++/92354
* g++.target/i386/pr92354.C: New test.

From-SVN: r277913

gcc/ChangeLog
gcc/cgraph.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.target/i386/pr92354.C [new file with mode: 0644]

index 94f72ddade6496c880476d036fef055f2dd299d3..c5818165a4cda21630f675b603bce6a4a5144dd8 100644 (file)
@@ -1,3 +1,10 @@
+2019-11-07  Martin Liska  <mliska@suse.cz>
+
+       PR c++/92354
+       * cgraph.c (delete_function_version): Clear global
+       variable version_info_node if equal to deleted
+       function.
+
 2019-11-07  Martin Liska  <mliska@suse.cz>
 
        * fold-const.c (operand_compare::operand_equal_p): Add comparison
index 699209654f812a9ac0cef04b28cfe0bcbcbf60c4..896a3fcf2751cd4e545b40abb9e99b4371fe0763 100644 (file)
@@ -197,6 +197,9 @@ delete_function_version (cgraph_function_version_info *decl_v)
   if (decl_v == NULL)
     return;
 
+  if (version_info_node == decl_v)
+    version_info_node = NULL;
+
   if (decl_v->prev != NULL)
     decl_v->prev->next = decl_v->next;
 
index c6d907275f52f9c692cc849f5e959edf10b3ff66..08f290baa2b31ed7f9d3645805b709fee6096856 100644 (file)
@@ -1,3 +1,8 @@
+2019-11-07  Martin Liska  <mliska@suse.cz>
+
+       PR c++/92354
+       * g++.target/i386/pr92354.C: New test.
+
 2019-11-07  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>
 
        * gcc.dg/tree-ssa/pr92163.c: Add dg-require-effective-target fopenacc.
diff --git a/gcc/testsuite/g++.target/i386/pr92354.C b/gcc/testsuite/g++.target/i386/pr92354.C
new file mode 100644 (file)
index 0000000..0f48fb7
--- /dev/null
@@ -0,0 +1,8 @@
+/* PR c++/92354 */
+/* { dg-do compile } */
+/* { dg-require-ifunc "" }  */
+/* { dg-options "--param ggc-min-heapsize=0" } */
+
+__attribute__ ((target ("default"))) void f ();
+__attribute__ ((target ("sse"))) void f ();
+__attribute__ ((target ("default"))) void f ();