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]

[PATCH, i386]: Fix PR69549, wrong code with -O2 and vector arithmetics @ x86_64


Hello!

Attached patch corrects "C" constraint to accept only SSE constant
zero operand and introduces new "BC" constraint to accept all SSE
constant operands (all bits 0 and all bits 1).

As discussed in the PR, the compiler ICEs when "C" constraint is used
non-zero vector operands, so it is still possible to change the
constraint a bit. With fixed constraint, we get "impossible
constraint" error instead of ICEing when following testcase:

--cut here--
typedef int __v4si __attribute__ ((__vector_size__ (16)));

void test (void)
{
  asm volatile ("%0" : : "C" ( (__v4si) { -1, -1, -1, -1 } ));
}
--cut here--

is compiled with -O2 -msse2.

2016-01-28  Uros Bizjak  <ubizjak@gmail.com>

    PR target/69459
    * config/i386/constraints.md (C): Only accept constant zero operand.
    (BC): New constraint.
    * config/i386/sse.md (*mov<mode>_internal): Use BC constraint
    instead of C constraint.
    * doc/md.texi (Machine Constraints): Update description
    of C constraint.

testsuite/ChangeLog:

2016-01-28  Uros Bizjak  <ubizjak@gmail.com>

    PR target/69459
    * gcc.target/i386/pr69459.c: New test.

Patch was bootstrapped and regression tested on x86_64-linux-gnu
{,-m32}. Patch was committed to mainline SVN and will be backported to
release branches.

Uros.

Attachment: p.diff.txt
Description: Text document


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