This is the mail archive of the gcc-patches@gcc.gnu.org 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: [AArch64] Fix predicate and constraint mismatch in logical atomic operations


Segher,

The problem is the "CONST_INT 0", not a large constant. This constant is not accepted by the predicate, but is accepted by the constraint.

On 09/25/2014 03:12 AM, Segher Boessenkool wrote:
On Wed, Sep 24, 2014 at 09:17:23PM -0700, Andrew Pinski wrote:
On Wed, Sep 24, 2014 at 9:13 PM, Michael Collison
<michael.collison@linaro.org> wrote:
I have that attached to the bug report at the URL provided. I will work on a
testcase if you think it is warranted.
Yes it is almost always warranted.

https://gcc.gnu.org/contribute.html#patches

Testcases   If you cannot follow the recommendations of the GCC coding
conventions about testcases, you should include a justification for
why adequate testcases cannot be added.

See the last part of that sentence.  You don't have any justification
on why you are not including testcases.
It is very hard to make a reliable testcase for such problems, because
they only happen when register allocation is under pressure.

The problem is not that "n" allows more than your predicate does.  The
predicate allows registers too, so the compiler happily made a register
contain some big const.  Now RA comes along, is out of registers but hey,
there is this "n", let's just put the big constant there!  Carnage.

So this is hard to test for; you can add some (big) code that exposed the
problem, but in a few months time that won't trigger the problem anymore
because earlier stages in the compiler will have generated slightly
different code.

It also does nothing to catch similar problems in other patterns.


Segher

--
Michael Collison
Linaro Toolchain Working Group
michael.collison@linaro.org


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