Sounds good. I will fix the 4.7 version to use the fpie target
selector. The other thing I noticed is that you had removed the
-Wwrite-strings option, but I needed to keep that as it was the
combination of -fPIE and -Wwrite-strings that triggered the bug.

Thanks,
Teresa

On Wed, Dec 7, 2011 at 10:55 PM, Uros Bizjak <ubiz...@gmail.com> wrote:
> On Wed, Dec 7, 2011 at 11:32 PM, Teresa Johnson <tejohn...@google.com> wrote:
>
>>>> An issue turned up in our internal 4.6 based testing that has been
>>>> fixed on trunk. This patch backports the fix to 4.6. I also have a
>>>> small test case that I will add to both 4.6 and 4.7.
>>>>
>>>> Bootstrapped and checked with x86_64-unknown-linux-gnu.
>>>>
>>>> 2011-12-07  Teresa Johnson  <tejohn...@google.com>
>>>>
>>>>       Backport from mainline:
>>>>
>>>>       2011-08-05  Uros Bizjak  <ubiz...@gmail.com>
>>>>
>>>>       * config/i386/i386.md (*movdi_internal_rex64): Use "!o" constraint
>>>>       instead of "!m" for operand 0, alternative 4.
>>>>       (*movdf_internal_rex64): Ditto for operand 0, alernative 6.
>>>>
>>>> 2011-12-07  Teresa Johnson  <tejohn...@google.com>
>>>>
>>>>       * gcc.target/i386/movdi-rex64.c: New.
>>>
>>> Index: testsuite/gcc.target/i386/movdi-rex64.c
>>> ===================================================================
>>> --- testsuite/gcc.target/i386/movdi-rex64.c     (revision 0)
>>> +++ testsuite/gcc.target/i386/movdi-rex64.c     (revision 0)
>>> @@ -0,0 +1,11 @@
>>> +/* { dg-do compile { target *-*-linux* } } */
>>> +/* { dg-options "-fPIE -Wwrite-strings" } */
>>> +
>>> +#include <string.h>
>>> +static __thread char buffer[25];
>>> +const char * error_message (void)
>>> +{
>>> +oops:
>>> +    strcpy (buffer, "Unknown code ");
>>> +    return 0;
>>> +}
>>>
>>> You don't need #include for compile tests, just use:
>>>
>>> --cut here--
>>> /* { dg-do compile } */
>>> /* { dg-options "-fPIE" } */
>>>
>>> char *strcpy (char *dest, const char *src);
>>>
>>> static __thread char buffer[25];
>>>
>>> const char
>>> * error_message (void)
>>> {
>>>  strcpy (buffer, "Unknown code ");
>>>  return 0;
>>> }
>>> --cut here--
>>>
>>> Also this can be compiled everywhere, not just linux.
>>
>> Ok, I will change the testcase to replace the include and retest.
>>
>> Regarding the linux target restriction, though, I was concerned about
>> the -fPIE option used for the test case. I noticed that in 4.7 there
>> is a "pie" effective target keyword (check_effective_target_pie in
>> testsuite/lib/target-supports.exp). However, that does not yet exist
>> in 4.6, so rather than backport that as well I added the linux
>> restriction. I see the same restriction in the other tests that use
>> -fpie in gcc.target/i386 (pr39013-[12].c). What do you think?
>
> Ah, I see. Then pleasee add back linux target selctor for 4.6 and add
> fpie effective target check for 4.7.
>
> Thanks,
> Uros.



-- 
Teresa Johnson | Software Engineer | tejohn...@google.com | 408-460-2413

Reply via email to