Re: [PATCH] libiberty/pex-win32.c: Initialize orig_err

2020-11-08 Thread Christophe Lyon via Gcc-patches
On Sat, 7 Nov 2020 at 00:59, Jeff Law  wrote:
>
>
> On 9/18/20 6:33 AM, Christophe Lyon wrote:
> > On Thu, 17 Sep 2020 at 23:33, Jeff Law  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 
> >>>   Christophe Lyon  
> >>>
> >>>   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
>


Re: [PATCH] libiberty/pex-win32.c: Initialize orig_err

2020-11-06 Thread Jeff Law via Gcc-patches


On 9/18/20 6:33 AM, Christophe Lyon wrote:
> On Thu, 17 Sep 2020 at 23:33, Jeff Law  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 
>>>   Christophe Lyon  
>>>
>>>   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



Re: [PATCH] libiberty/pex-win32.c: Initialize orig_err

2020-09-18 Thread Christophe Lyon via Gcc-patches
On Thu, 17 Sep 2020 at 23:33, Jeff Law  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 
> >   Christophe Lyon  
> >
> >   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
>
>


Re: [PATCH] libiberty/pex-win32.c: Initialize orig_err

2020-09-17 Thread Jeff Law via Gcc-patches

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 
>   Christophe Lyon  
>
>   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




pEpkey.asc
Description: application/pgp-keys


[PATCH] libiberty/pex-win32.c: Initialize orig_err

2020-09-14 Thread Christophe Lyon via Gcc-patches
Initializing orig_err avoids a warning: "may be used uninitialized".

2020-09-14  Torbjörn SVENSSON 
Christophe Lyon  

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