https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93385
--- Comment #32 from Jakub Jelinek ---
For debug stmts when DCE isn't involved, we already seem to do the right thing,
consider -O2 -g:
__attribute__((noinline)) static void
foo (int a)
{
int b = 2 * a;
int c = 3 * a;
a = a + 4;
asm
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93385
Richard Biener changed:
What|Removed |Added
Priority|P1 |P2
--- Comment #31 from Richard Biener
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93385
--- Comment #30 from Martin Jambor ---
Created attachment 48320
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48320=edit
Todays WIP patch
This is my todays (still very much) WIP patch.
- It marks statements which should not be copied
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93385
--- Comment #29 from Jakub Jelinek ---
(In reply to rguent...@suse.de from comment #28)
> On Fri, 17 Apr 2020, jakub at gcc dot gnu.org wrote:
>
> > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93385
> >
> > --- Comment #26 from Jakub Jelinek
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93385
--- Comment #28 from rguenther at suse dot de ---
On Fri, 17 Apr 2020, jakub at gcc dot gnu.org wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93385
>
> --- Comment #26 from Jakub Jelinek ---
> For debug stmts, it would be best if we
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93385
--- Comment #27 from Jakub Jelinek ---
Now, perhaps the analysis code could also detect which lhs are directly or
indirectly needed by debug stmts and when doing this return NULL in
remap_gimple_stmt, we could do something like (much simplified)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93385
--- Comment #26 from Jakub Jelinek ---
For debug stmts, it would be best if we could use those
DEBUG D#Y s=> parm
DEBUG var => D#Y
added in if (param_body_adjs && MAY_HAVE_DEBUG_BIND_STMTS).
Though, if we remove already
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93385
--- Comment #24 from rguenther at suse dot de ---
On April 17, 2020 3:53:07 PM GMT+02:00, "jakub at gcc dot gnu.org"
wrote:
>https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93385
>
>--- Comment #23 from Jakub Jelinek ---
>Instead of #c11 I meant:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93385
--- Comment #25 from Martin Jambor ---
(In reply to rguent...@suse.de from comment #21)
> Btw, I'd much prefer to not first copy the stmts and then remove them.
> Instead the DCE "analysis" can be done on the original IL and stmts
> be "marked"
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93385
--- Comment #23 from Jakub Jelinek ---
Instead of #c11 I meant:
- else if ((is_gimple_assign (stmt) && !gimple_has_volatile_ops (stmt))
-|| gimple_code (stmt) == GIMPLE_PHI)
+ else if (flag_tree_dce
+
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93385
--- Comment #22 from Martin Jambor ---
(In reply to Jakub Jelinek from comment #18)
> Comment on attachment 48302 [details]
> Untested fix
>
> + /* IPA-SRA does not analyze other types of statements. */
> + gcc_unreachable ();
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93385
--- Comment #21 from rguenther at suse dot de ---
On Fri, 17 Apr 2020, jakub at gcc dot gnu.org wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93385
>
> --- Comment #20 from Jakub Jelinek ---
> Looking at tree-ssa-dce.c, it uses
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93385
--- Comment #20 from Jakub Jelinek ---
Looking at tree-ssa-dce.c, it uses remove_phi_node rather than gsi_remove for
PHIs. And for non-PHIs, it calls release_defs after gsi_remove.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93385
--- Comment #19 from Richard Biener ---
(In reply to Martin Jambor from comment #17)
> Created attachment 48302 [details]
> Untested fix
>
> I'm playing with this - only very mildly tested - fix.
Ugh.
I was thinking of altering the parameter
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93385
--- Comment #18 from Jakub Jelinek ---
Comment on attachment 48302
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48302
Untested fix
+ /* IPA-SRA does not analyze other types of statements. */
+ gcc_unreachable ();
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93385
--- Comment #17 from Martin Jambor ---
Created attachment 48302
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48302=edit
Untested fix
I'm playing with this - only very mildly tested - fix.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93385
Richard Biener changed:
What|Removed |Added
CC||hubicka at gcc dot gnu.org,
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93385
--- Comment #15 from Jakub Jelinek ---
*** Bug 94178 has been marked as a duplicate of this bug. ***
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93385
--- Comment #14 from Martin Jambor ---
Another option, which does not create an inter-pass dependency and
does not clutter tree-inline any more, but which pessimizes IPA-SRA
(put perhaps just alittle bit?), is making sure that the statements
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93385
--- Comment #13 from Martin Jambor ---
The assumption is that DCE will eventually remove all gimple
assignments with LHS which has no uses if gimple_has_volatile_ops
returns false for them. I have had only a brief look at DCE today and
it seems
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93385
--- Comment #12 from Jakub Jelinek ---
Is that safe though?
I mean, does ipa-sra use exactly the same logic as dce does? Say statements
that could throw with non-call-exceptions and all that kinds of details.
Wouldn't it be safer e.g. to
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93385
--- Comment #11 from Martin Jambor ---
I'm going to test a patch that basically does the following (plus moving
push_cfun a bit):
diff --git a/gcc/ipa-sra.c b/gcc/ipa-sra.c
index 31de527d111..e18dc6958dc 100644
--- a/gcc/ipa-sra.c
+++
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93385
--- Comment #10 from Martin Jambor ---
Ah, -fno-tree-dce is specfied on the command line...
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93385
--- Comment #9 from Jakub Jelinek ---
The options include -fno-tree-dce.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93385
Martin Jambor changed:
What|Removed |Added
Status|NEW |ASSIGNED
Assignee|unassigned
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93385
--- Comment #7 from Jakub Jelinek ---
And with additiona -fno-early-inlining started with
r10-3311-gff6686d2e5f797d6c6a36ad14a7084bc1dc350e4
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93385
Jakub Jelinek changed:
What|Removed |Added
CC||jakub at gcc dot gnu.org
--- Comment #6
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93385
--- Comment #5 from Richard Biener ---
Hmm, no, IPA SRA thinks the parameter is unused (huh). Possibly -fno-ipa-cp
isn't implemented "fully".
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93385
Richard Biener changed:
What|Removed |Added
Priority|P3 |P1
CC|
29 matches
Mail list logo