diff mbox series

[COMMITTED] Fix return value in ranger_cache::get_global_range

Message ID 36ae8571-a1fa-8062-ab43-7141c7d2e934@redhat.com
State New
Headers show
Series [COMMITTED] Fix return value in ranger_cache::get_global_range | expand

Commit Message

Andrew MacLeod May 13, 2022, 2:42 p.m. UTC
This fixes a buglet in get_global_range where it was not returning the 
correct value. It was returning whether the value was current, not 
whether it originally had a global value set as it was suppose to.  The 
current_p flag is returned as a parameter already.

Bootstrapped on x86_64-pc-linux-gnu with no regressions.  Pushed.

Andrew
diff mbox series

Patch

commit 98e475a8f58ca3ba6e9bd5c9276efce4236f5d26
Author: Andrew MacLeod <amacleod@redhat.com>
Date:   Fri Mar 18 11:50:33 2022 -0400

    Fix return value in ranger_cache::get_global_range.
    
    The "is_current" status is returned by parameter, but was being returned by the
    function as well instead of true if NAME had a global range, and FALSE
    if it did not.
    
            * gimple-range-cache.cc (ranger_cache::get_global_range): Return the
            had_global value instead.

diff --git a/gcc/gimple-range-cache.cc b/gcc/gimple-range-cache.cc
index bdb30460345..d3cf8be9bd8 100644
--- a/gcc/gimple-range-cache.cc
+++ b/gcc/gimple-range-cache.cc
@@ -951,7 +951,7 @@  ranger_cache::get_global_range (irange &r, tree name, bool &current_p)
   // If the existing value was not current, mark it as always current.
   if (!current_p)
     m_temporal->set_always_current (name);
-  return current_p;
+  return had_global;
 }
 
 //  Set the global range of NAME to R and give it a timestamp.