public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/105367] New: [12 Regression] ICE: SIGSEGV in contains_struct_check (tree.h:3570) with -Ofast -mveclibabi=acml
@ 2022-04-24 19:00 zsojka at seznam dot cz
  2022-04-25  7:02 ` [Bug tree-optimization/105367] " rguenth at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: zsojka at seznam dot cz @ 2022-04-24 19:00 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 105367
           Summary: [12 Regression] ICE: SIGSEGV in contains_struct_check
                    (tree.h:3570) with -Ofast -mveclibabi=acml
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zsojka at seznam dot cz
  Target Milestone: ---
              Host: x86_64-pc-linux-gnu

Created attachment 52860
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52860&action=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -Ofast -mveclibabi=acml testcase.c -wrapper
valgrind,-q
==27510== Invalid read of size 2
==27510==    at 0x172F0A7: contains_struct_check (tree.h:3570)
==27510==    by 0x172F0A7: ix86_veclibabi_acml(combined_fn, tree_node*,
tree_node*) (i386.cc:18903)
==27510==    by 0x24C3B67: vectorizable_call(vec_info*, _stmt_vec_info*,
gimple_stmt_iterator*, gimple**, _slp_tree*, vec<stmt_info_for_cost, va_heap,
vl_ptr>*) (tree-vect-stmts.cc:3435)
==27510==    by 0x24D4CDC: vect_analyze_stmt(vec_info*, _stmt_vec_info*, bool*,
_slp_tree*, _slp_instance*, vec<stmt_info_for_cost, va_heap, vl_ptr>*)
(tree-vect-stmts.cc:11173)
==27510==    by 0x1641EF8: vect_slp_analyze_node_operations_1
(tree-vect-slp.cc:4501)
==27510==    by 0x1641EF8: vect_slp_analyze_node_operations(vec_info*,
_slp_tree*, _slp_instance*, hash_set<_slp_tree*, false,
default_hash_traits<_slp_tree*> >&, vec<_slp_tree*, va_heap, vl_ptr>&,
vec<stmt_info_for_cost, va_heap, vl_ptr>*) (tree-vect-slp.cc:4685)
==27510==    by 0x164363A: vect_slp_analyze_operations(vec_info*)
(tree-vect-slp.cc:4924)
==27510==    by 0x164906B: vect_slp_analyze_bb_1 (tree-vect-slp.cc:5892)
==27510==    by 0x164906B: vect_slp_region(vec<basic_block_def*, va_heap,
vl_ptr>, vec<data_reference*, va_heap, vl_ptr>, vec<int, va_heap, vl_ptr>*,
unsigned int, loop*) (tree-vect-slp.cc:5939)
==27510==    by 0x164A864: vect_slp_bbs(vec<basic_block_def*, va_heap, vl_ptr>
const&, loop*) (tree-vect-slp.cc:6130)
==27510==    by 0x164AC2C: vect_slp_function(function*) (tree-vect-slp.cc:6218)
==27510==    by 0x1652A32: (anonymous
namespace)::pass_slp_vectorize::execute(function*) (tree-vectorizer.cc:1506)
==27510==    by 0x1298129: execute_one_pass(opt_pass*) (passes.cc:2638)
==27510==    by 0x12989EF: execute_pass_list_1(opt_pass*) (passes.cc:2738)
==27510==    by 0x1298A01: execute_pass_list_1(opt_pass*) (passes.cc:2739)
==27510==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==27510== 
during GIMPLE pass: slp
testcase.c: In function 'foo':
testcase.c:4:1: internal compiler error: Segmentation fault
    4 | foo() {
      | ^~~
0x13a3d9f crash_signal
        /repo/gcc-trunk/gcc/toplev.cc:322
0x172f0a7 contains_struct_check(tree_node*, tree_node_structure_enum, char
const*, int, char const*)
        /repo/gcc-trunk/gcc/tree.h:3570
0x172f0a7 ix86_veclibabi_acml(combined_fn, tree_node*, tree_node*)
        /repo/gcc-trunk/gcc/config/i386/i386.cc:18903
0x24c3b67 vectorizable_call
        /repo/gcc-trunk/gcc/tree-vect-stmts.cc:3435
0x24d4cdc vect_analyze_stmt(vec_info*, _stmt_vec_info*, bool*, _slp_tree*,
_slp_instance*, vec<stmt_info_for_cost, va_heap, vl_ptr>*)
        /repo/gcc-trunk/gcc/tree-vect-stmts.cc:11173
0x1641ef8 vect_slp_analyze_node_operations_1
        /repo/gcc-trunk/gcc/tree-vect-slp.cc:4501
0x1641ef8 vect_slp_analyze_node_operations
        /repo/gcc-trunk/gcc/tree-vect-slp.cc:4685
0x164363a vect_slp_analyze_operations(vec_info*)
        /repo/gcc-trunk/gcc/tree-vect-slp.cc:4924
0x164906b vect_slp_analyze_bb_1
        /repo/gcc-trunk/gcc/tree-vect-slp.cc:5892
0x164906b vect_slp_region
        /repo/gcc-trunk/gcc/tree-vect-slp.cc:5939
0x164a864 vect_slp_bbs
        /repo/gcc-trunk/gcc/tree-vect-slp.cc:6130
0x164ac2c vect_slp_function(function*)
        /repo/gcc-trunk/gcc/tree-vect-slp.cc:6218
0x1652a32 execute
        /repo/gcc-trunk/gcc/tree-vectorizer.cc:1506
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-r12-8236-20220424133922-g6b7441a46c7-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/12.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--disable-bootstrap --with-cloog --with-ppl --with-isl
--build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu
--target=x86_64-pc-linux-gnu --with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r12-8236-20220424133922-g6b7441a46c7-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.0.1 20220424 (experimental) (GCC)

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

* [Bug tree-optimization/105367] [12 Regression] ICE: SIGSEGV in contains_struct_check (tree.h:3570) with -Ofast -mveclibabi=acml
  2022-04-24 19:00 [Bug tree-optimization/105367] New: [12 Regression] ICE: SIGSEGV in contains_struct_check (tree.h:3570) with -Ofast -mveclibabi=acml zsojka at seznam dot cz
@ 2022-04-25  7:02 ` rguenth at gcc dot gnu.org
  2022-04-25 10:38 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-04-25  7:02 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2022-04-25
             Target|                            |x86_64-*-* i?86-*-*
               Host|x86_64-pc-linux-gnu         |
   Target Milestone|---                         |12.0

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed.  ix86_veclibabi_acml expects mathfn_built_in to work on modes but
the function instead relies on stricter type equality and thus returns NULL
for _Float64.  Note mathfn_built_in is only used to get at the base name for
the function, it might be easier to manually cover that for the fixed set
of functions.

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

* [Bug tree-optimization/105367] [12 Regression] ICE: SIGSEGV in contains_struct_check (tree.h:3570) with -Ofast -mveclibabi=acml
  2022-04-24 19:00 [Bug tree-optimization/105367] New: [12 Regression] ICE: SIGSEGV in contains_struct_check (tree.h:3570) with -Ofast -mveclibabi=acml zsojka at seznam dot cz
  2022-04-25  7:02 ` [Bug tree-optimization/105367] " rguenth at gcc dot gnu.org
@ 2022-04-25 10:38 ` jakub at gcc dot gnu.org
  2022-04-25 10:40 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-04-25 10:38 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 52863
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52863&action=edit
gcc12-pr105367.patch

Untested fix.

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

* [Bug tree-optimization/105367] [12 Regression] ICE: SIGSEGV in contains_struct_check (tree.h:3570) with -Ofast -mveclibabi=acml
  2022-04-24 19:00 [Bug tree-optimization/105367] New: [12 Regression] ICE: SIGSEGV in contains_struct_check (tree.h:3570) with -Ofast -mveclibabi=acml zsojka at seznam dot cz
  2022-04-25  7:02 ` [Bug tree-optimization/105367] " rguenth at gcc dot gnu.org
  2022-04-25 10:38 ` jakub at gcc dot gnu.org
@ 2022-04-25 10:40 ` jakub at gcc dot gnu.org
  2022-04-25 10:49 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-04-25 10:40 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 52864
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52864&action=edit
gcc12-pr105367-2.patch

Variant patch (smaller, just i386 backend).  Advantage of the first one is that
we can use that elsewhere later on.

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

* [Bug tree-optimization/105367] [12 Regression] ICE: SIGSEGV in contains_struct_check (tree.h:3570) with -Ofast -mveclibabi=acml
  2022-04-24 19:00 [Bug tree-optimization/105367] New: [12 Regression] ICE: SIGSEGV in contains_struct_check (tree.h:3570) with -Ofast -mveclibabi=acml zsojka at seznam dot cz
                   ` (2 preceding siblings ...)
  2022-04-25 10:40 ` jakub at gcc dot gnu.org
@ 2022-04-25 10:49 ` rguenth at gcc dot gnu.org
  2022-04-26  7:40 ` cvs-commit at gcc dot gnu.org
  2022-04-26  8:14 ` jakub at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-04-25 10:49 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #3)
> Created attachment 52864 [details]
> gcc12-pr105367-2.patch
> 
> Variant patch (smaller, just i386 backend).  Advantage of the first one is
> that
> we can use that elsewhere later on.

This one is certainly obvious.  I'm less sure about mapping back modes to
_Float and then the corresponding library functions - can we not get into the
situation choosing 'double' for SFmode (on targets where double == float) but
the target
only having sinf() but not sin()?  I guess we have to be more clever wrt
libm.libc_has_function () and choosing the function when we have multiple
choices?

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

* [Bug tree-optimization/105367] [12 Regression] ICE: SIGSEGV in contains_struct_check (tree.h:3570) with -Ofast -mveclibabi=acml
  2022-04-24 19:00 [Bug tree-optimization/105367] New: [12 Regression] ICE: SIGSEGV in contains_struct_check (tree.h:3570) with -Ofast -mveclibabi=acml zsojka at seznam dot cz
                   ` (3 preceding siblings ...)
  2022-04-25 10:49 ` rguenth at gcc dot gnu.org
@ 2022-04-26  7:40 ` cvs-commit at gcc dot gnu.org
  2022-04-26  8:14 ` jakub at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-04-26  7:40 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:5face32b7f439bba283e2eeb2a50f192d605bf57

commit r12-8261-g5face32b7f439bba283e2eeb2a50f192d605bf57
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Tue Apr 26 09:40:03 2022 +0200

    i386: Fix up ICE with -mveclibabi={acml,svml} [PR105367]

    The following testcase ICEs, because conversion between scalar float types
    which have the same mode are useless in GIMPLE, but for mathfn_built_in the
    exact type matters (it treats say double and _Float64 or float and _Float32
    differently, using different suffixes and for the _Float* sometimes
    returning NULL when float/double do have a builtin).

    In ix86_veclibabi_{svml,acml} we are using mathfn_built_in just so that
    we don't have to translate the combined_fn and SFmode vs. DFmode into
    strings ourselfs, and we already earlier punt on anything but SFmode and
    DFmode.  So, this patch just uses the double or float types depending
    on the modes, rather than the types we actually got and which might be
    _Float64 or _Float32 etc.

    2022-04-26  Jakub Jelinek  <jakub@redhat.com>

            PR target/105367
            * config/i386/i386.cc (ix86_veclibabi_svml, ix86_veclibabi_acml):
Pass
            el_mode == DFmode ? double_type_node : float_type_node instead of
            TREE_TYPE (type_in) as first arguments to mathfn_built_in.

            * gcc.target/i386/pr105367.c: New test.

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

* [Bug tree-optimization/105367] [12 Regression] ICE: SIGSEGV in contains_struct_check (tree.h:3570) with -Ofast -mveclibabi=acml
  2022-04-24 19:00 [Bug tree-optimization/105367] New: [12 Regression] ICE: SIGSEGV in contains_struct_check (tree.h:3570) with -Ofast -mveclibabi=acml zsojka at seznam dot cz
                   ` (4 preceding siblings ...)
  2022-04-26  7:40 ` cvs-commit at gcc dot gnu.org
@ 2022-04-26  8:14 ` jakub at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-04-26  8:14 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

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

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed.

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

end of thread, other threads:[~2022-04-26  8:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-24 19:00 [Bug tree-optimization/105367] New: [12 Regression] ICE: SIGSEGV in contains_struct_check (tree.h:3570) with -Ofast -mveclibabi=acml zsojka at seznam dot cz
2022-04-25  7:02 ` [Bug tree-optimization/105367] " rguenth at gcc dot gnu.org
2022-04-25 10:38 ` jakub at gcc dot gnu.org
2022-04-25 10:40 ` jakub at gcc dot gnu.org
2022-04-25 10:49 ` rguenth at gcc dot gnu.org
2022-04-26  7:40 ` cvs-commit at gcc dot gnu.org
2022-04-26  8:14 ` jakub 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).