[PATCH TESTSUITE]: Fix PR43495, gcc.c-torture/execute/20000603-1.c
Janis Johnson
janis.marie.johnson@gmail.com
Wed Mar 24 22:16:00 GMT 2010
On Wed, Mar 24, 2010 at 12:13 PM, Dave Korn
<dave.korn.cygwin@googlemail.com> wrote:
> On 24/03/2010 18:31, Andrew Pinski wrote:
>> On Wed, Mar 24, 2010 at 11:25 AM, Kaveh R. GHAZI <ghazi@caip.rutgers.edu> wrote:
>>> According to the comment in the PR, this testcase is undefined unless
>>> inlining occurs. So I used a sledge hammer and made sure that happens.
>>>
>>> Tested by compiling the modified testcase on all three affected targets
>>> with "-O2 -fpic" and ensured that it doesn't abort any more.
>>>
>>> Okay for mainline?
>>
>> Wait this testcase is valid according to the consensus of the C
>> standard committee or at least according to the comments in the
>> testcase. Or I am missing something?
>
> It doesn't make sense to me either that the same code can be either
> undefined or defined according to some detail of compiler optimisation like
> whether it gets inlined or not. If that were truly the case, surely inlining
> must break the as-if rule?
The testcase change is not OK. If the test invokes undefined behavior the test
should be changed or removed. If it does not invoke undefined behavior, as
Andrew says, then there's a bug in the compiler for the non-inlining case and
there's no point in changing the test to ignore that bug.
This issue needs further input from C language experts.
Janis
More information about the Gcc-patches
mailing list