* [Bug tree-optimization/49772] [4.7 Regression] ICE: in ipa_pta_execute, at tree-ssa-structalias.c:6790 with -fipa-pta
2011-07-17 21:04 [Bug tree-optimization/49772] New: [4.7 Regression] ICE: in ipa_pta_execute, at tree-ssa-structalias.c:6790 with -fipa-pta zsojka at seznam dot cz
@ 2011-07-17 21:06 ` zsojka at seznam dot cz
2011-07-18 8:28 ` rguenth at gcc dot gnu.org
` (12 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: zsojka at seznam dot cz @ 2011-07-17 21:06 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49772
Zdenek Sojka <zsojka at seznam dot cz> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #24784|0 |1
is obsolete| |
--- Comment #1 from Zdenek Sojka <zsojka at seznam dot cz> 2011-07-17 21:06:08 UTC ---
Created attachment 24785
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24785
reduced testcase (from g++.dg/tree-ssa/pr42337.C)
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug tree-optimization/49772] [4.7 Regression] ICE: in ipa_pta_execute, at tree-ssa-structalias.c:6790 with -fipa-pta
2011-07-17 21:04 [Bug tree-optimization/49772] New: [4.7 Regression] ICE: in ipa_pta_execute, at tree-ssa-structalias.c:6790 with -fipa-pta zsojka at seznam dot cz
2011-07-17 21:06 ` [Bug tree-optimization/49772] " zsojka at seznam dot cz
@ 2011-07-18 8:28 ` rguenth at gcc dot gnu.org
2011-08-03 19:57 ` hubicka at gcc dot gnu.org
` (11 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-07-18 8:28 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49772
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2011.07.18 08:27:57
CC| |hubicka at gcc dot gnu.org
Target Milestone|--- |4.7.0
Ever Confirmed|0 |1
--- Comment #2 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-07-18 08:27:57 UTC ---
Honza, now that we error instead of sorry (which immediately aborts
compilation),
should we fixup the cgraph to point to non-inline variants?
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug tree-optimization/49772] [4.7 Regression] ICE: in ipa_pta_execute, at tree-ssa-structalias.c:6790 with -fipa-pta
2011-07-17 21:04 [Bug tree-optimization/49772] New: [4.7 Regression] ICE: in ipa_pta_execute, at tree-ssa-structalias.c:6790 with -fipa-pta zsojka at seznam dot cz
2011-07-17 21:06 ` [Bug tree-optimization/49772] " zsojka at seznam dot cz
2011-07-18 8:28 ` rguenth at gcc dot gnu.org
@ 2011-08-03 19:57 ` hubicka at gcc dot gnu.org
2011-08-04 9:21 ` rguenther at suse dot de
` (10 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: hubicka at gcc dot gnu.org @ 2011-08-03 19:57 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49772
--- Comment #3 from Jan Hubicka <hubicka at gcc dot gnu.org> 2011-08-03 19:57:06 UTC ---
Hmm, we should never make the cgrpah point to inline variant in this case, so
rest of compilation should go smoothly after the error is output. I don't think
it is what is confusing ipa-pta, especially now when it is run after inlining?
Honza
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug tree-optimization/49772] [4.7 Regression] ICE: in ipa_pta_execute, at tree-ssa-structalias.c:6790 with -fipa-pta
2011-07-17 21:04 [Bug tree-optimization/49772] New: [4.7 Regression] ICE: in ipa_pta_execute, at tree-ssa-structalias.c:6790 with -fipa-pta zsojka at seznam dot cz
` (2 preceding siblings ...)
2011-08-03 19:57 ` hubicka at gcc dot gnu.org
@ 2011-08-04 9:21 ` rguenther at suse dot de
2011-08-04 18:33 ` hubicka at ucw dot cz
` (9 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: rguenther at suse dot de @ 2011-08-04 9:21 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49772
--- Comment #4 from rguenther at suse dot de <rguenther at suse dot de> 2011-08-04 09:20:21 UTC ---
On Wed, 3 Aug 2011, hubicka at gcc dot gnu.org wrote:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49772
>
> --- Comment #3 from Jan Hubicka <hubicka at gcc dot gnu.org> 2011-08-03 19:57:06 UTC ---
> Hmm, we should never make the cgrpah point to inline variant in this case, so
> rest of compilation should go smoothly after the error is output. I don't think
> it is what is confusing ipa-pta, especially now when it is run after inlining?
What happens is that in expand_call_inline we fail the inlining via
an error, but at this point of course the edge points to the inline
clone and that stays so.
I suppose when expand_call_inline fails we have to re-direct the
edge to the original function (huh, eventually make sure it is not
optimized away as well).
Or, finally, _never_ fail that late
Richard.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug tree-optimization/49772] [4.7 Regression] ICE: in ipa_pta_execute, at tree-ssa-structalias.c:6790 with -fipa-pta
2011-07-17 21:04 [Bug tree-optimization/49772] New: [4.7 Regression] ICE: in ipa_pta_execute, at tree-ssa-structalias.c:6790 with -fipa-pta zsojka at seznam dot cz
` (3 preceding siblings ...)
2011-08-04 9:21 ` rguenther at suse dot de
@ 2011-08-04 18:33 ` hubicka at ucw dot cz
2011-10-27 9:45 ` rguenth at gcc dot gnu.org
` (8 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: hubicka at ucw dot cz @ 2011-08-04 18:33 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49772
--- Comment #5 from Jan Hubicka <hubicka at ucw dot cz> 2011-08-04 18:32:27 UTC ---
> What happens is that in expand_call_inline we fail the inlining via
> an error, but at this point of course the edge points to the inline
> clone and that stays so.
>
> I suppose when expand_call_inline fails we have to re-direct the
> edge to the original function (huh, eventually make sure it is not
> optimized away as well).
Well, the problem is that the original function don't have to exist at this
point,
just an inline clone with posisbly constants propagated into it and thus some
edges removed. Undoing this is nontrivial/impossible.
>
> Or, finally, _never_ fail that late
Yep, we need to avoid failing late.
Honza
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug tree-optimization/49772] [4.7 Regression] ICE: in ipa_pta_execute, at tree-ssa-structalias.c:6790 with -fipa-pta
2011-07-17 21:04 [Bug tree-optimization/49772] New: [4.7 Regression] ICE: in ipa_pta_execute, at tree-ssa-structalias.c:6790 with -fipa-pta zsojka at seznam dot cz
` (4 preceding siblings ...)
2011-08-04 18:33 ` hubicka at ucw dot cz
@ 2011-10-27 9:45 ` rguenth at gcc dot gnu.org
2011-12-06 10:38 ` rguenth at gcc dot gnu.org
` (7 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-10-27 9:45 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49772
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P1
Status|NEW |ASSIGNED
AssignedTo|unassigned at gcc dot |rguenth at gcc dot gnu.org
|gnu.org |
--- Comment #6 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-10-27 09:44:40 UTC ---
Hmmmm, I'll take this one.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug tree-optimization/49772] [4.7 Regression] ICE: in ipa_pta_execute, at tree-ssa-structalias.c:6790 with -fipa-pta
2011-07-17 21:04 [Bug tree-optimization/49772] New: [4.7 Regression] ICE: in ipa_pta_execute, at tree-ssa-structalias.c:6790 with -fipa-pta zsojka at seznam dot cz
` (5 preceding siblings ...)
2011-10-27 9:45 ` rguenth at gcc dot gnu.org
@ 2011-12-06 10:38 ` rguenth at gcc dot gnu.org
2011-12-07 5:36 ` zsojka at seznam dot cz
` (6 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-12-06 10:38 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49772
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
--- Comment #7 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-12-06 10:37:53 UTC ---
We no longer ICE.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug tree-optimization/49772] [4.7 Regression] ICE: in ipa_pta_execute, at tree-ssa-structalias.c:6790 with -fipa-pta
2011-07-17 21:04 [Bug tree-optimization/49772] New: [4.7 Regression] ICE: in ipa_pta_execute, at tree-ssa-structalias.c:6790 with -fipa-pta zsojka at seznam dot cz
` (6 preceding siblings ...)
2011-12-06 10:38 ` rguenth at gcc dot gnu.org
@ 2011-12-07 5:36 ` zsojka at seznam dot cz
2011-12-07 5:37 ` zsojka at seznam dot cz
` (5 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: zsojka at seznam dot cz @ 2011-12-07 5:36 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49772
Zdenek Sojka <zsojka at seznam dot cz> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |REOPENED
Resolution|FIXED |
--- Comment #8 from Zdenek Sojka <zsojka at seznam dot cz> 2011-12-07 05:35:48 UTC ---
The original testcase still fails:
$ gcc -O -fipa-pta g++.dg/tree-ssa/pr42337.C
g++.dg/tree-ssa/pr42337.C: In member function 'VALUE SFVT<KEY, VALUE>::IS(const
SFVT<KEY, VALUE>&) const [with KEY = long long unsigned int; VALUE = double;
SFVT<KEY, VALUE> = SFVT<long long unsigned int, double>]':
g++.dg/tree-ssa/pr42337.C:117:40: error: inlining failed in call to
always_inline 'VALUE SFVT<KEY, VALUE>::IS(const SFVT<KEY, VALUE>&) const [with
KEY = long long unsigned int; VALUE = double; SFVT<KEY, VALUE> = SFVT<long long
unsigned int, double>]': recursive inlining
g++.dg/tree-ssa/pr42337.C:119:26: error: called from here
g++.dg/tree-ssa/pr42337.C: At global scope:
g++.dg/tree-ssa/pr42337.C:173:1: internal compiler error: in ipa_pta_execute,
at tree-ssa-structalias.c:6863
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug tree-optimization/49772] [4.7 Regression] ICE: in ipa_pta_execute, at tree-ssa-structalias.c:6790 with -fipa-pta
2011-07-17 21:04 [Bug tree-optimization/49772] New: [4.7 Regression] ICE: in ipa_pta_execute, at tree-ssa-structalias.c:6790 with -fipa-pta zsojka at seznam dot cz
` (7 preceding siblings ...)
2011-12-07 5:36 ` zsojka at seznam dot cz
@ 2011-12-07 5:37 ` zsojka at seznam dot cz
2011-12-08 4:55 ` pinskia at gcc dot gnu.org
` (4 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: zsojka at seznam dot cz @ 2011-12-07 5:37 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49772
--- Comment #9 from Zdenek Sojka <zsojka at seznam dot cz> 2011-12-07 05:37:04 UTC ---
Created attachment 26014
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26014
autoreduced testcase
$ gcc -O -fipa-pta testcase-min14.ii
testcase-min14.ii: In member function 'VALUE SFVT< <template-parameter-1-1>,
VALUE>::IS(SFVT< <template-parameter-1-1>, VALUE>) [with
<template-parameter-1-1> = unsigned int; VALUE = double; SFVT<
<template-parameter-1-1>, VALUE> = SFVT<unsigned int, double>]':
testcase-min14.ii:17:41: error: inlining failed in call to always_inline 'VALUE
SFVT< <template-parameter-1-1>, VALUE>::IS(SFVT< <template-parameter-1-1>,
VALUE>) [with <template-parameter-1-1> = unsigned int; VALUE = double; SFVT<
<template-parameter-1-1>, VALUE> = SFVT<unsigned int, double>]': recursive
inlining
testcase-min14.ii:21:2: error: called from here
testcase-min14.ii: At global scope:
testcase-min14.ii:41:1: internal compiler error: in ipa_pta_execute, at
tree-ssa-structalias.c:6863
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug tree-optimization/49772] [4.7 Regression] ICE: in ipa_pta_execute, at tree-ssa-structalias.c:6790 with -fipa-pta
2011-07-17 21:04 [Bug tree-optimization/49772] New: [4.7 Regression] ICE: in ipa_pta_execute, at tree-ssa-structalias.c:6790 with -fipa-pta zsojka at seznam dot cz
` (8 preceding siblings ...)
2011-12-07 5:37 ` zsojka at seznam dot cz
@ 2011-12-08 4:55 ` pinskia at gcc dot gnu.org
2011-12-08 9:05 ` rguenther at suse dot de
` (3 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu.org @ 2011-12-08 4:55 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49772
--- Comment #10 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-12-08 04:54:41 UTC ---
A better non specific to tree-ssa-structaliasing patch:
Index: cgraphunit.c
===================================================================
--- cgraphunit.c (revision 182098)
+++ cgraphunit.c (working copy)
@@ -1817,6 +1817,9 @@ cgraph_expand_function (struct cgraph_no
/* Generate RTL for the body of DECL. */
tree_rest_of_compilation (decl);
+ if (seen_error ())
+ return;
+
/* Make sure that BE didn't give up on compiling. */
gcc_assert (TREE_ASM_WRITTEN (decl));
current_function_decl = NULL;
Index: passes.c
===================================================================
--- passes.c (revision 182098)
+++ passes.c (working copy)
@@ -2074,7 +2074,7 @@ execute_one_pass (struct opt_pass *pass)
timevar_push (pass->tv_id);
/* Do it! */
- if (pass->execute)
+ if (pass->execute && !seen_error ())
{
todo_after = pass->execute ();
do_per_function (clear_last_verified, NULL);
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug tree-optimization/49772] [4.7 Regression] ICE: in ipa_pta_execute, at tree-ssa-structalias.c:6790 with -fipa-pta
2011-07-17 21:04 [Bug tree-optimization/49772] New: [4.7 Regression] ICE: in ipa_pta_execute, at tree-ssa-structalias.c:6790 with -fipa-pta zsojka at seznam dot cz
` (9 preceding siblings ...)
2011-12-08 4:55 ` pinskia at gcc dot gnu.org
@ 2011-12-08 9:05 ` rguenther at suse dot de
2011-12-08 11:45 ` rguenth at gcc dot gnu.org
` (2 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: rguenther at suse dot de @ 2011-12-08 9:05 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49772
--- Comment #11 from rguenther at suse dot de <rguenther at suse dot de> 2011-12-08 08:57:22 UTC ---
On Thu, 8 Dec 2011, pinskia at gcc dot gnu.org wrote:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49772
>
> --- Comment #10 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-12-08 04:54:41 UTC ---
> A better non specific to tree-ssa-structaliasing patch:
> Index: cgraphunit.c
> ===================================================================
> --- cgraphunit.c (revision 182098)
> +++ cgraphunit.c (working copy)
> @@ -1817,6 +1817,9 @@ cgraph_expand_function (struct cgraph_no
> /* Generate RTL for the body of DECL. */
> tree_rest_of_compilation (decl);
>
> + if (seen_error ())
> + return;
> +
> /* Make sure that BE didn't give up on compiling. */
> gcc_assert (TREE_ASM_WRITTEN (decl));
> current_function_decl = NULL;
> Index: passes.c
> ===================================================================
> --- passes.c (revision 182098)
> +++ passes.c (working copy)
> @@ -2074,7 +2074,7 @@ execute_one_pass (struct opt_pass *pass)
> timevar_push (pass->tv_id);
>
> /* Do it! */
> - if (pass->execute)
> + if (pass->execute && !seen_error ())
> {
> todo_after = pass->execute ();
> do_per_function (clear_last_verified, NULL);
We don't want late warnings in random functions to be suppressed
by earlier errors.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug tree-optimization/49772] [4.7 Regression] ICE: in ipa_pta_execute, at tree-ssa-structalias.c:6790 with -fipa-pta
2011-07-17 21:04 [Bug tree-optimization/49772] New: [4.7 Regression] ICE: in ipa_pta_execute, at tree-ssa-structalias.c:6790 with -fipa-pta zsojka at seznam dot cz
` (10 preceding siblings ...)
2011-12-08 9:05 ` rguenther at suse dot de
@ 2011-12-08 11:45 ` rguenth at gcc dot gnu.org
2011-12-08 13:26 ` rguenth at gcc dot gnu.org
2011-12-08 13:34 ` rguenth at gcc dot gnu.org
13 siblings, 0 replies; 15+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-12-08 11:45 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49772
--- Comment #12 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-12-08 11:39:21 UTC ---
It's a complete mystery to me how this cgraph node cloning and edge code
works. We create the inline clone for a completely different edge
(that _is_ decided to be inlined) than the one we later fail on
(that one is _not_ marked inline and does _not_ have an inline clone callee).
Thus, we shouldn't arrive at this situation at all. Instead we seem to fail
to inline a call that we should inline (and decided to inline) because of:
/* Expand calls to inline functions in the body of FN. */
unsigned int
optimize_inline_calls (tree fn)
{
...
/* There is no point in performing inlining if errors have already
occurred -- and we might crash if we try to inline invalid
code. */
if (seen_error ())
return 0;
which leaves us with such state.
So this is yet another case of overeager fail to complete our task.
I suppose we can remove that late fail now that we bail out way earlier
at proper IPA "scope".
The ICE is fixed with removing the above out.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug tree-optimization/49772] [4.7 Regression] ICE: in ipa_pta_execute, at tree-ssa-structalias.c:6790 with -fipa-pta
2011-07-17 21:04 [Bug tree-optimization/49772] New: [4.7 Regression] ICE: in ipa_pta_execute, at tree-ssa-structalias.c:6790 with -fipa-pta zsojka at seznam dot cz
` (11 preceding siblings ...)
2011-12-08 11:45 ` rguenth at gcc dot gnu.org
@ 2011-12-08 13:26 ` rguenth at gcc dot gnu.org
2011-12-08 13:34 ` rguenth at gcc dot gnu.org
13 siblings, 0 replies; 15+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-12-08 13:26 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49772
--- Comment #13 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-12-08 13:23:59 UTC ---
Author: rguenth
Date: Thu Dec 8 13:23:54 2011
New Revision: 182110
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=182110
Log:
2011-12-08 Richard Guenther <rguenther@suse.de>
PR tree-optimization/49772
* tree-inline.c (optimize_inline_calls): Remove bail out
on errors.
Modified:
trunk/gcc/ChangeLog
trunk/gcc/tree-inline.c
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug tree-optimization/49772] [4.7 Regression] ICE: in ipa_pta_execute, at tree-ssa-structalias.c:6790 with -fipa-pta
2011-07-17 21:04 [Bug tree-optimization/49772] New: [4.7 Regression] ICE: in ipa_pta_execute, at tree-ssa-structalias.c:6790 with -fipa-pta zsojka at seznam dot cz
` (12 preceding siblings ...)
2011-12-08 13:26 ` rguenth at gcc dot gnu.org
@ 2011-12-08 13:34 ` rguenth at gcc dot gnu.org
13 siblings, 0 replies; 15+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-12-08 13:34 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49772
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|REOPENED |RESOLVED
Resolution| |FIXED
--- Comment #14 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-12-08 13:25:50 UTC ---
Fixed.
^ permalink raw reply [flat|nested] 15+ messages in thread