aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorTom de Vries <tom@codesourcery.com>2015-06-09 05:52:52 +0000
committerTom de Vries <vries@gcc.gnu.org>2015-06-09 05:52:52 +0000
commite92e61a7c2d2e8f8a0878bf42c121f35e465511e (patch)
treefc4f8a853f6fb8a1a2ce011a1fff2c528735f352 /gcc
parent7b337d2061bedcf494e7c8d42323d3959caef74e (diff)
downloadgcc-e92e61a7c2d2e8f8a0878bf42c121f35e465511e.zip
gcc-e92e61a7c2d2e8f8a0878bf42c121f35e465511e.tar.gz
gcc-e92e61a7c2d2e8f8a0878bf42c121f35e465511e.tar.bz2
Fix gimple_seq_nondebug_singleton_p
2015-06-09 Tom de Vries <tom@codesourcery.com> * gimple-iterator.h (gimple_seq_nondebug_singleton_p): Don't always return false. From-SVN: r224263
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/gimple-iterator.h22
2 files changed, 13 insertions, 14 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 6f51bc9..7537f41 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2015-06-09 Tom de Vries <tom@codesourcery.com>
+
+ * gimple-iterator.h (gimple_seq_nondebug_singleton_p): Don't
+ always return false.
+
2015-06-09 Alexandre Oliva <aoliva@redhat.com>
PR rtl-optimization/64164
diff --git a/gcc/gimple-iterator.h b/gcc/gimple-iterator.h
index d08245e..76fa456 100644
--- a/gcc/gimple-iterator.h
+++ b/gcc/gimple-iterator.h
@@ -351,33 +351,27 @@ static inline bool
gimple_seq_nondebug_singleton_p (gimple_seq seq)
{
gimple_stmt_iterator gsi;
+
+ /* Find a nondebug gimple. */
gsi.ptr = gimple_seq_first (seq);
gsi.seq = &seq;
gsi.bb = NULL;
-
- /* Not a singleton if the sequence is empty. */
- if (gsi_end_p (gsi))
- return false;
-
- /* Find a nondebug gimple. */
while (!gsi_end_p (gsi)
&& is_gimple_debug (gsi_stmt (gsi)))
gsi_next (&gsi);
- /* Not a nondebug singleton if there's no nondebug gimple. */
- if (is_gimple_debug (gsi_stmt (gsi)))
+ /* No nondebug gimple found, not a singleton. */
+ if (gsi_end_p (gsi))
return false;
- /* Find the next nondebug gimple. */
+ /* Find a next nondebug gimple. */
+ gsi_next (&gsi);
while (!gsi_end_p (gsi)
&& is_gimple_debug (gsi_stmt (gsi)))
gsi_next (&gsi);
- /* If there's a next nondebug gimple, it's not a nondebug singleton. */
- if (!gsi_end_p (gsi))
- return false;
-
- return true;
+ /* Only a singleton if there's no next nondebug gimple. */
+ return gsi_end_p (gsi);
}
#endif /* GCC_GIMPLE_ITERATOR_H */