From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18130 invoked by alias); 19 Nov 2010 14:50:36 -0000 Received: (qmail 18115 invoked by uid 22791); 19 Nov 2010 14:50:34 -0000 X-SWARE-Spam-Status: No, hits=-5.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 19 Nov 2010 14:50:29 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id oAJEoRD9022891 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 19 Nov 2010 09:50:28 -0500 Received: from localhost.localdomain (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id oAJEoQ3O002692 for ; Fri, 19 Nov 2010 09:50:27 -0500 From: Phil Muldoon To: gdb-patches@sourceware.org Subject: Fix -fprofile-use warnings/errors. Reply-to: pmuldoon@redhat.com X-URL: http://www.redhat.com Date: Fri, 19 Nov 2010 14:50:00 -0000 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-11/txt/msg00255.txt.bz2 This patch corrects (and in some cases, appeases) compiler warnings generated through the use of -fprofile-use. We've had a variant patch for sometime in the Fedora GDB. This updates HEAD. For reference, my configure and compile setup: ../gdb-patched/configure --enable-targets=all --prefix=/usr --libdir=/usr/lib64 --sysconfdir=/etc --mandir=/usr/share/man --infodir=/usr/share/info --with-gdb-datadir=/usr/share/gdb --with-pythondir=/usr/share/gdb/python --enable-gdb-build-warnings=,-Wno-unused --enable-werror --with-separate-debug-dir=/usr/lib/debug --disable-sim --disable-rpath --with-system-readline --with-expat --without-libexpat-prefix --enable-tui --with-python --with-rpm=librpm.so.1 --without-libunwind --enable-64-bit-bfd x86_64-redhat-linux-gnu make CFLAGS="-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fprofile-use" Test on x8664 with no regressions. Cheers, Phil -- 2010-11-19 Phil Muldoon * cris-tdep.c (cris_software_single_step): Initialize variables to appease fprofile-use warnings. * macroexp.c (expand): Ditto. * remote-m32r-sdi.c: Ditto. * xcoffread.c (read_xcoff_symtab): Ditto. gdbserver: 2010-11-19 Phil Muldoon * linux-x86-low.c (ATTR_NOINLINE_NOCLONE): Define. (add_insns): Use ATTR_NOLINE_NOCLONE. -- diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c index 52a89de..7045cb9 100644 --- a/gdb/cris-tdep.c +++ b/gdb/cris-tdep.c @@ -2134,10 +2134,15 @@ cris_software_single_step (struct frame_info *frame) struct gdbarch *gdbarch = get_frame_arch (frame); struct address_space *aspace = get_frame_address_space (frame); inst_env_type inst_env; + int status; + + /* GCC -fprofile-use warning. */ + memset (&inst_env, 0, sizeof (inst_env)); /* Analyse the present instruction environment and insert breakpoints. */ - int status = find_step_target (frame, &inst_env); + status = find_step_target (frame, &inst_env); + if (status == -1) { /* Could not find a target. Things are likely to go downhill diff --git a/gdb/gdbserver/linux-x86-low.c b/gdb/gdbserver/linux-x86-low.c index 49e9e55..bfd4698 100644 --- a/gdb/gdbserver/linux-x86-low.c +++ b/gdb/gdbserver/linux-x86-low.c @@ -89,6 +89,12 @@ static const char *xmltarget_amd64_linux_no_xml = "@\ #define ARCH_GET_GS 0x1004 #endif +#if defined(__GNUC__) +# define ATTR_NOINLINE_NOCLONE __attribute__((noinline, noclone)) +#else +# define ATTR_NOINLINE_NOCLONE +#endif + /* Per-process arch-specific data we want to keep. */ struct arch_process_info @@ -1520,7 +1526,7 @@ x86_install_fast_tracepoint_jump_pad (CORE_ADDR tpoint, CORE_ADDR tpaddr, adjusted_insn_addr_end); } -static void +static void ATTR_NOINLINE_NOCLONE add_insns (unsigned char *start, int len) { CORE_ADDR buildaddr = current_insn_ptr; diff --git a/gdb/macroexp.c b/gdb/macroexp.c index 86689c3..972e953 100644 --- a/gdb/macroexp.c +++ b/gdb/macroexp.c @@ -1184,6 +1184,9 @@ expand (const char *id, struct macro_buffer va_arg_name; int is_varargs = 0; + /* GCC false -fprofile-use warning. */ + memset (&va_arg_name, 0, sizeof (va_arg_name)); + if (def->argc >= 1) { if (strcmp (def->argv[def->argc - 1], "...") == 0) diff --git a/gdb/remote-m32r-sdi.c b/gdb/remote-m32r-sdi.c index 2b67927..bd06950 100644 --- a/gdb/remote-m32r-sdi.c +++ b/gdb/remote-m32r-sdi.c @@ -273,7 +273,7 @@ send_three_arg_cmd (unsigned char cmd, unsigned long arg1, unsigned long arg2, static unsigned char recv_char_data (void) { - unsigned char val; + unsigned char val = 0; /* GCC -fprofile-use warning. */ recv_data (&val, 1); return val; diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c index 902d48f..196fec1 100644 --- a/gdb/xcoffread.c +++ b/gdb/xcoffread.c @@ -961,6 +961,9 @@ read_xcoff_symtab (struct partial_symtab *pst) CORE_ADDR last_csect_val; int last_csect_sec; + /* GCC -fprofile-use warning. */ + memset (&fcn_aux_saved, 0, sizeof (fcn_aux_saved)); + this_symtab_psymtab = pst; /* Get the appropriate COFF "constants" related to the file we're