[PATCH] Teach evrp that main's argc argument is always non-negative for C family (PR tree-optimization/89350)

2019-02-15 Thread Jakub Jelinek
Hi! Both the C and C++ standard guarantee that the argc argument to main is non-negative, the following patch sets (or adjusts) the corresponding SSA_NAME_RANGE_INFO. While main is just one, with IPA VRP it can also propagate etc. I had to change one testcase because it started optimizing it bet

Re: [PATCH] Teach evrp that main's argc argument is always non-negative for C family (PR tree-optimization/89350)

2019-02-16 Thread Richard Biener
On February 16, 2019 8:12:34 AM GMT+01:00, Jakub Jelinek wrote: >Hi! > >Both the C and C++ standard guarantee that the argc argument to main is >non-negative, the following patch sets (or adjusts) the corresponding >SSA_NAME_RANGE_INFO. While main is just one, with IPA VRP it can also >propagate

Re: [PATCH] Teach evrp that main's argc argument is always non-negative for C family (PR tree-optimization/89350)

2019-02-16 Thread Jakub Jelinek
On Sat, Feb 16, 2019 at 12:10:22PM +0100, Richard Biener wrote: > On February 16, 2019 8:12:34 AM GMT+01:00, Jakub Jelinek > wrote: > >Both the C and C++ standard guarantee that the argc argument to main is > >non-negative, the following patch sets (or adjusts) the corresponding > >SSA_NAME_RANGE

Re: [PATCH] Teach evrp that main's argc argument is always non-negative for C family (PR tree-optimization/89350)

2019-02-18 Thread Richard Biener
On Sat, 16 Feb 2019, Jakub Jelinek wrote: > On Sat, Feb 16, 2019 at 12:10:22PM +0100, Richard Biener wrote: > > On February 16, 2019 8:12:34 AM GMT+01:00, Jakub Jelinek > > wrote: > > >Both the C and C++ standard guarantee that the argc argument to main is > > >non-negative, the following patch

Re: [PATCH] Teach evrp that main's argc argument is always non-negative for C family (PR tree-optimization/89350)

2019-02-18 Thread Martin Sebor
On 2/16/19 12:12 AM, Jakub Jelinek wrote: Hi! Both the C and C++ standard guarantee that the argc argument to main is non-negative, the following patch sets (or adjusts) the corresponding SSA_NAME_RANGE_INFO. While main is just one, with IPA VRP it can also propagate etc. I had to change one t

Re: [PATCH] Teach evrp that main's argc argument is always non-negative for C family (PR tree-optimization/89350)

2019-02-18 Thread Segher Boessenkool
Hi Jakub, On Sat, Feb 16, 2019 at 08:12:34AM +0100, Jakub Jelinek wrote: > Both the C and C++ standard guarantee that the argc argument to main is > non-negative, the following patch sets (or adjusts) the corresponding > SSA_NAME_RANGE_INFO. I think this should test for flag_hosted somehow? And

Re: [PATCH] Teach evrp that main's argc argument is always non-negative for C family (PR tree-optimization/89350)

2019-02-18 Thread Jakub Jelinek
On Mon, Feb 18, 2019 at 04:47:57PM -0600, Segher Boessenkool wrote: > On Sat, Feb 16, 2019 at 08:12:34AM +0100, Jakub Jelinek wrote: > > Both the C and C++ standard guarantee that the argc argument to main is > > non-negative, the following patch sets (or adjusts) the corresponding > > SSA_NAME_RAN

Re: [PATCH] Teach evrp that main's argc argument is always non-negative for C family (PR tree-optimization/89350)

2019-02-18 Thread Segher Boessenkool
On Mon, Feb 18, 2019 at 11:55:56PM +0100, Jakub Jelinek wrote: > On Mon, Feb 18, 2019 at 04:47:57PM -0600, Segher Boessenkool wrote: > > On Sat, Feb 16, 2019 at 08:12:34AM +0100, Jakub Jelinek wrote: > > > Both the C and C++ standard guarantee that the argc argument to main is > > > non-negative, t

Re: [PATCH] Teach evrp that main's argc argument is always non-negative for C family (PR tree-optimization/89350)

2019-02-18 Thread Joseph Myers
On Sat, 16 Feb 2019, Jakub Jelinek wrote: > Hi! > > Both the C and C++ standard guarantee that the argc argument to main is > non-negative, the following patch sets (or adjusts) the corresponding > SSA_NAME_RANGE_INFO. While main is just one, with IPA VRP it can also > propagate etc. I had to c

Re: [PATCH] Teach evrp that main's argc argument is always non-negative for C family (PR tree-optimization/89350)

2019-02-19 Thread Martin Sebor
On 2/18/19 4:12 PM, Joseph Myers wrote: On Sat, 16 Feb 2019, Jakub Jelinek wrote: Hi! Both the C and C++ standard guarantee that the argc argument to main is non-negative, the following patch sets (or adjusts) the corresponding SSA_NAME_RANGE_INFO. While main is just one, with IPA VRP it can

Re: [PATCH] Teach evrp that main's argc argument is always non-negative for C family (PR tree-optimization/89350)

2019-02-19 Thread Joseph Myers
On Tue, 19 Feb 2019, Martin Sebor wrote: > Sure, the text is in a section named Program startup, but that doesn't > imply that the constraints apply only at program startup. If they did, I think it's clear from the context that the section is describing the interface between the program and its

Re: [PATCH] Teach evrp that main's argc argument is always non-negative for C family (PR tree-optimization/89350)

2019-02-19 Thread Martin Sebor
On 2/19/19 10:18 AM, Joseph Myers wrote: On Tue, 19 Feb 2019, Martin Sebor wrote: Sure, the text is in a section named Program startup, but that doesn't imply that the constraints apply only at program startup. If they did, I think it's clear from the context that the section is describing t

Re: [PATCH] Teach evrp that main's argc argument is always non-negative for C family (PR tree-optimization/89350)

2019-04-30 Thread Jeff Law
On 2/16/19 12:12 AM, Jakub Jelinek wrote: > Hi! > > Both the C and C++ standard guarantee that the argc argument to main is > non-negative, the following patch sets (or adjusts) the corresponding > SSA_NAME_RANGE_INFO. While main is just one, with IPA VRP it can also > propagate etc. I had to ch

Re: [PATCH] Teach evrp that main's argc argument is always non-negative for C family (PR tree-optimization/89350)

2019-04-30 Thread Jakub Jelinek
On Tue, Apr 30, 2019 at 09:03:07AM -0600, Jeff Law wrote: > On 2/16/19 12:12 AM, Jakub Jelinek wrote: > > Both the C and C++ standard guarantee that the argc argument to main is > > non-negative, the following patch sets (or adjusts) the corresponding > > SSA_NAME_RANGE_INFO. While main is just on