[testsuite] Fix 64-bit Solaris 2/x86 profiling (PR target/43643)

Richard Guenther richard.guenther@gmail.com
Thu Apr 8 08:47:00 GMT 2010


2010/4/7 Jan Hubicka <hubicka@ucw.cz>:
>> It has been pointed out that the Solaris 2/x86 gmon-sol2.c fails to
>> properly restore the %rcx register with 64-bit -pg.  The following fix,
>> by Jürgen Keil, fixes this.
>>
>> Bootstrapped without regressions on i386-pc-solaris2.10.
>>
>> Ok for mainline, 4.5 and 4.4 branches (once
>> http://gcc.gnu.org/ml/gcc-patches/2010-03/msg00609.html is installed on
>> 4.4)?
>
> OK

Also ok for the 4.5 branch now.

Thanks,
Richard.

> Honza
>>
>>       Rainer
>>
>> --
>> -----------------------------------------------------------------------------
>> Rainer Orth, Center for Biotechnology, Bielefeld University
>>
>>
>> 2010-04-07  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
>>
>>       gcc:
>>       PR target/43643
>>       * config/i386/gmon-sol2.c [__x86_64__]: Properly restore %rcx.
>>
>>       gcc/testsuite:
>>       PR target/43643
>>       * gcc.dg/pr43643.c: New test.
>>
>> diff -r 5be1e1370365 gcc/config/i386/gmon-sol2.c
>> --- a/gcc/config/i386/gmon-sol2.c     Wed Apr 07 12:53:57 2010 +0200
>> +++ b/gcc/config/i386/gmon-sol2.c     Wed Apr 07 14:49:47 2010 +0200
>> @@ -275,7 +275,7 @@
>>      "\tmovq\t0x20(%rsp),%rdi\n"
>>      "\tmovq\t0x18(%rsp),%rsi\n"
>>      "\tmovq\t0x10(%rsp),%rdx\n"
>> -    "\tmovq\t0x08(%rsp),%rdx\n"
>> +    "\tmovq\t0x08(%rsp),%rcx\n"
>>      "\tmovq\t(%rsp),%rax\n"
>>      "\taddq\t$0x38,%rsp\n"
>>      "\tretq\n"
>> diff -r 5be1e1370365 gcc/testsuite/gcc.dg/pr43643.c
>> --- /dev/null Thu Jan 01 00:00:00 1970 +0000
>> +++ b/gcc/testsuite/gcc.dg/pr43643.c  Wed Apr 07 14:49:47 2010 +0200
>> @@ -0,0 +1,24 @@
>> +/* Contributed by Jürgen Keil <jrgn.keil@googlemail.com> */
>> +
>> +/* { dg-do run } */
>> +/* { dg-require-profiling "-pg" } */
>> +/* { dg-options "-O2 -pg" } */
>> +
>> +extern char *strdup (const char *);
>> +
>> +void
>> +func(char *a, char *b, char *c)
>> +{
>> +  strdup(a);
>> +  strdup(b);
>> +  strdup(c);
>> +}
>> +
>> +int
>> +main(void)
>> +{
>> +  func("a", "b", "c");
>> +  return 0;
>> +}
>> +
>> +/* { dg-final { cleanup-profile-file } } */
>



More information about the Gcc-patches mailing list