Re: c++: Macros need to be GTY-reachable [PR 99023]

2021-03-12 Thread Mike Stump via Gcc-patches
On Feb 18, 2021, at 6:15 AM, Jakub Jelinek via Gcc-patches 
 wrote:
> 
> On Wed, Feb 17, 2021 at 01:46:37PM -0500, Nathan Sidwell wrote:
>> I'd missed that  macros were allocated from GC storage, and that they can
>> become unattached from an identifier, and therefore not  GC-reachable.
>> And then bad things happen.   Fixed by making the module machinery's
>> reference vector a GC root.
>> 
>>  PR c++/99023
>>gcc/cp/
>>* module.cc (struct macro_export): Add GTY markers.
>>(macro_exports): Likewise, us a   va_gc Vector.
>>gcc/testsuite/
>>* g++.dg/modules/pr99023_a.H: New.
>>* g++.dg/modules/pr99023_b.H: New.
> 
> I must say I don't know much about modules, but seeing the second set
> of > 100KB g++.dg/modules/ testcases

Indeed, a test case that shows a memory error, likely is misguided at any size 
as we don't have a system to reliably detect when we are wondering outside the 
GTY sandbox.

Re: c++: Macros need to be GTY-reachable [PR 99023]

2021-02-18 Thread Jakub Jelinek via Gcc-patches
On Wed, Feb 17, 2021 at 01:46:37PM -0500, Nathan Sidwell wrote:
> I'd missed that   macros were allocated from GC storage, and that they can
> become unattached from an identifier, and therefore not   GC-reachable.
> And then bad things happen.   Fixed by making the module machinery's
> reference vector a GC root.
> 
>   PR c++/99023
> gcc/cp/
> * module.cc (struct macro_export): Add GTY markers.
> (macro_exports): Likewise, us a   va_gc Vector.
> gcc/testsuite/
> * g++.dg/modules/pr99023_a.H: New.
> * g++.dg/modules/pr99023_b.H: New.

I must say I don't know much about modules, but seeing the second set
of > 100KB g++.dg/modules/ testcases, I need to wonder, do we really need that
large tests?
Can't cvise (or creduce or multi-delta) be used to minimize that, use
a checking script that uses unfixed and fixed compilers and minimizes
into something that is accepted without errors by the fixed compiler
and still ICEs with the unfixed one?

Jakub