Re: Uninit warnings due to optimizing short-circuit conditionals

2022-02-14 Thread Richard Biener via Gcc
On Mon, Feb 14, 2022 at 6:38 PM Mark Wielaard wrote: > > On Mon, 2022-02-14 at 12:20 -0500, David Malcolm wrote: > > On Mon, 2022-02-14 at 17:57 +0100, Mark Wielaard wrote: > > > On Mon, 2022-02-14 at 10:57 -0500, David Malcolm wrote: > > > > [CCing Mark in the hopes of insight from the valgrind s

Re: Uninit warnings due to optimizing short-circuit conditionals

2022-02-14 Thread Mark Wielaard
On Mon, 2022-02-14 at 12:20 -0500, David Malcolm wrote: > On Mon, 2022-02-14 at 17:57 +0100, Mark Wielaard wrote: > > On Mon, 2022-02-14 at 10:57 -0500, David Malcolm wrote: > > > [CCing Mark in the hopes of insight from the valgrind side of > > > things] > > > > Adding Julian to CC so he can corr

Re: Uninit warnings due to optimizing short-circuit conditionals

2022-02-14 Thread David Malcolm via Gcc
On Mon, 2022-02-14 at 17:57 +0100, Mark Wielaard wrote: > Hi David, > > On Mon, 2022-02-14 at 10:57 -0500, David Malcolm wrote: > > [CCing Mark in the hopes of insight from the valgrind side of > > things] > > Adding Julian to CC so he can correct me if I say something silly. > > > There is a fa

Re: Uninit warnings due to optimizing short-circuit conditionals

2022-02-14 Thread David Malcolm via Gcc
On Mon, 2022-02-14 at 09:26 -0700, Jeff Law wrote: > > > On 2/14/2022 8:57 AM, David Malcolm via Gcc wrote: > > [CCing Mark in the hopes of insight from the valgrind side of things] > > > > There is a false positive from -Wanalyzer-use-of-uninitialized-value > > on > > gcc.dg/analyzer/pr102692.c

Re: Uninit warnings due to optimizing short-circuit conditionals

2022-02-14 Thread Mark Wielaard
Hi David, On Mon, 2022-02-14 at 10:57 -0500, David Malcolm wrote: > [CCing Mark in the hopes of insight from the valgrind side of things] Adding Julian to CC so he can correct me if I say something silly. > There is a false positive from -Wanalyzer-use-of-uninitialized-value on > gcc.dg/analyzer

Re: Uninit warnings due to optimizing short-circuit conditionals

2022-02-14 Thread Jeff Law via Gcc
On 2/14/2022 8:57 AM, David Malcolm via Gcc wrote: [CCing Mark in the hopes of insight from the valgrind side of things] There is a false positive from -Wanalyzer-use-of-uninitialized-value on gcc.dg/analyzer/pr102692.c here: ‘fix_overlays_before’: events 1-3 | | 75 | while

Uninit warnings due to optimizing short-circuit conditionals

2022-02-14 Thread David Malcolm via Gcc
[CCing Mark in the hopes of insight from the valgrind side of things] There is a false positive from -Wanalyzer-use-of-uninitialized-value on gcc.dg/analyzer/pr102692.c here: ‘fix_overlays_before’: events 1-3 | | 75 | while (tail | | | 76 | && (

Re: GSoC: Working on the static analyzer

2022-02-14 Thread Basile Starynkevitch
On 2/14/22 13:59, Basile Starynkevitch wrote: Hello, Mir Immad asked: Should the analyzer warn for code like this "when open fails" (like strchr does when 'strchr' returns NULL) int fd = open("NOFILE", O_RDONLY); write(fd, "a", 1); because of the bad file descriptor. unless it is writte

GSoC: Working on the static analyzer

2022-02-14 Thread Basile Starynkevitch
Hello, Mir Immad asked: Should the analyzer warn for code like this "when open fails" (like strchr does when 'strchr' returns NULL) int fd = open("NOFILE", O_RDONLY); write(fd, "a", 1); because of the bad file descriptor. unless it is written like this: if (!errno) write(fd, "a", 1); M

Re: Question on ipa_ref->referring and ipa_ref->stmt on all_late_ipa_passes

2022-02-14 Thread Erick Ochoa via Gcc
On Mon, 14 Feb 2022 at 10:57, Jan Hubicka wrote: > > Hi, > > > > I would like to use ipa_ref in the PASS_LIST all_late_ipa_passes to query > > the statement (ref->stmt) of where a global variable is used. However, I > am > > having some problems achieving this. > > > > What I do is: > > > > 1. Ch

Re: Question on ipa_ref->referring and ipa_ref->stmt on all_late_ipa_passes

2022-02-14 Thread Jan Hubicka via Gcc
> Hi, > > I would like to use ipa_ref in the PASS_LIST all_late_ipa_passes to query > the statement (ref->stmt) of where a global variable is used. However, I am > having some problems achieving this. > > What I do is: > > 1. Check that ipa_ref->referring has a body and is not inlined. > 2. get_

Question on ipa_ref->referring and ipa_ref->stmt on all_late_ipa_passes

2022-02-14 Thread Erick Ochoa via Gcc
Hi, I would like to use ipa_ref in the PASS_LIST all_late_ipa_passes to query the statement (ref->stmt) of where a global variable is used. However, I am having some problems achieving this. What I do is: 1. Check that ipa_ref->referring has a body and is not inlined. 2. get_body 3. try to print