aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2014-05-24 19:11:35 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2014-05-24 17:11:35 +0000
commite0e349f3f25d1b2d8c492fc384506bf250cb1d6a (patch)
tree8f4aa2dacf35de6152be220e014de1e5c193750a /gcc
parent06e3da3474d25621bdd86c6ebb05bc0e6611f72c (diff)
downloadgcc-e0e349f3f25d1b2d8c492fc384506bf250cb1d6a.zip
gcc-e0e349f3f25d1b2d8c492fc384506bf250cb1d6a.tar.gz
gcc-e0e349f3f25d1b2d8c492fc384506bf250cb1d6a.tar.bz2
* sched-int.h (sd_iterator_cond): Manually tail recurse.
From-SVN: r210895
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/sched-int.h45
2 files changed, 28 insertions, 21 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 845c8c6..f419574 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,7 @@
+2014-05-23 Jan Hubicka <hubicka@ucw.cz>
+
+ * sched-int.h (sd_iterator_cond): Manually tail recurse.
+
2014-05-23 Segher Boessenkool <segher@kernel.crashing.org>
* config/rs6000/440.md (ppc440-integer): Include shift without
diff --git a/gcc/sched-int.h b/gcc/sched-int.h
index ffe618c..fe00496 100644
--- a/gcc/sched-int.h
+++ b/gcc/sched-int.h
@@ -1550,34 +1550,37 @@ sd_iterator_start (rtx insn, sd_list_types_def types)
static inline bool
sd_iterator_cond (sd_iterator_def *it_ptr, dep_t *dep_ptr)
{
- dep_link_t link = *it_ptr->linkp;
-
- if (link != NULL)
- {
- *dep_ptr = DEP_LINK_DEP (link);
- return true;
- }
- else
+ while (true)
{
- sd_list_types_def types = it_ptr->types;
+ dep_link_t link = *it_ptr->linkp;
- if (types != SD_LIST_NONE)
- /* Switch to next list. */
+ if (link != NULL)
+ {
+ *dep_ptr = DEP_LINK_DEP (link);
+ return true;
+ }
+ else
{
- deps_list_t list;
+ sd_list_types_def types = it_ptr->types;
- sd_next_list (it_ptr->insn,
- &it_ptr->types, &list, &it_ptr->resolved_p);
+ if (types != SD_LIST_NONE)
+ /* Switch to next list. */
+ {
+ deps_list_t list;
- it_ptr->linkp = &DEPS_LIST_FIRST (list);
+ sd_next_list (it_ptr->insn,
+ &it_ptr->types, &list, &it_ptr->resolved_p);
- if (list)
- return sd_iterator_cond (it_ptr, dep_ptr);
- }
+ it_ptr->linkp = &DEPS_LIST_FIRST (list);
+
+ if (list)
+ continue;
+ }
- *dep_ptr = NULL;
- return false;
- }
+ *dep_ptr = NULL;
+ return false;
+ }
+ }
}
/* Advance iterator. */