This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix ssa coalescing with inline asm (PR middle-end/70593)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Andrew MacLeod <amacleod at redhat dot com>
- Cc: Richard Biener <rguenther at suse dot de>, Jeff Law <law at redhat dot com>, Bernd Schmidt <bschmidt at redhat dot com>, Alexandre Oliva <aoliva at redhat dot com>, gcc-patches at gcc dot gnu dot org
- Date: Tue, 12 Apr 2016 15:06:15 +0200
- Subject: Re: [PATCH] Fix ssa coalescing with inline asm (PR middle-end/70593)
- Authentication-results: sourceware.org; auth=none
- References: <20160408145422 dot GU19207 at tucnak dot redhat dot com> <9DA16A93-95B8-4A4B-BB31-1D34C11E88C7 at suse dot de> <20160408161005 dot GW19207 at tucnak dot redhat dot com> <570C0D91 dot 2030500 at redhat dot com> <alpine dot LSU dot 2 dot 11 dot 1604121027580 dot 13384 at t29 dot fhfr dot qr> <570CF1C6 dot 1070104 at redhat dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Tue, Apr 12, 2016 at 09:01:58AM -0400, Andrew MacLeod wrote:
> I poked around for a while and found a patch from late 2012 where I was
> attempting to implement atomics as a gimple primitive (GIMPLE_ATOMIC). That
> work did indeed add the ability of the CAS primitive to return 2 values to
> op_iter_init and friends. I recall there were maybe a half dozen places in
> the compiler that needed to be updated to deal with 2 results for a gimple
> statement.
>
> It never went anywhere because I ran into a bunch of other problems that
> frustrated me and led me down the frontend/backend separation path :-P
>
> Today, we still just let RTL patterns optimize the conditional result and
> expected-value address parameter from a compare_exchange... so we simply
> bypass the 2 results issue for a CAS and push it to the target :-).
For the __builtin_*_overflow builtins, we lower them into internal functions
that return complex integer that contains both the values we want (result
and overflow flag) and then just extract the real and imag part of that.
Ugly, but it works without major changes to all optimizers.
Jakub