Re: [PATCH] Fix middle-end/67133, part 1

2015-08-24 Thread Marek Polacek
On Mon, Aug 24, 2015 at 09:54:31AM -0600, Jeff Law wrote: > >Not quite. As it seems, it breaks any build: > > > > configure --prefix=... --disable-multilib --enable-languages=all,ada,go > > make > > > >Seems the Go code triggers this ICE, so you just need to enable Go. > Right. Marek is wo

Re: [PATCH] Fix middle-end/67133, part 1

2015-08-24 Thread Jeff Law
On 08/23/2015 04:40 AM, Jan-Benedict Glaw wrote: On Thu, 2015-08-20 11:02:17 +0200, Andreas Schwab wrote: Marek Polacek writes: PR middle-end/67133 * gimple-ssa-isolate-paths.c (insert_trap_and_remove_trailing_statements): Rename to ... (insert_trap): ... this

Re: [PATCH] Fix middle-end/67133, part 1

2015-08-20 Thread Jeff Law
On 08/20/2015 11:00 AM, Marek Polacek wrote: On Thu, Aug 20, 2015 at 06:51:45PM +0200, Marek Polacek wrote: and single_succ_p (bb) is not satisfied, so it must have more outgoing edges. Not sure how can that happen... Actually the problem seems to be that the BB ends with return but it has *no

Re: [PATCH] Fix middle-end/67133, part 1

2015-08-20 Thread Marek Polacek
On Thu, Aug 20, 2015 at 06:51:45PM +0200, Marek Polacek wrote: > and single_succ_p (bb) is not satisfied, so it must have more outgoing edges. > Not sure how can that happen... Actually the problem seems to be that the BB ends with return but it has *no* outgoing edges. Marek

Re: [PATCH] Fix middle-end/67133, part 1

2015-08-20 Thread Jeff Law
On 08/20/2015 10:51 AM, Marek Polacek wrote: Based on the error, I suspect we've got a block ending with a GIMPLE_COND with no successors in the CFG. Except that I'm also seeing a different error: /home/brq/mpolacek/gcc/libgo/go/text/template/exec.go:303:1: error: wrong outgoing edge flags at

Re: [PATCH] Fix middle-end/67133, part 1

2015-08-20 Thread Marek Polacek
On Thu, Aug 20, 2015 at 10:41:28AM -0600, Jeff Law wrote: > On 08/20/2015 04:37 AM, Marek Polacek wrote: > >On Thu, Aug 20, 2015 at 11:02:17AM +0200, Andreas Schwab wrote: > >>Marek Polacek writes: > >> > >>> PR middle-end/67133 > >>> * gimple-ssa-isolate-paths.c > >>> (insert_trap_and_remov

Re: [PATCH] Fix middle-end/67133, part 1

2015-08-20 Thread Jeff Law
On 08/20/2015 04:37 AM, Marek Polacek wrote: On Thu, Aug 20, 2015 at 11:02:17AM +0200, Andreas Schwab wrote: Marek Polacek writes: PR middle-end/67133 * gimple-ssa-isolate-paths.c (insert_trap_and_remove_trailing_statements): Rename to ... (insert_trap): ... th

Re: [PATCH] Fix middle-end/67133, part 1

2015-08-20 Thread Andreas Schwab
Marek Polacek writes: > Whilst I'm struggling with building cross libgo to reproduce this, is > there something like preprocessed source for go? I don't think so. Andreas. -- Andreas Schwab, SUSE Labs, sch...@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "An

Re: [PATCH] Fix middle-end/67133, part 1

2015-08-20 Thread Marek Polacek
On Thu, Aug 20, 2015 at 11:02:17AM +0200, Andreas Schwab wrote: > Marek Polacek writes: > > > PR middle-end/67133 > > * gimple-ssa-isolate-paths.c > > (insert_trap_and_remove_trailing_statements): Rename to ... > > (insert_trap): ... this. Don't remove trailing statements; split

Re: [PATCH] Fix middle-end/67133, part 1

2015-08-20 Thread Andreas Schwab
Marek Polacek writes: > PR middle-end/67133 > * gimple-ssa-isolate-paths.c > (insert_trap_and_remove_trailing_statements): Rename to ... > (insert_trap): ... this. Don't remove trailing statements; split > block instead. > (find_explicit_erroneous_behaviour):

Re: [PATCH] Fix middle-end/67133, part 1

2015-08-19 Thread Jeff Law
On 08/18/2015 01:49 PM, Marek Polacek wrote: On Tue, Aug 18, 2015 at 10:45:21AM +0200, Richard Biener wrote: On Mon, Aug 17, 2015 at 7:31 PM, Jeff Law wrote: But in walking through all that, I think I've stumbled on a simpler solution. Specifically do as a little as possible and let the stand

Re: [PATCH] Fix middle-end/67133, part 1

2015-08-19 Thread Marek Polacek
On Wed, Aug 19, 2015 at 11:48:12AM +0200, Richard Biener wrote: > Looks good to me. Thanks! I'll wait for Jeff if he has any comments. Marek

Re: [PATCH] Fix middle-end/67133, part 1

2015-08-19 Thread Richard Biener
On Tue, Aug 18, 2015 at 9:49 PM, Marek Polacek wrote: > On Tue, Aug 18, 2015 at 10:45:21AM +0200, Richard Biener wrote: >> On Mon, Aug 17, 2015 at 7:31 PM, Jeff Law wrote: >> > But in walking through all that, I think I've stumbled on a simpler >> > solution. Specifically do as a little as possi

Re: [PATCH] Fix middle-end/67133, part 1

2015-08-18 Thread Marek Polacek
On Tue, Aug 18, 2015 at 10:45:21AM +0200, Richard Biener wrote: > On Mon, Aug 17, 2015 at 7:31 PM, Jeff Law wrote: > > But in walking through all that, I think I've stumbled on a simpler > > solution. Specifically do as a little as possible and let the standard > > mechanisms clean things up :-)

Re: [PATCH] Fix middle-end/67133, part 1

2015-08-18 Thread Richard Biener
On Mon, Aug 17, 2015 at 7:31 PM, Jeff Law wrote: > On 08/14/2015 02:46 PM, Marek Polacek wrote: Then in isolate-paths in find_explicit_erroneous_behaviour we're walking the stmts in bb 2 and we find a null dereference, so insert_trap_and_remove_trailing_statements com

Re: [PATCH] Fix middle-end/67133, part 1

2015-08-17 Thread Marek Polacek
On Mon, Aug 17, 2015 at 11:31:57AM -0600, Jeff Law wrote: > The funny thing here is we remove the statements after the trap to avoid > this exact situation! > > I think the problem with schemes that either change the order of block > processing, or which ignore some blocks are going to run into is

Re: [PATCH] Fix middle-end/67133, part 1

2015-08-17 Thread Jeff Law
On 08/14/2015 02:46 PM, Marek Polacek wrote: Then in isolate-paths in find_explicit_erroneous_behaviour we're walking the stmts in bb 2 and we find a null dereference, so insert_trap_and_remove_trailing_statements comes in play and turns bb 2 into: : ... SR.5_10 = MEM[(const struct A &

Re: [PATCH] Fix middle-end/67133, part 1

2015-08-14 Thread Marek Polacek
On Fri, Aug 14, 2015 at 02:32:20PM -0600, Jeff Law wrote: > On 08/14/2015 01:58 PM, Marek Polacek wrote: > >On Fri, Aug 14, 2015 at 09:33:46AM -0600, Jeff Law wrote: > >>>Ok, I'll investigate and come back to y'all when/if I find something. > >>Thanks. I still regret using the TREE_TYPE as a way t

Re: [PATCH] Fix middle-end/67133, part 1

2015-08-14 Thread Jeff Law
On 08/14/2015 01:58 PM, Marek Polacek wrote: On Fri, Aug 14, 2015 at 09:33:46AM -0600, Jeff Law wrote: Ok, I'll investigate and come back to y'all when/if I find something. Thanks. I still regret using the TREE_TYPE as a way to chain elements in the free list:( I didn't want to add another po

Re: [PATCH] Fix middle-end/67133, part 1

2015-08-14 Thread Marek Polacek
On Fri, Aug 14, 2015 at 09:33:46AM -0600, Jeff Law wrote: > >Ok, I'll investigate and come back to y'all when/if I find something. > Thanks. I still regret using the TREE_TYPE as a way to chain elements in > the free list:( I didn't want to add another pointer field... It's actually plain to see

Re: [PATCH] Fix middle-end/67133, part 1

2015-08-14 Thread Jeff Law
On 08/14/2015 09:32 AM, Marek Polacek wrote: On Fri, Aug 14, 2015 at 08:50:22AM -0600, Jeff Law wrote: On 08/14/2015 07:29 AM, Marek Polacek wrote: On Fri, Aug 14, 2015 at 03:14:10PM +0200, Richard Biener wrote: On Fri, Aug 14, 2015 at 1:20 PM, Marek Polacek wrote: As outlined in the PR, thi

Re: [PATCH] Fix middle-end/67133, part 1

2015-08-14 Thread Marek Polacek
On Fri, Aug 14, 2015 at 08:50:22AM -0600, Jeff Law wrote: > On 08/14/2015 07:29 AM, Marek Polacek wrote: > >On Fri, Aug 14, 2015 at 03:14:10PM +0200, Richard Biener wrote: > >>On Fri, Aug 14, 2015 at 1:20 PM, Marek Polacek wrote: > >>>As outlined in the PR, this fixes one ICE. The code in questio

Re: [PATCH] Fix middle-end/67133, part 1

2015-08-14 Thread Jeff Law
On 08/14/2015 07:29 AM, Marek Polacek wrote: On Fri, Aug 14, 2015 at 03:14:10PM +0200, Richard Biener wrote: On Fri, Aug 14, 2015 at 1:20 PM, Marek Polacek wrote: As outlined in the PR, this fixes one ICE. The code in question here tries to determine whether OP can be derived as non-NULL. In

Re: [PATCH] Fix middle-end/67133, part 1

2015-08-14 Thread Marek Polacek
On Fri, Aug 14, 2015 at 03:14:10PM +0200, Richard Biener wrote: > On Fri, Aug 14, 2015 at 1:20 PM, Marek Polacek wrote: > > As outlined in the PR, this fixes one ICE. The code in question here > > tries to determine whether OP can be derived as non-NULL. In case the > > function has the nonnull

Re: [PATCH] Fix middle-end/67133, part 1

2015-08-14 Thread Richard Biener
On Fri, Aug 14, 2015 at 1:20 PM, Marek Polacek wrote: > As outlined in the PR, this fixes one ICE. The code in question here > tries to determine whether OP can be derived as non-NULL. In case the > function has the nonnull attribute that applies to all the arguments, > we want to see whether OP

[PATCH] Fix middle-end/67133, part 1

2015-08-14 Thread Marek Polacek
As outlined in the PR, this fixes one ICE. The code in question here tries to determine whether OP can be derived as non-NULL. In case the function has the nonnull attribute that applies to all the arguments, we want to see whether OP is in this argument list. But nonnull only appertains to poin