This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix ICE with -fno-if-conversion (PR rtl-optimization/68730)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Richard Biener <richard dot guenther at gmail dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 11 Dec 2015 21:13:57 +0100
- Subject: Re: [PATCH] Fix ICE with -fno-if-conversion (PR rtl-optimization/68730)
- Authentication-results: sourceware.org; auth=none
- References: <20151210201116 dot GC5675 at tucnak dot redhat dot com> <2E5E41CF-7225-4051-87B1-C70327FAA952 at gmail dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Fri, Dec 11, 2015 at 07:30:59AM +0100, Richard Biener wrote:
> >So, to fix ICE on the following testcase, we can either do what the
> >patch
> >does, or could conditionalize both the calculate_dominance_info and
> >free_dominance_info in the convert_scalars_to_vector function (stv
> >pass)
> >on the dominance info not being computed (like other places in gcc do),
> >or we could stick free_dominance_info into all passes that break the
> >dominators just in case it would be computed (out_of_cfglayout is one
> >example).
>
> We rely on this everywhere else so that would be preferred.
So like this instead? Bootstrapped/regtested on x86_64-linux and
i686-linux, ok for trunk?
2015-12-10 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/68730
* cfgrtl.c (cfg_layout_finalize): Free dominators.
* gcc.dg/pr68730.c: New test.
--- gcc/cfgrtl.c.jj 2015-11-04 11:12:20.000000000 +0100
+++ gcc/cfgrtl.c 2015-12-11 09:34:58.864893607 +0100
@@ -4299,6 +4299,7 @@ void
cfg_layout_finalize (void)
{
checking_verify_flow_info ();
+ free_dominance_info (CDI_DOMINATORS);
force_one_exit_fallthru ();
rtl_register_cfg_hooks ();
if (reload_completed && !targetm.have_epilogue ())
--- gcc/testsuite/gcc.dg/pr68730.c.jj 2015-12-11 09:25:06.022268146 +0100
+++ gcc/testsuite/gcc.dg/pr68730.c 2015-12-11 09:25:06.022268146 +0100
@@ -0,0 +1,51 @@
+/* PR rtl-optimization/68730 */
+/* { dg-do compile } */
+/* { dg-options "-O3 -fno-if-conversion" } */
+/* { dg-additional-options "-march=x86-64" { target { i?86-*-* x86_64-*-* } } } */
+
+int b, d, e;
+unsigned long long c = 4100543410106915;
+
+void
+foo (void)
+{
+ short f, g = 4 % c;
+ int h = c;
+ if (h)
+ {
+ int i = ~c;
+ if (~c)
+ i = 25662;
+ f = g = i;
+ h = c - g + ~-f;
+ c = ~(c * h - f);
+ }
+ f = g;
+ unsigned long long k = g || c;
+ short l = c ^ g ^ k;
+ if (g > 25662 || c == 74074520320 || !(g < 2))
+ {
+ k = c;
+ l = g;
+ c = ~((k && c) + ~l);
+ f = ~(f * (c ^ k) | l);
+ if (c > k)
+ __builtin_printf ("%d\n", f);
+ }
+ short m = -f;
+ unsigned long long n = c;
+ c = m * f | n % c;
+ if (n)
+ __builtin_printf ("%d\n", f);
+ while (f < -31807)
+ ;
+ c = ~(n | c) | f;
+ if (n < c)
+ __builtin_printf ("%lld\n", (long long) f);
+ for (; d;)
+ for (; e;)
+ for (;;)
+ ;
+ c = h;
+ c = l % c;
+}
Jakub