This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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 <law@redhat.com> 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 :-)

1. Delete the code that removes instructions after the trap.

2. Split the block immediately after the trap and remove the edge
    from the original block (with the trap) to the new block.

cfg-cleanup will do that for you if you have a not returning stmt ending
the previous block.

The following patch hopefully does what's oulined above.
Arguably I should have renamed the insert_trap_and_remove_trailing_statements
to something more descriptive, e.g. insert_trap_and_split_block.  Your
call.

Bootstrapped/regtested on x86_64-linux, ok for trunk?

2015-08-18  Marek Polacek  <polacek@redhat.com>

	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): Don't remove all outgoing edges.

	* g++.dg/torture/pr67133.C: New test.
Looks good to me too.
jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]