This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [rs6000] Fix compare debug failure on AIX
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: David Edelsohn <dje dot gcc at gmail dot com>
- Cc: Eric Botcazou <ebotcazou at adacore dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Andrew Pinski <pinskia at gmail dot com>
- Date: Mon, 4 May 2015 10:33:30 +0200
- Subject: Re: [rs6000] Fix compare debug failure on AIX
- Authentication-results: sourceware.org; auth=none
- References: <1633828 dot L6eKc0dpVU at polaris> <1752984 dot z0ljzjyPbr at polaris> <CAGWvnynkc8eLtPndHRffZ-VfwgYyMD1m7m5Y37+Y84+KKP31rg at mail dot gmail dot com> <11730594 dot qrxZLO7yKG at polaris> <CAGWvnynMA+5dDLgGdyc8EQN2OgfYnV1mBNK5Ww3ceFRpCO1+Yw at mail dot gmail dot com>
On Mon, May 4, 2015 at 2:32 AM, David Edelsohn <dje.gcc@gmail.com> wrote:
> On Sat, May 2, 2015 at 6:04 AM, Eric Botcazou <ebotcazou@adacore.com> wrote:
>>> Why should GCC unnecessarily create stack frames to avoid
>>> compare-debug testcase failures?
>>
>> I'm not sure I understand the question... compare-debug failures are failures
>> (-g is not supposed to change the generated code and this XCOFF-specific bug
>> was reported to us) so they need to be fixed.
>>
>> From there on, as Alan said, there are 2 cases: either AIX needs a frame for
>> debugging or it doesn't. If the latter, then the lines can simply be deleted.
>> If the former, we have to draw a line somewhere; Alan suggests always creating
>> a frame while I suggest creating it only at -O0 and -Og.
>
> I believe that AIX does need a frame for debugging. I don't remember
> the exact reason off hand.
>
> I'm sorry that XCOFF debugging changes the generated code (only in the
> sense of allocating a frame), but that is a system dependency. It's
> been this way for over 20 years. I see no reason to produce worse
> code at -O0 when not debugging simply to make testcases happier.
The simple reason is because it is policy for GCC to generate the same
code with -g0 and -g. You can't simply say you don't care.
You never want to run into the situation that you miscompile a program
with -g0 but not with -g because that's very much no fun to debug.
Yes, I don't think we have this policy written down anywhere - something
we should improve on.
Richard.
> By the way, I'm still waiting for the DWARF debugging patches from
> Adacore compatible with AIX as and ld. DWARF debugging would not
> require pushing a frame, and would resolve the failure when testing
> with DWARF. The patch would be adjusted to only push a frame when
> writing XCOFF debugging.
>
> - David