Blame SOURCES/rhbz1591267.patch

022c9c
commit 97a9ceb2a294ee3218987daf84a5ab3d9d361e27
022c9c
Author: Martin Cermak <mcermak@redhat.com>
022c9c
Date:   Thu Jun 14 14:35:26 2018 +0200
022c9c
022c9c
    Improve the foreach_limit(2).exp test results.
022c9c
    
022c9c
    Without this update, one can observe following issue with rhel7
022c9c
    powerpc kernels:
022c9c
    
022c9c
    =======
022c9c
     # stap -p4 testsuite/systemtap.maps/foreach_limit.stp
022c9c
     ...
022c9c
     /usr/local/share/systemtap/runtime/map.c:275:26: error: ‘a’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
022c9c
        struct mlist_head *c, *a, *last, *tmp;
022c9c
                               ^
022c9c
     /usr/local/share/systemtap/runtime/map.c:275:26: error: ‘a’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
022c9c
     cc1: all warnings being treated as errors
022c9c
    =======
022c9c
    
022c9c
    This problem turns out to start happening after the powerpc kernel
022c9c
    build system started using -O3 instead of -O2 as one can see in
022c9c
    http://vault.centos.org/7.5.1804/os/Source/SPackages/kernel-3.10.0-862.el7.src.rpm
022c9c
    
022c9c
    =======
022c9c
     # powerpc is compiled with -O3, via specfile rpmbuild -- see rhbz1051067.
022c9c
     # we need to keep consistency here, however, for out of tree kmod builds --
022c9c
     # see rhbz1431029 for reference
022c9c
     ifeq ($(SRCARCH), powerpc)
022c9c
     KBUILD_CFLAGS   += -O3
022c9c
     else
022c9c
     KBUILD_CFLAGS   += -O2
022c9c
     endif
022c9c
    =======
022c9c
    
022c9c
    Reverting this change (using -O2 instead of -O3) works the problem around
022c9c
    as well as this systemtap-side update.  For more details, see rhbz1591267.
022c9c
022c9c
diff --git a/runtime/map.c b/runtime/map.c
022c9c
index 5caf739..ef91456 100644
022c9c
--- a/runtime/map.c
022c9c
+++ b/runtime/map.c
022c9c
@@ -272,7 +272,7 @@ static void _stp_map_sortn(MAP map, int n, int keynum, int dir,
022c9c
 		_stp_map_sort(map, keynum, dir, get_key);
022c9c
 	} else {
022c9c
 		struct mlist_head *head = &map->head;
022c9c
-		struct mlist_head *c, *a, *last, *tmp;
022c9c
+		struct mlist_head *c, *a = 0, *last, *tmp;
022c9c
 		int num, swaps = 1;
022c9c
 
022c9c
 		if (mlist_empty(head))