Re: [PR middle-end/85598] make -Wprintf* pass use loop info for PHI's

2019-02-22 Thread Aldy Hernandez
On 2/22/19 7:34 AM, Jakub Jelinek wrote: On Fri, Feb 22, 2019 at 01:24:38PM +0100, Richard Biener wrote: I believe the flag_printf_return_value change was the final agreed upon solution. Tested on x86-64 Linux. OK for trunk? OK. Just a nit, could you please s/optimizing_late/use_scev/ o

Re: [PR middle-end/85598] make -Wprintf* pass use loop info for PHI's

2019-02-22 Thread Jakub Jelinek
On Fri, Feb 22, 2019 at 01:24:38PM +0100, Richard Biener wrote: > > I believe the flag_printf_return_value change was the final agreed upon > > solution. > > > > Tested on x86-64 Linux. > > > > OK for trunk? > > OK. Just a nit, could you please s/optimizing_late/use_scev/ or something similar? W

Re: [PR middle-end/85598] make -Wprintf* pass use loop info for PHI's

2019-02-22 Thread Richard Biener
On Fri, Feb 22, 2019 at 10:57 AM Aldy Hernandez wrote: > > On 1/31/19 9:56 AM, Richard Biener wrote: > > On Thu, Jan 31, 2019 at 3:45 PM Jakub Jelinek wrote: > >> > >> On Thu, Jan 31, 2019 at 09:30:13AM -0500, Aldy Hernandez wrote: > > (LOOPS_HAVE_PREHEADERS). This avoids unnecessary changes

Re: [PR middle-end/85598] make -Wprintf* pass use loop info for PHI's

2019-02-22 Thread Aldy Hernandez
On 1/31/19 9:56 AM, Richard Biener wrote: On Thu, Jan 31, 2019 at 3:45 PM Jakub Jelinek wrote: On Thu, Jan 31, 2019 at 09:30:13AM -0500, Aldy Hernandez wrote: (LOOPS_HAVE_PREHEADERS). This avoids unnecessary changes to the CFG. But really, I'm just guessing here. LOOPS_NORMAL would also wor

Re: [PR middle-end/85598] make -Wprintf* pass use loop info for PHI's

2019-02-01 Thread Jakub Jelinek
On Fri, Feb 01, 2019 at 10:05:02AM +0100, Richard Biener wrote: > We definitely shouldn't willingly add new instances. Why do we care > about people getting false positives when they willingly disable > -fprintf-return-value? The -fprintf-return-value switch is about code transformations, perhaps

Re: [PR middle-end/85598] make -Wprintf* pass use loop info for PHI's

2019-02-01 Thread Richard Biener
On Thu, Jan 31, 2019 at 4:36 PM Jakub Jelinek wrote: > > On Thu, Jan 31, 2019 at 04:05:51PM +0100, Richard Biener wrote: > > > On Thu, Jan 31, 2019 at 03:56:12PM +0100, Richard Biener wrote: > > > > Don't you alreday have > > > > > > > > @@ -4200,10 +4202,34 @@ pass_sprintf_length::execute (functi

Re: [PR middle-end/85598] make -Wprintf* pass use loop info for PHI's

2019-01-31 Thread Jakub Jelinek
On Thu, Jan 31, 2019 at 04:05:51PM +0100, Richard Biener wrote: > > On Thu, Jan 31, 2019 at 03:56:12PM +0100, Richard Biener wrote: > > > Don't you alreday have > > > > > > @@ -4200,10 +4202,34 @@ pass_sprintf_length::execute (function *fun) > > >init_target_to_host_charmap (); > > > > > >c

Re: [PR middle-end/85598] make -Wprintf* pass use loop info for PHI's

2019-01-31 Thread Richard Biener
On Thu, Jan 31, 2019 at 4:02 PM Jakub Jelinek wrote: > > On Thu, Jan 31, 2019 at 03:56:12PM +0100, Richard Biener wrote: > > Don't you alreday have > > > > @@ -4200,10 +4202,34 @@ pass_sprintf_length::execute (function *fun) > >init_target_to_host_charmap (); > > > >calculate_dominance_inf

Re: [PR middle-end/85598] make -Wprintf* pass use loop info for PHI's

2019-01-31 Thread Jakub Jelinek
On Thu, Jan 31, 2019 at 03:56:12PM +0100, Richard Biener wrote: > Don't you alreday have > > @@ -4200,10 +4202,34 @@ pass_sprintf_length::execute (function *fun) >init_target_to_host_charmap (); > >calculate_dominance_info (CDI_DOMINATORS); > + bool optimizing_late = optimize > 0 && fold

Re: [PR middle-end/85598] make -Wprintf* pass use loop info for PHI's

2019-01-31 Thread Richard Biener
On Thu, Jan 31, 2019 at 3:45 PM Jakub Jelinek wrote: > > On Thu, Jan 31, 2019 at 09:30:13AM -0500, Aldy Hernandez wrote: > > > > (LOOPS_HAVE_PREHEADERS). This avoids unnecessary changes to the CFG. > > > > But really, I'm just guessing here. LOOPS_NORMAL would also work, > > > > albeit creating

Re: [PR middle-end/85598] make -Wprintf* pass use loop info for PHI's

2019-01-31 Thread Jakub Jelinek
On Thu, Jan 31, 2019 at 09:30:13AM -0500, Aldy Hernandez wrote: > > > (LOOPS_HAVE_PREHEADERS). This avoids unnecessary changes to the CFG. > > > But really, I'm just guessing here. LOOPS_NORMAL would also work, > > > albeit creating forwarder blocks. > > > > > > Tested on x86-64 Linux. > > > >

Re: [PR middle-end/85598] make -Wprintf* pass use loop info for PHI's

2019-01-31 Thread Aldy Hernandez
On 1/31/19 4:52 AM, Richard Biener wrote: On Thu, Jan 31, 2019 at 8:40 AM Aldy Hernandez wrote: Hi folks. The problem here is that Wprintf* uses the evrp_range_analyzer engine, and doesn't understand that the x_5 != 256 conditional below should make the RANGE [0, 255], not [0, 256].

Re: [PR middle-end/85598] make -Wprintf* pass use loop info for PHI's

2019-01-31 Thread Richard Biener
On Thu, Jan 31, 2019 at 8:40 AM Aldy Hernandez wrote: > > Hi folks. > > The problem here is that Wprintf* uses the evrp_range_analyzer engine, > and doesn't understand that the x_5 != 256 conditional below should make > the RANGE [0, 255], not [0, 256]. > > [local count: 1063004407]: ># RA

[PR middle-end/85598] make -Wprintf* pass use loop info for PHI's

2019-01-30 Thread Aldy Hernandez
Hi folks. The problem here is that Wprintf* uses the evrp_range_analyzer engine, and doesn't understand that the x_5 != 256 conditional below should make the RANGE [0, 255], not [0, 256]. [local count: 1063004407]: # RANGE [0, 256] NONZERO 511 # x_10 = PHI <0(2), x_5(3)> snprintf (&t