Subject: Re: bug#46256: [feature/native-comp] AOT eln files ignored if run from build tree

From: Andrea Corallo <[email-masked]>
Date: Sat, 06 Mar 2021 20:31:02 +0000

Eli Zaretskii <[email-masked]> writes:

>> From: Andrea Corallo <[email-masked]>
>> Cc: Eli Zaretskii <[email-masked]>, [email-masked],
>>         [email-masked]
>> Date: Sat, 06 Mar 2021 19:48:53 +0000
>> 
>> > It's crashing for me with a Feb 15 build of libgccjit from gcc trunk,
>> > but not with a newer build from gcc trunk, so it looks like a gcc bug
>> > that has since been fixed.
>> 
>> I think what you see should be PR99126 [1] that was fixed recently on
>> trunk.
>> 
>> IIRC (might be wrong) Eli is on a GCC 9, where at the time I could not
>> reproduce this bug.
>
> Yes, I'm using GCC 9.2.0.
>
>> If we discover PR99126 shows-up in versions other than 10 we might
>> want to relax the version check around the workaround we have in
>> place.
>
> It looks like that: I patched comp.c to take the workaround regardless
> of the libgccjit version, and the result of running under GDB is:
>
>   libgccjit.so: note: disable pass tree-isolate-paths for functions in the range of [0, 4294967295]
>   [Inferior 1 (process 5640) exited normally]
>
> It also completed much faster than the buggy version, which probably
> means the buggy code has some kind of infinite recursion or other
> issue that causes the run to be much more expensive.

Nice very interesting.  I know the bug is there in 9 too (the builtin
trap is not initialized) but don't know why I could not exercise it on
my setup with the first reproducer I found.

I guess we'll have to extend the workaround to all pre 11 GCC when
configuring Emacs with wide int...

Thanks

  Andrea