PATCH: break MIPS16 TLS

Sandra Loosemore sandra@codesourcery.com
Tue Sep 4 13:11:00 GMT 2007


Richard Sandiford wrote:

>> I'm still trying to figure out what to do with the testsuite, since this 
>> change intentionally breaks all the TLS tests with -mips16.
> 
> FWIW, I stand by my original suggestion of adding (working versions of ;)):
> 
> proc check_effective_target_mips16 { } {
>     return [check_no_compiler_messages mips16 assembly {
> 	#ifndef __mips16
> 	#error NO
> 	#endif
>     }]
> }
> 
> proc check_effective_target_flip_mips16 { } {
>     set selector { target { { mips*-*-* } { "-mflip-mips16" } { "" } } }
>     return [expr [dg-process-target $selector] == "S"]
> }
> 
> to gcc/testsuite/lib/target-supports.exp, then either: (a) adding
> FAILs to individual tests for combinations of mips16 and/or flip_mips16,
> such as "{ target { mips16 || flip_mips16 } }" or (b) if that's too hairy,
> short-cutting TLS altogether with:
> 
>     if { [check_effective_target_mips16]
>          || [check_effective_target_flip_mips16] } {
>         return
>     }
> 
> in tls.exp.  I'm not sure if you're asking about this or something else.

I've never looked at any of the dejagnu configuration code before, so 
I'm still trying to get enough context to mess with it without breaking 
everything.  :-P

I'd think that putting the test in one place would be better than 
touching every individual TLS test file, in case more TLS tests are 
added, or MIPS16 is taught how to use the native TLS support now used in 
non-MIPS16 code.


>> Index: gcc/config/mips/mips.c
>> ===================================================================
>> *** gcc/config/mips/mips.c	(revision 128065)
>> --- gcc/config/mips/mips.c	(working copy)
>> *************** mips_cannot_force_const_mem (rtx x)
>> *** 1778,1784 ****
>>       }
>>   
>>     if (TARGET_HAVE_TLS && for_each_rtx (&x, &mips_tls_symbol_ref_1, 0))
>> !     return true;
>>   
>>     return false;
>>   }
>> --- 1778,1791 ----
>>       }
>>   
>>     if (TARGET_HAVE_TLS && for_each_rtx (&x, &mips_tls_symbol_ref_1, 0))
>> !     {
>> !       if (TARGET_MIPS16)
>> ! 	{
>> ! 	  sorry ("MIPS16 TLS");
>> ! 	  return false;
>> ! 	}
>> !       return true;
>> !     }
>>   
>>     return false;
>>   }
> 
> Is this part needed?

Yes.  Without it, I found that tls/opt-13.c was dying with an ICE 
instead of hitting the other sorry message in 
mips_legitimize_tls_address.  Specifically, mips_legitimize_const_move 
was getting a null pointer back from force_const_mem in that case.

-Sandra



More information about the Gcc-patches mailing list