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

--- Comment #5 from ktkachov at gcc dot gnu.org ---
Sorry for getting back late on this. I'll try to give more detailed steps to
reproduce this.

I take my clean checkout of trunk from svn and do:

1) $ svn up -r226900
This is the revision before the copyrename patch.

2) I build a simple cc1 by doing:
$ cd <build path>
$ $<path to gcc source>/configure --prefix=`pwd` --enable-languages=c,c++
--target=arm-none-eabi
$ make -j<n>

Wait till it builds cc1.
The testcase is:
$ cat rev.c
extern short foos16 (short);

/* revshne */
short swaps16_cond (short x, int y)
{
  short z = x;
  if (y)
    z = __builtin_bswap16 (x);
  return foos16 (z);
}

3) I compile the testcase:
$ <build path>/gcc/cc1  -march=armv7-a -O2 -marm rev.c

The output rev.s contains:
swaps16_cond:
        @ args = 0, pretend = 0, frame = 0
        @ frame_needed = 0, uses_anonymous_args = 0
        @ link register save eliminated.
        cmp     r1, #0
        revshne r0, r0
.L2:
        b       foos16


4) Now I go back to the gcc svn checkout and do:
$ svn up -r226901
This is the revision with the copyrename patch.

5) Rebuild cc1 as in step 2.

6) Compile the testcase again:
$ <build path>/gcc/cc1  -march=armv7-a -O2 -marm rev.c

rev.s now contains:
swaps16_cond:
        @ args = 0, pretend = 0, frame = 0
        @ frame_needed = 0, uses_anonymous_args = 0
        @ link register save eliminated.
        cmp     r1, #0
        rev16ne r0, r0
        uxthne  r0, r0
.L2:
        sxth    r0, r0
        b       foos16


Hope this helps,
Kyrill

Reply via email to