[Bug target/91188] New: strict_low_part operations do not work

ubizjak at gmail dot com gcc-bugzilla@gcc.gnu.org
Wed Jul 17 11:31:00 GMT 2019


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91188

            Bug ID: 91188
           Summary: strict_low_part operations do not work
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ubizjak at gmail dot com
  Target Milestone: ---

Following test case:

--cut here--
struct S1
{
  unsigned char val;
  unsigned char pad1;
  unsigned short pad2;
};

struct S1
__attribute__((noinline))
test_andb (struct S1 a, unsigned char b)
{
  a.val &= b;

  return a;
}
--cut here--

compiles on x86_64 with -O2 to:

test_andb:
        movl    %edi, %eax      # 2     [c=4 l=2]  *movsi_internal/0
        andl    %edi, %esi      # 21    [c=4 l=2]  *andsi_1/0
        movb    %sil, %al       # 9     [c=4 l=3]  *movstrictqi_1/0
        ret             # 24    [c=0 l=1]  simple_return_internal

Expected code:

test_andb:
        movl    %edi, %eax
        andb    %sil, %al
        ret


More information about the Gcc-bugs mailing list