[Bug target/69567] PowerPC64: cstore optimisation produces bad code

msebor at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sat Jan 30 16:45:00 GMT 2016


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

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|powerpc64le-linux           |powerpc64*-linux
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2016-01-30
                 CC|                            |msebor at gcc dot gnu.org
      Known to work|                            |5.3.0
     Ever confirmed|0                           |1
      Known to fail|                            |6.0

--- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> ---
Confirmed on both big and little-endian powerpc64.  The following simplified
test case also reproduces it on trunk.  5.x works.

$ cat ~/testcases/gcc-69567.c && /build/gcc-trunk/gcc/xgcc -B
/build/gcc-trunk/gcc -O1 -Wall -Wextra -Wpedantic ~/testcases/gcc-69567.c &&
./a.out
typedef __INT16_TYPE__  int16_t;
typedef __UINT16_TYPE__ uint16_t;
typedef __INT32_TYPE__  int32_t;
typedef __UINT32_TYPE__ uint32_t;
typedef __INT64_TYPE__  int64_t; 
typedef __UINT64_TYPE__ uint64_t;

#define RSH(A, B) ((uint16_t)(A) >> (B))
#define LSH(A, B) ((uint16_t)(A) << (B))

static uint32_t a;
static uint32_t *aa = &a;

static int64_t b;
static int64_t *bb = &b;

static uint64_t c;

int main(void)
{
  c |= RSH (LSH (*aa, 0), 0) <= *bb;

  if (c != 1)
    __builtin_abort ();
}
Aborted


More information about the Gcc-bugs mailing list