public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/115411] New: ICE : in expand_call, at calls.cc:3668
@ 2024-06-10  7:13 iamanonymous.cs at gmail dot com
  2024-06-10  8:31 ` [Bug middle-end/115411] " rguenth at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: iamanonymous.cs at gmail dot com @ 2024-06-10  7:13 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 115411
           Summary: ICE : in expand_call, at calls.cc:3668
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---

*******************************************************************************
The compiler produces an internal error during the expand RTL pass when
compiling the provided code with the specified options. 
This problem occurs on both gcc and g++.
The issue can also be reproduced on Compiler Explorer.

*******************************************************************************
OS and Platform:
# uname -a
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
*******************************************************************************
# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/root/gdbtest/gcc/gcc-15/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /root/gdbtest/gcc/obj/../gcc/configure
--prefix=/root/gdbtest/gcc/gcc-15 --enable-languages=c,c++,fortran,go
--disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20240509 (experimental) (GCC) 

# g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/root/gdbtest/gcc/gcc-15/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /root/gdbtest/gcc/obj/../gcc/configure
--prefix=/root/gdbtest/gcc/gcc-15 --enable-languages=c,c++,fortran,go
--disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20240509 (experimental) (GCC) 
*******************************************************************************
Program:
# z2.cc

typedef struct { char c[0x40000001]; } s;
void f (s);
int g (s *x)
{
  f (*x);
}

*******************************************************************************
Command Lines:
For g++:
# g++ z2.cc  -Werror -O2 -ftrapv -fstack-protector-strong -o z2.out
/root/gdbtest/gcctest/gcc_llvm/gcc/z2.cc: In function ‘int g(s*)’:
/root/gdbtest/gcctest/gcc_llvm/gcc/z2.cc:6:1: error: no return statement in
function returning non-void [-Werror=return-type]
    6 | }
      | ^
/root/gdbtest/gcctest/gcc_llvm/gcc/z2.cc:5:5: sorry, unimplemented: passing too
large argument on stack
    5 |   f (*x);
      |   ~~^~~~
during RTL pass: expand
/root/gdbtest/gcctest/gcc_llvm/gcc/z2.cc:5:5: internal compiler error: in
expand_call, at calls.cc:3668
0x894771 expand_call(tree_node*, rtx_def*, int)
        /root/gdbtest/gcc/obj/../gcc/gcc/calls.cc:3668
0xf8fe8e expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
        /root/gdbtest/gcc/obj/../gcc/gcc/expr.cc:12364
0xe65f8d expand_expr(tree_node*, rtx_def*, machine_mode, expand_modifier)
        /root/gdbtest/gcc/obj/../gcc/gcc/expr.h:316
0xe65f8d expand_call_stmt
        /root/gdbtest/gcc/obj/../gcc/gcc/cfgexpand.cc:2884
0xe65f8d expand_gimple_stmt_1
        /root/gdbtest/gcc/obj/../gcc/gcc/cfgexpand.cc:3951
0xe65f8d expand_gimple_stmt
        /root/gdbtest/gcc/obj/../gcc/gcc/cfgexpand.cc:4093
0xe66a47 expand_gimple_basic_block
        /root/gdbtest/gcc/obj/../gcc/gcc/cfgexpand.cc:6149
0xe686c6 execute
        /root/gdbtest/gcc/obj/../gcc/gcc/cfgexpand.cc:6888
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.

For gcc:
# gcc z2.cc  -Werror -O2 -ftrapv -fstack-protector-strong -o z2.out
z2.cc: In function ‘int g(s*)’:
z2.cc:6:1: error: no return statement in function returning non-void
[-Werror=return-type]
    6 | }
      | ^
z2.cc:5:5: sorry, unimplemented: passing too large argument on stack
    5 |   f (*x);
      |   ~~^~~~
during RTL pass: expand
z2.cc:5:5: internal compiler error: in expand_call, at calls.cc:3668
0x894771 expand_call(tree_node*, rtx_def*, int)
        /root/gdbtest/gcc/obj/../gcc/gcc/calls.cc:3668
0xf8fe8e expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
        /root/gdbtest/gcc/obj/../gcc/gcc/expr.cc:12364
0xe65f8d expand_expr(tree_node*, rtx_def*, machine_mode, expand_modifier)
        /root/gdbtest/gcc/obj/../gcc/gcc/expr.h:316
0xe65f8d expand_call_stmt
        /root/gdbtest/gcc/obj/../gcc/gcc/cfgexpand.cc:2884
0xe65f8d expand_gimple_stmt_1
        /root/gdbtest/gcc/obj/../gcc/gcc/cfgexpand.cc:3951
0xe65f8d expand_gimple_stmt
        /root/gdbtest/gcc/obj/../gcc/gcc/cfgexpand.cc:4093
0xe66a47 expand_gimple_basic_block
        /root/gdbtest/gcc/obj/../gcc/gcc/cfgexpand.cc:6149
0xe686c6 execute
        /root/gdbtest/gcc/obj/../gcc/gcc/cfgexpand.cc:6888
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.
*******************************************************************************

Also ICE on trunk, compiler explorer:

g++: https://godbolt.org/z/Kr4dvWKrE
gcc : https://godbolt.org/z/cdb87oG84
*******************************************************************************

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

* [Bug middle-end/115411] ICE : in expand_call, at calls.cc:3668
  2024-06-10  7:13 [Bug c/115411] New: ICE : in expand_call, at calls.cc:3668 iamanonymous.cs at gmail dot com
@ 2024-06-10  8:31 ` rguenth at gcc dot gnu.org
  2024-06-10 16:31 ` pinskia at gcc dot gnu.org
  2024-06-10 16:32 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-06-10  8:31 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c                           |middle-end
           Keywords|                            |ice-on-valid-code

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
I think there's related bugs where error-recovery for the

/root/gdbtest/gcctest/gcc_llvm/gcc/z2.cc:5:5: sorry, unimplemented: passing too
large argument on stack
    5 |   f (*x);
      |   ~~^~~~

error isn't fool-proof.

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

* [Bug middle-end/115411] ICE : in expand_call, at calls.cc:3668
  2024-06-10  7:13 [Bug c/115411] New: ICE : in expand_call, at calls.cc:3668 iamanonymous.cs at gmail dot com
  2024-06-10  8:31 ` [Bug middle-end/115411] " rguenth at gcc dot gnu.org
@ 2024-06-10 16:31 ` pinskia at gcc dot gnu.org
  2024-06-10 16:32 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-06-10 16:31 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=84964,
                   |                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=100536
             Target|                            |x86_64

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed.

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

* [Bug middle-end/115411] ICE : in expand_call, at calls.cc:3668
  2024-06-10  7:13 [Bug c/115411] New: ICE : in expand_call, at calls.cc:3668 iamanonymous.cs at gmail dot com
  2024-06-10  8:31 ` [Bug middle-end/115411] " rguenth at gcc dot gnu.org
  2024-06-10 16:31 ` pinskia at gcc dot gnu.org
@ 2024-06-10 16:32 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-06-10 16:32 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2024-06-10

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

end of thread, other threads:[~2024-06-10 16:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-10  7:13 [Bug c/115411] New: ICE : in expand_call, at calls.cc:3668 iamanonymous.cs at gmail dot com
2024-06-10  8:31 ` [Bug middle-end/115411] " rguenth at gcc dot gnu.org
2024-06-10 16:31 ` pinskia at gcc dot gnu.org
2024-06-10 16:32 ` 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).