* [PATCH, PR70187] Safely use nodes[0] in possible_polymorphic_call_targets
@ 2016-03-16 8:14 Tom de Vries
2016-03-16 9:44 ` Richard Biener
2016-03-17 8:58 ` Jan Hubicka
0 siblings, 2 replies; 3+ messages in thread
From: Tom de Vries @ 2016-03-16 8:14 UTC (permalink / raw)
To: GCC Patches, Jan Hubicka
[-- Attachment #1: Type: text/plain, Size: 703 bytes --]
Hi,
this patch fixes lto PR70187, a 6 regression.
We run into an ICE in in possible_polymorphic_call_targets when
accessing nodes[0]->decl because nodes == vNULL:
...
if (!outer_type->all_derivations_known)
{
if (!speculative && final_warning_records
&& TREE_CODE (TREE_TYPE (nodes[0]->decl)) == METHOD_TYPE)
{
if (complete
&& nodes.length () == 1
&& warn_suggest_final_types
&& !outer_type->derived_types.length ())
{
...
The patch fixes this by moving the 'nodes.length () == 1' test to before
the use of nodes[0].
Bootstrapped and reg-tested on x86_64.
OK for stage4 trunk?
Thanks,
- Tom
[-- Attachment #2: 0003-Safely-use-nodes-0-in-possible_polymorphic_call_targets.patch --]
[-- Type: text/x-patch, Size: 1138 bytes --]
Safely use nodes[0] in possible_polymorphic_call_targets
2016-03-16 Tom de Vries <tom@codesourcery.com>
PR lto/70187
* ipa-devirt.c (possible_polymorphic_call_targets): Move
nodes.length () == 1 test to before first nodes[0] access.
---
gcc/ipa-devirt.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/gcc/ipa-devirt.c b/gcc/ipa-devirt.c
index e4fb562..4df171b 100644
--- a/gcc/ipa-devirt.c
+++ b/gcc/ipa-devirt.c
@@ -3178,10 +3178,10 @@ possible_polymorphic_call_targets (tree otr_type,
if (!outer_type->all_derivations_known)
{
if (!speculative && final_warning_records
+ && nodes.length () == 1
&& TREE_CODE (TREE_TYPE (nodes[0]->decl)) == METHOD_TYPE)
{
if (complete
- && nodes.length () == 1
&& warn_suggest_final_types
&& !outer_type->derived_types.length ())
{
@@ -3197,7 +3197,6 @@ possible_polymorphic_call_targets (tree otr_type,
}
if (complete
&& warn_suggest_final_methods
- && nodes.length () == 1
&& types_same_for_odr (DECL_CONTEXT (nodes[0]->decl),
outer_type->type))
{
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH, PR70187] Safely use nodes[0] in possible_polymorphic_call_targets
2016-03-16 8:14 [PATCH, PR70187] Safely use nodes[0] in possible_polymorphic_call_targets Tom de Vries
@ 2016-03-16 9:44 ` Richard Biener
2016-03-17 8:58 ` Jan Hubicka
1 sibling, 0 replies; 3+ messages in thread
From: Richard Biener @ 2016-03-16 9:44 UTC (permalink / raw)
To: Tom de Vries; +Cc: GCC Patches, Jan Hubicka
On Wed, Mar 16, 2016 at 9:13 AM, Tom de Vries <Tom_deVries@mentor.com> wrote:
> Hi,
>
> this patch fixes lto PR70187, a 6 regression.
>
> We run into an ICE in in possible_polymorphic_call_targets when accessing
> nodes[0]->decl because nodes == vNULL:
> ...
> if (!outer_type->all_derivations_known)
> {
> if (!speculative && final_warning_records
> && TREE_CODE (TREE_TYPE (nodes[0]->decl)) == METHOD_TYPE)
> {
> if (complete
> && nodes.length () == 1
> && warn_suggest_final_types
> && !outer_type->derived_types.length ())
> {
> ...
>
> The patch fixes this by moving the 'nodes.length () == 1' test to before the
> use of nodes[0].
>
> Bootstrapped and reg-tested on x86_64.
>
> OK for stage4 trunk?
Ok (even obvious I think).
Thanks,
Richard.
> Thanks,
> - Tom
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH, PR70187] Safely use nodes[0] in possible_polymorphic_call_targets
2016-03-16 8:14 [PATCH, PR70187] Safely use nodes[0] in possible_polymorphic_call_targets Tom de Vries
2016-03-16 9:44 ` Richard Biener
@ 2016-03-17 8:58 ` Jan Hubicka
1 sibling, 0 replies; 3+ messages in thread
From: Jan Hubicka @ 2016-03-17 8:58 UTC (permalink / raw)
To: Tom de Vries; +Cc: GCC Patches, Jan Hubicka
> Hi,
>
> this patch fixes lto PR70187, a 6 regression.
>
> We run into an ICE in in possible_polymorphic_call_targets when
> accessing nodes[0]->decl because nodes == vNULL:
> ...
> if (!outer_type->all_derivations_known)
> {
> if (!speculative && final_warning_records
> && TREE_CODE (TREE_TYPE (nodes[0]->decl)) == METHOD_TYPE)
> {
> if (complete
> && nodes.length () == 1
> && warn_suggest_final_types
> && !outer_type->derived_types.length ())
> {
> ...
>
> The patch fixes this by moving the 'nodes.length () == 1' test to
> before the use of nodes[0].
>
> Bootstrapped and reg-tested on x86_64.
>
> OK for stage4 trunk?
>
> Thanks,
> - Tom
> Safely use nodes[0] in possible_polymorphic_call_targets
>
> 2016-03-16 Tom de Vries <tom@codesourcery.com>
>
> PR lto/70187
> * ipa-devirt.c (possible_polymorphic_call_targets): Move
> nodes.length () == 1 test to before first nodes[0] access.
OK,
thanks
Honza
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-03-17 8:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-16 8:14 [PATCH, PR70187] Safely use nodes[0] in possible_polymorphic_call_targets Tom de Vries
2016-03-16 9:44 ` Richard Biener
2016-03-17 8:58 ` Jan Hubicka
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).