public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-5154] Fix recursion discovery in ipa-pure-const
@ 2021-11-11 13:39 Jan Hubicka
  0 siblings, 0 replies; only message in thread
From: Jan Hubicka @ 2021-11-11 13:39 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:6e30c48120500ef2e8643a7574636ed02567dbb6

commit r12-5154-g6e30c48120500ef2e8643a7574636ed02567dbb6
Author: Jan Hubicka <jh@suse.cz>
Date:   Thu Nov 11 14:39:19 2021 +0100

    Fix recursion discovery in ipa-pure-const
    
    We make self recursive functions as looping of fear of endless recursion.
    This is done correctly for local pure/const and for non-trivial SCCs in
    callgraph, but for trivial SCCs we miss the flag.
    
    I think it is bad decision since infinite recursion will run out of stack,
    but changing it upsets some testcases and should be done independently.
    So this patch is fixing current behaviour to be consistent.
    
    gcc/ChangeLog:
    
    2021-11-11  Jan Hubicka  <hubicka@ucw.cz>
    
            * ipa-pure-const.c (propagate_pure_const): Self recursion is
            a side effects.

Diff:
---
 gcc/ipa-pure-const.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gcc/ipa-pure-const.c b/gcc/ipa-pure-const.c
index 84a028bcf8e..422b52fba4b 100644
--- a/gcc/ipa-pure-const.c
+++ b/gcc/ipa-pure-const.c
@@ -1513,6 +1513,9 @@ propagate_pure_const (void)
 	      enum pure_const_state_e edge_state = IPA_CONST;
 	      bool edge_looping = false;
 
+	      if (e->recursive_p ())
+		looping = true;
+
 	      if (dump_file && (dump_flags & TDF_DETAILS))
 		{
 		  fprintf (dump_file, "    Call to %s",


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-11-11 13:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-11 13:39 [gcc r12-5154] Fix recursion discovery in ipa-pure-const 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).