public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/113464] New: ICE: in lower_asm, at gimple-lower-bitint.cc:5200 with invalid __asm__ on _BitInt() at -O1 and above
@ 2024-01-18  3:05 zsojka at seznam dot cz
  2024-01-18  3:57 ` [Bug rtl-optimization/113464] " zsojka at seznam dot cz
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: zsojka at seznam dot cz @ 2024-01-18  3:05 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 113464
           Summary: ICE: in lower_asm, at gimple-lower-bitint.cc:5200 with
                    invalid __asm__ on _BitInt() at -O1 and above
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zsojka at seznam dot cz
                CC: jakub at gcc dot gnu.org
  Target Milestone: ---
              Host: x86_64-pc-linux-gnu
            Target: x86_64-pc-linux-gnu

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O testcase.c 
during GIMPLE pass: bitintlower
testcase.c: In function 'foo':
testcase.c:4:1: internal compiler error: in lower_asm, at
gimple-lower-bitint.cc:5200
    4 | foo(void)
      | ^~~
0xd8ab5d lower_asm
        /repo/gcc-trunk/gcc/gimple-lower-bitint.cc:5200
0xd8ab5d lower_stmt
        /repo/gcc-trunk/gcc/gimple-lower-bitint.cc:5236
0x271bb69 gimple_lower_bitint
        /repo/gcc-trunk/gcc/gimple-lower-bitint.cc:6534
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-r14-8193-20240117105849-g3340878009a-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.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-r14-8193-20240117105849-g3340878009a-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240117 (experimental) (GCC)

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

* [Bug rtl-optimization/113464] ICE: in lower_asm, at gimple-lower-bitint.cc:5200 with invalid __asm__ on _BitInt() at -O1 and above
  2024-01-18  3:05 [Bug rtl-optimization/113464] New: ICE: in lower_asm, at gimple-lower-bitint.cc:5200 with invalid __asm__ on _BitInt() at -O1 and above zsojka at seznam dot cz
@ 2024-01-18  3:57 ` zsojka at seznam dot cz
  2024-01-18 19:10 ` [Bug tree-optimization/113464] " jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: zsojka at seznam dot cz @ 2024-01-18  3:57 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Zdenek Sojka <zsojka at seznam dot cz> ---
Created attachment 57128
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57128&action=edit
testcase triggering SIGSEGV at -O0

Slightly different testcase, triggers SIGSEGV at -O0 at a similar place:
$ x86_64-pc-linux-gnu-gcc testcase2.c -wrapper valgrind,-q
==8413== Invalid read of size 8
==8413==    at 0x271971F: var_to_partition (tree-ssa-live.h:163)
==8413==    by 0x271971F: lower_asm (gimple-lower-bitint.cc:5199)
==8413==    by 0x271971F: (anonymous
namespace)::bitint_large_huge::lower_stmt(gimple*)
(gimple-lower-bitint.cc:5236)
==8413==    by 0x271BB69: gimple_lower_bitint() (gimple-lower-bitint.cc:6534)
==8413==    by 0x13CBE7A: execute_one_pass(opt_pass*) (passes.cc:2646)
==8413==    by 0x13CC76F: execute_pass_list_1(opt_pass*) (passes.cc:2755)
==8413==    by 0x13CC7A8: execute_pass_list(function*, opt_pass*)
(passes.cc:2766)
==8413==    by 0xFCC675: expand (cgraphunit.cc:1842)
==8413==    by 0xFCC675: cgraph_node::expand() (cgraphunit.cc:1795)
==8413==    by 0xFCD589: output_in_order (cgraphunit.cc:2192)
==8413==    by 0xFCD589: symbol_table::compile() [clone .part.0]
(cgraphunit.cc:2396)
==8413==    by 0xFD0537: compile (cgraphunit.cc:2312)
==8413==    by 0xFD0537: symbol_table::finalize_compilation_unit()
(cgraphunit.cc:2584)
==8413==    by 0x150E111: compile_file() (toplev.cc:474)
==8413==    by 0xDE6E6B: do_compile (toplev.cc:2152)
==8413==    by 0xDE6E6B: toplev::main(int, char**) (toplev.cc:2308)
==8413==    by 0xDE864A: main (main.cc:39)
==8413==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==8413== 
during GIMPLE pass: bitintlower0
testcase2.c: In function 'bar':
testcase2.c:2:1: internal compiler error: Segmentation fault
    2 | bar(void)
      | ^~~
0x150dc2f crash_signal
        /repo/gcc-trunk/gcc/toplev.cc:317
0x271971f var_to_partition(_var_map*, tree_node*)
        /repo/gcc-trunk/gcc/tree-ssa-live.h:163
0x271971f lower_asm
        /repo/gcc-trunk/gcc/gimple-lower-bitint.cc:5199
0x271971f lower_stmt
        /repo/gcc-trunk/gcc/gimple-lower-bitint.cc:5236
0x271bb69 gimple_lower_bitint
        /repo/gcc-trunk/gcc/gimple-lower-bitint.cc:6534
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.

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

* [Bug tree-optimization/113464] ICE: in lower_asm, at gimple-lower-bitint.cc:5200 with invalid __asm__ on _BitInt() at -O1 and above
  2024-01-18  3:05 [Bug rtl-optimization/113464] New: ICE: in lower_asm, at gimple-lower-bitint.cc:5200 with invalid __asm__ on _BitInt() at -O1 and above zsojka at seznam dot cz
  2024-01-18  3:57 ` [Bug rtl-optimization/113464] " zsojka at seznam dot cz
@ 2024-01-18 19:10 ` jakub at gcc dot gnu.org
  2024-01-19  9:02 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-01-18 19:10 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2024-01-18
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |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 57144
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57144&action=edit
gcc14-pr113464.patch

Untested fix.

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

* [Bug tree-optimization/113464] ICE: in lower_asm, at gimple-lower-bitint.cc:5200 with invalid __asm__ on _BitInt() at -O1 and above
  2024-01-18  3:05 [Bug rtl-optimization/113464] New: ICE: in lower_asm, at gimple-lower-bitint.cc:5200 with invalid __asm__ on _BitInt() at -O1 and above zsojka at seznam dot cz
  2024-01-18  3:57 ` [Bug rtl-optimization/113464] " zsojka at seznam dot cz
  2024-01-18 19:10 ` [Bug tree-optimization/113464] " jakub at gcc dot gnu.org
@ 2024-01-19  9:02 ` cvs-commit at gcc dot gnu.org
  2024-01-19  9:05 ` jakub at gcc dot gnu.org
  2024-01-20 17:11 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-01-19  9:02 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from GCC 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:ee2aa93e9cd0d62f840cb6614c3cd12c15301a72

commit r14-8278-gee2aa93e9cd0d62f840cb6614c3cd12c15301a72
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Fri Jan 19 10:01:43 2024 +0100

    lower-bitint: Don't use m_loads for loads used in GIMPLE_ASM [PR113464]

    Like for GIMPLE_PHIs or calls, even for GIMPLE_ASMs we want
    a corresponding VAR_DECL assigned for lhs SSA_NAMEs of loads
    from memory, as even GIMPLE_ASM relies on those VAR_DECLs to exist.

    2024-01-19  Jakub Jelinek  <jakub@redhat.com>

            PR tree-optimization/113464
            * gimple-lower-bitint.cc (gimple_lower_bitint): Don't try to
            optimize loads into GIMPLE_ASM stmts.

            * gcc.dg/bitint-75.c: New test.

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

* [Bug tree-optimization/113464] ICE: in lower_asm, at gimple-lower-bitint.cc:5200 with invalid __asm__ on _BitInt() at -O1 and above
  2024-01-18  3:05 [Bug rtl-optimization/113464] New: ICE: in lower_asm, at gimple-lower-bitint.cc:5200 with invalid __asm__ on _BitInt() at -O1 and above zsojka at seznam dot cz
                   ` (2 preceding siblings ...)
  2024-01-19  9:02 ` cvs-commit at gcc dot gnu.org
@ 2024-01-19  9:05 ` jakub at gcc dot gnu.org
  2024-01-20 17:11 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-01-19  9:05 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

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

* [Bug tree-optimization/113464] ICE: in lower_asm, at gimple-lower-bitint.cc:5200 with invalid __asm__ on _BitInt() at -O1 and above
  2024-01-18  3:05 [Bug rtl-optimization/113464] New: ICE: in lower_asm, at gimple-lower-bitint.cc:5200 with invalid __asm__ on _BitInt() at -O1 and above zsojka at seznam dot cz
                   ` (3 preceding siblings ...)
  2024-01-19  9:05 ` jakub at gcc dot gnu.org
@ 2024-01-20 17:11 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-01-20 17:11 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |14.0

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

end of thread, other threads:[~2024-01-20 17:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-18  3:05 [Bug rtl-optimization/113464] New: ICE: in lower_asm, at gimple-lower-bitint.cc:5200 with invalid __asm__ on _BitInt() at -O1 and above zsojka at seznam dot cz
2024-01-18  3:57 ` [Bug rtl-optimization/113464] " zsojka at seznam dot cz
2024-01-18 19:10 ` [Bug tree-optimization/113464] " jakub at gcc dot gnu.org
2024-01-19  9:02 ` cvs-commit at gcc dot gnu.org
2024-01-19  9:05 ` jakub at gcc dot gnu.org
2024-01-20 17:11 ` pinskia 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).