Denis Chertykov schrieb:
> 2011/4/14 Georg-Johann Lay <a...@gjlay.de>:
>> This tests are intended to reveal the respective PRs because the test
>> case is more stable under slight variations in code (both of
>> application or compiler).
>>
>> This test case migh also be helpful for older versions of avr-gcc, in
>> particular if PR41894 is actually fixed.
>>
>> 2011-04-14  Georg-Johann Lay  <a...@gjlay.de>
>>
>>        PR target/46779
>>        PR target/45291
>>        PR target/41894
>>        * gcc.target/avr/pr46779-1.c: New test case
>>        * gcc.target/avr/pr46779-2.c: New test case
>>
> 
> __asm volatile ("ldi %B0, 56" : "+y" (y));
> 
> It's wrong expression. "+y" must be "=y".

The "+y" is needed because y is both input and output.

> Is this ("+y") required for working test case ?

The bug only shows up when just one byte of Y is accessed via SUBREG.
The intent of "+y" is to direct register allocator to actually use Y.
Otherwise, this simple test cases won't make the bug explicit.

With "+r", "+l", "+x", "+z" or "+d" the bug won't show up because RA
don't chose Y for struct S.

Same is true for plain C code: it's hard to make the bug explicit.

The problem with this bug is that it is very hard to give a test case
and that slight variation in code (both application or compiler) give
the false impression that the bug is fixed while it is actually
persisting. Moreover, this test case is simpler and easier to analyze
than the test cases in the original PRs.

The drawback of the testcase is that no frame pointer must be there,
therefore this tests only is applicable if optimization is on; I chose
two variations of -Os.

Johann

> 
> Denis.
> 

Reply via email to