This is the mail archive of the
mailing list for the GCC project.
Re: libgcc: strange optimization
- From: Richard Henderson <rth at redhat dot com>
- To: Michael Walle <michael at walle dot cc>
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 01 Aug 2011 14:29:41 -0700
- Subject: Re: libgcc: strange optimization
- References: <email@example.com>
On 08/01/2011 01:30 PM, Michael Walle wrote:
> 1) function inlining
> 2) deferred argument evaluation
> 3) because our target has no barrel shifter, (arg >> 10) is emitted as a
> function call to libgcc's __ashrsi3 (_in place_!)
> 4) BAM! dead code elimination optimizes r8 assignment away because calli
> may clobber r1-r10 (callee saved registers on lm32).
I'm afraid the only solution I can think of is to force F1 out-of-line.
That's the only safe way to make sure that arguments are completely
evaluated before forcing them into hard register variables.
Alternately, expose new constraints such that you don't need the
hard register variables at all. E.g.
asm("scall" : : "R08"(a1), "R01"(a2));
where Rxx is defined in constraints.md for every relevant register.
That'll prevent a reference to the hard register until register
allocation, at which point we'll have done the right thing with