On 02/10/2018 05:34 AM, Alexandre Oliva wrote:
> Hi, Joseph,
> 
> On Feb  9, 2018, Joseph Myers <jos...@codesourcery.com> wrote:
> 
>> sh4 is:
>> during RTL pass: final
>> In file included from strtof_l.c:45:
>> strtod_l.c: In function '____strtof_l_internal':
>> strtod_l.c:1769:1: internal compiler error: Segmentation fault
>>  }
>>  ^
>> 0xb98e3f crash_signal
>>         /scratch/jmyers/glibc-bot/src/gcc/gcc/toplev.c:325
>> 0x856b18 maybe_output_next_view
>>         /scratch/jmyers/glibc-bot/src/gcc/gcc/final.c:1726
>> 0x856b18 final_scan_insn(rtx_insn*, _IO_FILE*, int, int, int*)
>>         /scratch/jmyers/glibc-bot/src/gcc/gcc/final.c:2714
>> 0xef36bc print_slot
>>         /scratch/jmyers/glibc-bot/src/gcc/gcc/config/sh/sh.c:2557
>> 0xef6520 output_far_jump(rtx_insn*, rtx_def*)
>>         /scratch/jmyers/glibc-bot/src/gcc/gcc/config/sh/sh.c:2617
>> 0x857098 final_scan_insn(rtx_insn*, _IO_FILE*, int, int, int*)
>>         /scratch/jmyers/glibc-bot/src/gcc/gcc/final.c:3101
>> 0x856c26 final_scan_insn(rtx_insn*, _IO_FILE*, int, int, int*)
>>         /scratch/jmyers/glibc-bot/src/gcc/gcc/final.c:2806
>> 0x858469 final_1
>>         /scratch/jmyers/glibc-bot/src/gcc/gcc/final.c:2088
>> 0x8591d8 rest_of_handle_final
>>         /scratch/jmyers/glibc-bot/src/gcc/gcc/final.c:4637
>> 0x8591d8 execute
>>         /scratch/jmyers/glibc-bot/src/gcc/gcc/final.c:4711
> 
>> Since it's in maybe_output_next_view, I think it probably comes from these 
>> patches.
> Thanks for the backtraces.  The problem is that ports call
> final_scan_insn recursively passing NULL for seen, but now there is code
> that actually cares about carrying information around in it.  I decided
> against silencing the errors by testing seen for non-NULL before
> dereferencing it, and instead arranging for the outermost pointer to be
> recovered in recursive calls.  I hope this is enough to cover all the
> cases of final_scan_insn being called from ports.  Could you possibly
> give it a spin, pretty please with sugar on top? ;-)  Thanks a ton,
> 
> (I'll provide a ChangeLog for formal review and hopefully approval once
> it has gone through more than my initial smoke testing on x86_64, but my
> own testing will take some time, and I wanted to give you something that
> at least stood a chance of fixing the problem before crashing in bed :-)
> 
> 
> [LVU] deal with md final_scan_insn
> 
> From: Alexandre Oliva <aol...@redhat.com>
> 
> Ports call final_scan_insn with seen == NULL, and then
> maybe_output_next_view crashes because it assumes it's
> non-NULL.  Oops.  Fixed.
A bit icky.  But OK.

Jeff

Reply via email to