This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix dwarf2out ICE with UNSPEC_GOTOFF (PR debug/82837)
- From: Jeff Law <law at redhat dot com>
- To: Jakub Jelinek <jakub at redhat dot com>, Jason Merrill <jason at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 8 Nov 2017 16:34:32 -0700
- Subject: Re: [PATCH] Fix dwarf2out ICE with UNSPEC_GOTOFF (PR debug/82837)
- Authentication-results: sourceware.org; auth=none
- References: <20171106213540.GB14653@tucnak>
On 11/06/2017 02:35 PM, Jakub Jelinek wrote:
> Hi!
>
> My recent changes to const_ok_for_output_1 to allow UNSPEC if target hook
> says it is ok for debug regressed the following testcase, where creative
> simplify-rtx.c changes result in (const (neg (unspec ... UNSPEC_GOTOFF)))
> being emitted and the backend not being able to assemble that (assembler
> has no such relocations).
> We already have a hack to avoid ICEing on NOT in similar cases, this patch
> adds NEG to that. And, in mem_loc_descriptor tries harder to handle these
> cases right - while if we have say (const (not (symbol_ref))) the current
> code would handle it right already, if there is the unspec, we really need
> it to be wrapped inside of CONST, otherwise it is dropped on the floor.
>
> The patch in that case emits (const (neg (unspec ... UNSPEC_GOTOFF)))
> as (neg (const (unspec ... UNSPEC_GOTOFF))).
>
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
>
> 2017-11-06 Jakub Jelinek <jakub@redhat.com>
>
> PR debug/82837
> * dwarf2out.c (const_ok_for_output_1): Reject NEG in addition to NOT.
> (mem_loc_descriptor): Handle (const (neg (...))) as (neg (const (...)))
> and similarly for not instead of neg.
>
> * gcc.dg/debug/dwarf2/pr82837.c: New test.
OK.
jeff