[PATCH][AArch64] Set TREE_TARGET_GLOBALS in aarch64_set_current_function when new tree is the default node to recalculate optab availability

Christophe Lyon christophe.lyon@linaro.org
Mon Feb 29 14:10:00 GMT 2016

On 26 February 2016 at 16:51, James Greenhalgh <james.greenhalgh@arm.com> wrote:
> On Thu, Feb 25, 2016 at 11:04:21AM +0000, Kyrill Tkachov wrote:
>> Hi all,
>> Seems like aarch64 is suffering from something similar to PR 69245 as well.
>> If a target pragma sets the target state to the same as the
>> target_option_default_node the node is just a pointer to
>> target_option_default_node rather than a distinct identical node. So we must
>> still restore the target globals even when setting to
>> target_option_default_node in order to force the midend to recompute the
>> availability of various optabs.
>> If we don't do it, we can get in a problem like in the testcase where the
>> isa_flags are all set correctly, but the optab HAVE_* predicates have not
>> been recomputed.
>> There is also a related issue present when popping/resetting target pragmas
>> for which I'll send out a patch separately.
>> Bootstrapped and tested on aarch64.
>> Ok for trunk?
> OK.

Hi Kyrill,

Since this patch, I'm seeing:
  gcc.dg/torture/pr52429.c   -O2 -flto -fno-use-linker-plugin
-flto-partition=none  (internal compiler error)
on target aarch64-none-linux-gnu

The log has:
spawn -ignore SIGHUP
3/gcc/ /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/testsuite/gcc.dg/torture/pr52429.c
-fno-diagnostics-show-caret -fdiagnostics-color=never -O2 -flto
ugin -flto-partition=none -g -ftree-parallelize-loops=4
-DSTACK_SIZE=16384 -S -o pr52429.s
In function 'foo':
internal compiler error: Segmentation fault
0xade075 crash_signal
0x91f88e record_operand_costs
0x91fdba scan_one_insn
0x91fdba process_bb_for_costs
0x9214e7 find_costs_and_classes
0x922552 ira_set_pseudo_classes(bool, _IO_FILE*)
0x1061ecd alloc_global_sched_pressure_data
0x1061ecd sched_init()
0x10679ed haifa_sched_init()
0xa84fae schedule_insns()
0xa85864 rest_of_handle_sched
0xa85864 execute

Don't you see this regression on your side?



> Thanks,
> James
>> Thanks,
>> Kyrill
>> 2016-02-25  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
>>     PR target/69245
>>     * config/aarch64/aarch64.c (aarch64_set_current_function): Save/restore
>>     target globals when switching to target_option_default_node.
>> 2016-02-25  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
>>     PR target/69245
>>     * gcc.target/aarch64/pr69245_1.c: New test.

More information about the Gcc-patches mailing list