This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fix PR44281 (bad RA with global regs)

On Wed, Jul 13, 2016 at 07:43:13PM +0200, Bernd Schmidt wrote:
> On 07/13/2016 05:29 PM, Dominik Vogt wrote:
> >Unfortunately this patch (or whatever got actually committed) has
> >broken the test case, which is a bit
> >fishy (see code snippet below).  I assign most registers to global
> >variables and then use some complicated arithmetics with the goal
> >that the pointer stored in the first argument gets saved on the
> >stack and reloaded to a different register.  Before this patch the
> >test case just needed three registers to do its work (r2, r3, r4).
> >With the patch it currently causes an error in the reload pass
> >
> >  error: unable to find a register to spill
> Might be useful to see the dump_reload output.


> >If a fourth register is available, the ICE goes away, but the
> >pointer remains in r2, rendering the test case useless.
> I don't think I quite understand what you're trying to do here,

Alias detection of the memory pointed to by the first register.
There was some hard to trigger bug where writing a bitfield in a
struct would also overwrite the unselected bits of the
corresponding word.  See here:

> but it does look dodgy.

It is.  The problem is that I can't tell Gcc to move the address
to a different register directly, so I had to do some voodoo
to achieve that.  The test case seemed to be the most robust
approach ...

> Whatever this is testing would probably be
> better as a part of a unit test.o

I've spent a lot of time to port the test to Power but was unable
to reproduce the effect.


Dominik ^_^  ^_^


Dominik Vogt
IBM Germany

Attachment: pr67443.c.256r.reload
Description: Text document

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]