The test as committed without the tree-vrp.cc change only FAILs with
FAIL: gcc.dg/pr116588.c scan-tree-dump-not vrp2 "0 != 0"
The DEBUG code in there was just to make it easier to debug, but doesn't
actually fail when the test is miscompiled.
We don't need such debugging code in simple tests like that, but it is
useful if they abort when miscompiled.
With this patch without the tree-vrp.cc change I see
FAIL: gcc.dg/pr116588.c execution test
FAIL: gcc.dg/pr116588.c scan-tree-dump-not vrp2 "0 != 0"
and with it it passes.
2024-09-09 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/116588
* gcc.dg/pr116588.c: Remove -DDEBUG from dg-options.
(main): Remove debugging code and simplify.
/* PR tree-optimization/116588 */
/* { dg-do run { target bitint575 } } */
/* { dg-require-effective-target int128 } */
-/* { dg-options "-O2 -fno-vect-cost-model -fno-tree-dominator-opts -fno-tree-fre --param=vrp-block-limit=0 -DDEBUG -fdump-tree-vrp2-details" } */
+/* { dg-options "-O2 -fno-vect-cost-model -fno-tree-dominator-opts -fno-tree-fre --param=vrp-block-limit=0 -fdump-tree-vrp2-details" } */
int a;
__int128 b, c;
int
main ()
{
- __int128 x = foo (0);
-#ifdef DEBUG
- for (unsigned i = 0; i < sizeof (x); i++)
- __builtin_printf ("%02x", i[(volatile unsigned char *) &x]);
- __builtin_printf("\n");
-#else
- if (x)
- __builtin_abort();
-#endif
+ if (foo (0))
+ __builtin_abort ();
}
/* { dg-final { scan-tree-dump-not "0 != 0" "vrp2" } } */