From: Martin Liska Date: Thu, 7 Nov 2019 09:44:21 +0000 (+0100) Subject: Clear version_info_node in delete_function_version. X-Git-Tag: upstream/12.2.0~20595 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e9d01715bd7e033eacfbadbfab5f1f206221305c;p=platform%2Fupstream%2Fgcc.git Clear version_info_node in delete_function_version. 2019-11-07 Martin Liska PR c++/92354 * cgraph.c (delete_function_version): Clear global variable version_info_node if equal to deleted function. 2019-11-07 Martin Liska PR c++/92354 * g++.target/i386/pr92354.C: New test. From-SVN: r277913 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 94f72dd..c581816 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,12 @@ 2019-11-07 Martin Liska + PR c++/92354 + * cgraph.c (delete_function_version): Clear global + variable version_info_node if equal to deleted + function. + +2019-11-07 Martin Liska + * fold-const.c (operand_compare::operand_equal_p): Add comparison of CONSTRUCTOR_NO_CLEARING. (operand_compare::hash_operand): Likewise. diff --git a/gcc/cgraph.c b/gcc/cgraph.c index 6992096..896a3fc 100644 --- a/gcc/cgraph.c +++ b/gcc/cgraph.c @@ -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; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c6d9072..08f290b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-11-07 Martin Liska + + PR c++/92354 + * g++.target/i386/pr92354.C: New test. + 2019-11-07 Prathamesh Kulkarni * 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 index 0000000..0f48fb7 --- /dev/null +++ b/gcc/testsuite/g++.target/i386/pr92354.C @@ -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 ();