This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix ancient wrong-code with ?: (PR middle-end/81814)
- From: Eric Botcazou <ebotcazou at adacore dot com>
- To: Richard Biener <rguenther at suse dot de>
- Cc: gcc-patches at gcc dot gnu dot org, Marek Polacek <polacek at redhat dot com>
- Date: Thu, 31 Aug 2017 16:12:28 +0200
- Subject: Re: [PATCH] Fix ancient wrong-code with ?: (PR middle-end/81814)
- Authentication-results: sourceware.org; auth=none
- References: <20170817124611.GH17069@redhat.com> <2312727.zfElLhdLSG@polaris> <alpine.LSU.2.20.1708311118520.14191@zhemvz.fhfr.qr>
> Can you file a bugreport and include a testcase for gnat.dg so that
> we can reproduce? Bonus points if you manage to create a C testcase
> of course ;)
How can I collect them exactly? ;-)
unsigned long foo (int x)
{
return x > 0 ? (unsigned long) x : 0UL;
}
On x86-64/Linux with GCC 7.2.1, the t.c.003t.original dump contains:
;; Function foo (null)
;; enabled by -tree-original
{
return (long unsigned int) MAX_EXPR <x, 0>;
}
With mainline, it contains:
;; Function foo (null)
;; enabled by -tree-original
{
return x > 0 ? (long unsigned int) x : 0;
}
--
Eric Botcazou