[patch, mips, testsuite] Fix test to handle optimizations

David Daney ddaney.cavm@gmail.com
Mon Oct 8 18:28:00 GMT 2012


On 10/08/2012 11:15 AM, Mike Stump wrote:
> On Oct 8, 2012, at 9:16 AM, Steve Ellcey <sellcey@mips.com> wrote:
>> The gcc.target/mips/ext_ins.c was failing in little endian mode on MIPS because
>> the compiler is smart enough now to see that 'c' is uninitialized and it can
>> insert the field 'a' into 'c' with a shift and a full store instead of an
>> insert because the store just overwrites unintialized data.  I changed the
>> code to force the compiler to preserve the other fields of 'c' and that makes
>> it use the insert instruction in both big and little endian modes.
>>
>> Tested on mips-mti-elf.
>>
>> OK to checkin?
>
> Ok.

I don't think this is the proper fix for this.

Use of BBIT{0,1} instructions will always be smaller than the 
alternative.  So disabling the test for -Os doesn't fix the problem the 
test is designed to find.

The real problem is that some optimizer is broken.  Instead of disabling 
the tests, can we fix the problem instead?

The goal of the testsuite should be to detect problems, not yield clean 
results.

If Richard disagrees with me, then I would defer to him.


David Daney



More information about the Gcc-patches mailing list