This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] avoid ICE when pretty-printing a VLA with an error bound (PR 85956)
- From: Jason Merrill <jason at redhat dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Martin Sebor <msebor at gmail dot com>, Richard Biener <rguenther at suse dot de>, Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 31 May 2018 13:34:19 -0400
- Subject: Re: [PATCH] avoid ICE when pretty-printing a VLA with an error bound (PR 85956)
- References: <e989d2a5-5ef6-a605-b1b0-472b0ce87adc@gmail.com> <20180531065812.GS14160@tucnak> <CADzB+2k7TWrKue40YhGfc8gsdz0v5WnNs8PTemcKf=4GwcRbjA@mail.gmail.com> <20180531133018.GY14160@tucnak> <d31d3cef-8b63-3ad5-dae4-c9d6b01c4627@gmail.com> <CADzB+2=uJaUtG_UjsbUX+jSCJv1uVtrDroYB=8gX6iNNNuy=Bw@mail.gmail.com> <20180531153129.GA14160@tucnak>
On Thu, May 31, 2018 at 11:31 AM, Jakub Jelinek <jakub@redhat.com> wrote:
> On Thu, May 31, 2018 at 11:19:08AM -0400, Jason Merrill wrote:
>> > In my mind the issue boils down to two questions:
>> >
>> > 1) should the pretty printer handle error-mark-node gracefully
>> > or is it appropriate for it to abort?
>> > 2) is it appropriate to be embedding/using error_mark_node in
>> > valid constructs as a proxy for "unused" or "unknown" or
>> > such?
>> >
>> > I would expect the answer to (1) to be yes. Despite that,
>> > I agree with Jason that the answer to (2) should be no.
>> >
>> > That said, I don't think the fix for this bug needs to depend
>> > on solving (2). We can avoid the ICE by changing the pretty
>> > printers and adjust the openmp implementation later.
>>
>> The problem with embedded error_mark_node is that lots of places are
>> going to blow up like this, and we don't want to change everything to
>> expect it. Adjusting the pretty-printer might fix this particular
>> testcase, but other things are likely to get tripped up by the same
>> problem.
>>
>> Where is the error_mark_node coming from in the first place?
>
> remap_type invoked during omp-low.c (scan_omp).
> omp_copy_decl returns error_mark_node for decls that tree-inline.c wants
> to remap, but they aren't actually remapped for some reason.
> For normal VLAs gimplify.c makes sure the needed artifical decls are
> firstprivatized, but in this case (VLA not in some decl's type, but just
> referenced indirectly through pointers) nothing scans those unless
> those temporaries are actually used in the code.
Returning error_mark_node from omp_copy_decl and then continuing seems
like the problem, then. Would it really be that hard to return an
uninitialized variable instead?
Jason