This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Fix PR48182
- From: Jeff Law <law at redhat dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Marek Polacek <polacek at redhat dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 05 Apr 2013 14:42:19 -0600
- Subject: Re: [PATCH] Fix PR48182
- References: <20130405152230 dot GH24873 at redhat dot com> <515F3265 dot 7090804 at redhat dot com> <20130405203309 dot GJ20334 at tucnak dot redhat dot com>
On 04/05/2013 02:33 PM, Jakub Jelinek wrote:
? I must be missing something, the change causes an early bail out from
On Fri, Apr 05, 2013 at 02:21:57PM -0600, Jeff Law wrote:
On 04/05/2013 09:22 AM, Marek Polacek wrote:
This patch prevents segfault when using --param min-crossjump-insns=0.
What can happen in that case is that flow_find_cross_jump returns 0,
thus nmatch is 0, then
nmatch < PARAM_VALUE (PARAM_MIN_CROSSJUMP_INSNS)
doesn't hold, thus we continue, but we segfault later on when
doing split_block. I think it's better to just bail out in that
case; moreover setting min-crossjump-insns to 0 isn't very common...
Regtested/bootstrapped on x86_64-linux, ok for trunk/4.8?
2013-04-05 Marek Polacek <firstname.lastname@example.org>
* cfgcleanup.c (try_crossjump_to_edge): Bail out if
PARAM_MIN_CROSSJUMP_INSNS is 0.
* gcc.dg/pr48182.c: New test.
OK for the trunk. Release manager's decision for 4.8.
Wouldn't it be better to change params.def to instead say:
5, 1, 0)
Because with the cfgcleanup.c change, --param min-crossjump-insns=0
is handled as =infinity rather than something smaller than 0.
We don't want to raise the min to > 0 as that doesn't allow the user to
turn on this specific transformation.