public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] libiberty/pex-win32.c: Initialize orig_err
@ 2020-09-14  9:29 Christophe Lyon
  2020-09-17 21:33 ` Jeff Law
  0 siblings, 1 reply; 5+ messages in thread
From: Christophe Lyon @ 2020-09-14  9:29 UTC (permalink / raw)
  To: gcc-patches

Initializing orig_err avoids a warning: "may be used uninitialized".

2020-09-14  Torbjörn SVENSSON <torbjorn.svensson@st.com>
	Christophe Lyon  <christophe.lyon@linaro.org>

	libiberty/
	* pex-win32 (pex_win32_exec_child): Initialize orig_err.
---
 libiberty/pex-win32.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libiberty/pex-win32.c b/libiberty/pex-win32.c
index 331067b..f5fafaa 100644
--- a/libiberty/pex-win32.c
+++ b/libiberty/pex-win32.c
@@ -771,7 +771,7 @@ pex_win32_exec_child (struct pex_obj *obj ATTRIBUTE_UNUSED, int flags,
   OSVERSIONINFO version_info;
   STARTUPINFO si;
   PROCESS_INFORMATION pi;
-  int orig_out, orig_in, orig_err;
+  int orig_out, orig_in, orig_err = 0;
   BOOL separate_stderr = !(flags & PEX_STDERR_TO_STDOUT);
 
   /* Ensure we have inheritable descriptors to pass to the child.  */
-- 
2.7.4


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] libiberty/pex-win32.c: Initialize orig_err
  2020-09-14  9:29 [PATCH] libiberty/pex-win32.c: Initialize orig_err Christophe Lyon
@ 2020-09-17 21:33 ` Jeff Law
  2020-09-18 12:33   ` Christophe Lyon
  0 siblings, 1 reply; 5+ messages in thread
From: Jeff Law @ 2020-09-17 21:33 UTC (permalink / raw)
  To: Christophe Lyon, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 579 bytes --]


On 9/14/20 3:29 AM, Christophe Lyon via Gcc-patches wrote:
> Initializing orig_err avoids a warning: "may be used uninitialized".
>
> 2020-09-14  Torbjörn SVENSSON <torbjorn.svensson@st.com>
> 	Christophe Lyon  <christophe.lyon@linaro.org>
>
> 	libiberty/
> 	* pex-win32 (pex_win32_exec_child): Initialize orig_err.

Rather than just blindly initializing orig_err, we'd actually prefer to
have a compilable testcase and analyze why we're getting the warning.  A
false positive -Wuninitialized warning is often a missed optimization
under the hood.


jeff



[-- Attachment #2: pEpkey.asc --]
[-- Type: application/pgp-keys, Size: 1763 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] libiberty/pex-win32.c: Initialize orig_err
  2020-09-17 21:33 ` Jeff Law
@ 2020-09-18 12:33   ` Christophe Lyon
  2020-11-06 23:59     ` Jeff Law
  0 siblings, 1 reply; 5+ messages in thread
From: Christophe Lyon @ 2020-09-18 12:33 UTC (permalink / raw)
  To: Jeff Law; +Cc: gcc Patches

On Thu, 17 Sep 2020 at 23:33, Jeff Law <law@redhat.com> wrote:
>
>
> On 9/14/20 3:29 AM, Christophe Lyon via Gcc-patches wrote:
> > Initializing orig_err avoids a warning: "may be used uninitialized".
> >
> > 2020-09-14  Torbjörn SVENSSON <torbjorn.svensson@st.com>
> >       Christophe Lyon  <christophe.lyon@linaro.org>
> >
> >       libiberty/
> >       * pex-win32 (pex_win32_exec_child): Initialize orig_err.
>
> Rather than just blindly initializing orig_err, we'd actually prefer to
> have a compilable testcase and analyze why we're getting the warning.  A
> false positive -Wuninitialized warning is often a missed optimization
> under the hood.
>

OK, I filed https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97108
after checking the problem is still present with trunk and not only
with the old gcc version we have in our builders.

Thanks

Christophe

>
> jeff
>
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] libiberty/pex-win32.c: Initialize orig_err
  2020-09-18 12:33   ` Christophe Lyon
@ 2020-11-06 23:59     ` Jeff Law
  2020-11-09  7:16       ` Christophe Lyon
  0 siblings, 1 reply; 5+ messages in thread
From: Jeff Law @ 2020-11-06 23:59 UTC (permalink / raw)
  To: Christophe Lyon; +Cc: gcc Patches


On 9/18/20 6:33 AM, Christophe Lyon wrote:
> On Thu, 17 Sep 2020 at 23:33, Jeff Law <law@redhat.com> wrote:
>>
>> On 9/14/20 3:29 AM, Christophe Lyon via Gcc-patches wrote:
>>> Initializing orig_err avoids a warning: "may be used uninitialized".
>>>
>>> 2020-09-14  Torbjörn SVENSSON <torbjorn.svensson@st.com>
>>>       Christophe Lyon  <christophe.lyon@linaro.org>
>>>
>>>       libiberty/
>>>       * pex-win32 (pex_win32_exec_child): Initialize orig_err.
>> Rather than just blindly initializing orig_err, we'd actually prefer to
>> have a compilable testcase and analyze why we're getting the warning.  A
>> false positive -Wuninitialized warning is often a missed optimization
>> under the hood.
>>
> OK, I filed https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97108
> after checking the problem is still present with trunk and not only
> with the old gcc version we have in our builders.

Thanks.  I've put an initial analysis in there.  I think it's pointing
at a failing in both the traditional threader as well as the backwards
threader.  The backwards threader is probably the place to fix it in the
long term.


In the immediate term, go ahead with the trivial initialization so that
it doesn't show up in your builds.  We'll track the threader issue via
the BZ.


Thanks,

jeff


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] libiberty/pex-win32.c: Initialize orig_err
  2020-11-06 23:59     ` Jeff Law
@ 2020-11-09  7:16       ` Christophe Lyon
  0 siblings, 0 replies; 5+ messages in thread
From: Christophe Lyon @ 2020-11-09  7:16 UTC (permalink / raw)
  To: Jeff Law; +Cc: gcc Patches

On Sat, 7 Nov 2020 at 00:59, Jeff Law <law@redhat.com> wrote:
>
>
> On 9/18/20 6:33 AM, Christophe Lyon wrote:
> > On Thu, 17 Sep 2020 at 23:33, Jeff Law <law@redhat.com> wrote:
> >>
> >> On 9/14/20 3:29 AM, Christophe Lyon via Gcc-patches wrote:
> >>> Initializing orig_err avoids a warning: "may be used uninitialized".
> >>>
> >>> 2020-09-14  Torbjörn SVENSSON <torbjorn.svensson@st.com>
> >>>       Christophe Lyon  <christophe.lyon@linaro.org>
> >>>
> >>>       libiberty/
> >>>       * pex-win32 (pex_win32_exec_child): Initialize orig_err.
> >> Rather than just blindly initializing orig_err, we'd actually prefer to
> >> have a compilable testcase and analyze why we're getting the warning.  A
> >> false positive -Wuninitialized warning is often a missed optimization
> >> under the hood.
> >>
> > OK, I filed https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97108
> > after checking the problem is still present with trunk and not only
> > with the old gcc version we have in our builders.
>
> Thanks.  I've put an initial analysis in there.  I think it's pointing
> at a failing in both the traditional threader as well as the backwards
> threader.  The backwards threader is probably the place to fix it in the
> long term.
>
>
> In the immediate term, go ahead with the trivial initialization so that
> it doesn't show up in your builds.  We'll track the threader issue via
> the BZ.
>

Thanks, pushed as r11-4828.

>
> Thanks,
>
> jeff
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-11-09  7:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-14  9:29 [PATCH] libiberty/pex-win32.c: Initialize orig_err Christophe Lyon
2020-09-17 21:33 ` Jeff Law
2020-09-18 12:33   ` Christophe Lyon
2020-11-06 23:59     ` Jeff Law
2020-11-09  7:16       ` Christophe Lyon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).