public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/94434] New: [AArch64][SVE] ICE caused by incompatibility of SRA and svst3 builtin-function
@ 2020-04-01  8:55 bule1 at huawei dot com
  2020-04-09 12:07 ` [Bug ipa/94434] " jamborm at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: bule1 at huawei dot com @ 2020-04-01  8:55 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94434

            Bug ID: 94434
           Summary: [AArch64][SVE] ICE caused by incompatibility of SRA
                    and svst3 builtin-function
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: bule1 at huawei dot com
                CC: mjambor at suse dot cz
  Target Milestone: ---
            Target: aarch64

Created attachment 48154
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48154&action=edit
patch for the problem

test case: gcc/testsuite/gcc.target/aarch64/sve/acle/asm/st2_bf16.c

Command line:gcc st2_bf16.c -march=armv8.2-a+sve -msve-vector-bits=256 -O2
-fno-diagnostics-show-caret -fno-diagnostics-show-line-numbers
-fdiagnostics-color=never -fdiagnostics-urls=never  -DTEST_OVERLOADS
-fno-ipa-icf -c -o st2_bf16.o
during IPA pass: sra
st2_bf16.c: In function ‘st2_vnum_bf16_x1’:
st2_bf16.c:198:1: internal compiler error: Segmentation fault
0xc995b3 crash_signal
        ../.././gcc/toplev.c:328
0xa34f68 hash_map<int_hash<int, 0, -1>, isra_call_summary*,
simple_hashmap_traits<default_hash_traits<int_hash<int, 0, -1> >,
isra_call_summary*> >::get_or_insert(int const&, bool*)
        ../.././gcc/hash-map.h:194
0xa34f68 call_summary<isra_call_summary*>::get_create(cgraph_edge*)
        ../.././gcc/symbol-summary.h:642
0xa34f68 record_nonregister_call_use
        ../.././gcc/ipa-sra.c:1613
0xa34f68 scan_expr_access
        ../.././gcc/ipa-sra.c:1781
0xa37627 scan_function
        ../.././gcc/ipa-sra.c:1880
0xa37627 ipa_sra_summarize_function
        ../.././gcc/ipa-sra.c:2505
0xa38437 ipa_sra_generate_summary
        ../.././gcc/ipa-sra.c:2555
0xbb58bb execute_ipa_summary_passes(ipa_opt_pass_d*)
        ../.././gcc/passes.c:2191
0x7f672f ipa_passes
        ../.././gcc/cgraphunit.c:2627
0x7f672f symbol_table::compile()
        ../.././gcc/cgraphunit.c:2737
0x7f89ab symbol_table::compile()
        ../.././gcc/cgraphunit.c:2717
0x7f89ab symbol_table::finalize_compilation_unit()
        ../.././gcc/cgraphunit.c:2984
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

Similar problems can be found in svst2、svst4 and other functions of this kind.

This problem is cause by "record_nonregister_call_use" function trying to
access the call graph edge of an internal call, .MASK_STORE_LANE, which is a
NULL pointer.

The reason of stepping into "record_nonregister_call_use" function is that the
upper level function "scan_expr_access" considered the "svbfloat16x3_t z1"
argument as a valid candidate for further optimization.

A simple solution here is to disqualify the candidate at "scan_expr_access"
level when the call graph edge is null, which indicates the call is either an
internal call or a call with no references. For both case, the further
optimization process should stop before it reference a NULL pointer.

A proposed patch is attached.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug ipa/94434] [AArch64][SVE] ICE caused by incompatibility of SRA and svst3 builtin-function
  2020-04-01  8:55 [Bug tree-optimization/94434] New: [AArch64][SVE] ICE caused by incompatibility of SRA and svst3 builtin-function bule1 at huawei dot com
@ 2020-04-09 12:07 ` jamborm at gcc dot gnu.org
  2020-04-09 12:51 ` jamborm at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: jamborm at gcc dot gnu.org @ 2020-04-09 12:07 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94434

Martin Jambor <jamborm at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2020-04-09
          Component|tree-optimization           |ipa
             Status|UNCONFIRMED                 |ASSIGNED
                 CC|                            |jamborm at gcc dot gnu.org,
                   |                            |marxin at gcc dot gnu.org

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug ipa/94434] [AArch64][SVE] ICE caused by incompatibility of SRA and svst3 builtin-function
  2020-04-01  8:55 [Bug tree-optimization/94434] New: [AArch64][SVE] ICE caused by incompatibility of SRA and svst3 builtin-function bule1 at huawei dot com
  2020-04-09 12:07 ` [Bug ipa/94434] " jamborm at gcc dot gnu.org
@ 2020-04-09 12:51 ` jamborm at gcc dot gnu.org
  2020-04-09 13:07 ` jamborm at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: jamborm at gcc dot gnu.org @ 2020-04-09 12:51 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94434

Martin Jambor <jamborm at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |jamborm at gcc dot gnu.org

--- Comment #1 from Martin Jambor <jamborm at gcc dot gnu.org> ---
Created attachment 48248
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48248&action=edit
Proposed fix

After our discussion on the mailing list, I'm currently testing this patch

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug ipa/94434] [AArch64][SVE] ICE caused by incompatibility of SRA and svst3 builtin-function
  2020-04-01  8:55 [Bug tree-optimization/94434] New: [AArch64][SVE] ICE caused by incompatibility of SRA and svst3 builtin-function bule1 at huawei dot com
  2020-04-09 12:07 ` [Bug ipa/94434] " jamborm at gcc dot gnu.org
  2020-04-09 12:51 ` jamborm at gcc dot gnu.org
@ 2020-04-09 13:07 ` jamborm at gcc dot gnu.org
  2020-04-09 17:59 ` jamborm at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: jamborm at gcc dot gnu.org @ 2020-04-09 13:07 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94434

Martin Jambor <jamborm at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #48248|0                           |1
        is obsolete|                            |

--- Comment #2 from Martin Jambor <jamborm at gcc dot gnu.org> ---
Created attachment 48249
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48249&action=edit
Proposed fix without a stupid pasto

The previous attachment had an obviou pasto in it, this is what I'm testing.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug ipa/94434] [AArch64][SVE] ICE caused by incompatibility of SRA and svst3 builtin-function
  2020-04-01  8:55 [Bug tree-optimization/94434] New: [AArch64][SVE] ICE caused by incompatibility of SRA and svst3 builtin-function bule1 at huawei dot com
                   ` (2 preceding siblings ...)
  2020-04-09 13:07 ` jamborm at gcc dot gnu.org
@ 2020-04-09 17:59 ` jamborm at gcc dot gnu.org
  2020-04-14 17:28 ` cvs-commit at gcc dot gnu.org
  2020-04-14 17:29 ` jamborm at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jamborm at gcc dot gnu.org @ 2020-04-09 17:59 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94434

--- Comment #3 from Martin Jambor <jamborm at gcc dot gnu.org> ---
I have proposed the patch on the mailing list:
https://gcc.gnu.org/pipermail/gcc-patches/2020-April/543658.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug ipa/94434] [AArch64][SVE] ICE caused by incompatibility of SRA and svst3 builtin-function
  2020-04-01  8:55 [Bug tree-optimization/94434] New: [AArch64][SVE] ICE caused by incompatibility of SRA and svst3 builtin-function bule1 at huawei dot com
                   ` (3 preceding siblings ...)
  2020-04-09 17:59 ` jamborm at gcc dot gnu.org
@ 2020-04-14 17:28 ` cvs-commit at gcc dot gnu.org
  2020-04-14 17:29 ` jamborm at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-04-14 17:28 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94434

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Martin Jambor <jamborm@gcc.gnu.org>:

https://gcc.gnu.org/g:9707b593f88041e74e5cf5640ec64fea13a0387c

commit r10-7719-g9707b593f88041e74e5cf5640ec64fea13a0387c
Author: Martin Jambor <mjambor@suse.cz>
Date:   Tue Apr 14 19:26:04 2020 +0200

    ipa-sra: Fix treatment of internal functions (PR 94434)

    IPA-SRA can segfault when processing a call to an internal function
    because such calls do not have corresponding call graphs and should be
    treated like memory accesses anyway, which what the patch below does.

    The patch makes an attempt to differentiate between reads and writes,
    although for things passed by value it does not make any difference.
    It treats all arguments of functions denoted with internal_store_fn_p
    as written to, even though in practice only some are, but for IPA-SRA
    purposes, actions needed to be taken when processing a read are also
    always performed when analyzing a write, so the code is just slightly
    pessimistic.  But not as pessimistic as bailing out on any internal
    call immediately.

    I have LTO bootstrapped and tested the patch on x86_64-linux and
    normally bootstrapped and tested it on aarch64-linux, although one
    which is not SVE capable.  I would appreciate testing on such machine
    too - as well as a small testcase that would follow all relevant
    conventions in gcc.target/aarch64/sve.

    2020-04-14  Martin Jambor  <mjambor@suse.cz>

            PR ipa/94434
            * ipa-sra.c: Include internal-fn.h.
            (enum isra_scan_context): Update comment.
            (scan_function): Treat calls to internal_functions like loads or
stores.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug ipa/94434] [AArch64][SVE] ICE caused by incompatibility of SRA and svst3 builtin-function
  2020-04-01  8:55 [Bug tree-optimization/94434] New: [AArch64][SVE] ICE caused by incompatibility of SRA and svst3 builtin-function bule1 at huawei dot com
                   ` (4 preceding siblings ...)
  2020-04-14 17:28 ` cvs-commit at gcc dot gnu.org
@ 2020-04-14 17:29 ` jamborm at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jamborm at gcc dot gnu.org @ 2020-04-14 17:29 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94434

Martin Jambor <jamborm at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #5 from Martin Jambor <jamborm at gcc dot gnu.org> ---
Fixed.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-04-14 17:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-01  8:55 [Bug tree-optimization/94434] New: [AArch64][SVE] ICE caused by incompatibility of SRA and svst3 builtin-function bule1 at huawei dot com
2020-04-09 12:07 ` [Bug ipa/94434] " jamborm at gcc dot gnu.org
2020-04-09 12:51 ` jamborm at gcc dot gnu.org
2020-04-09 13:07 ` jamborm at gcc dot gnu.org
2020-04-09 17:59 ` jamborm at gcc dot gnu.org
2020-04-14 17:28 ` cvs-commit at gcc dot gnu.org
2020-04-14 17:29 ` jamborm at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).