public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/113876] New: ICE: in ix86_expand_epilogue, at config/i386/i386.cc:10101 with -O -mpreferred-stack-boundary=3 -finstrument-functions -mapxf -mcmodel=large and _BitInt()
@ 2024-02-11 15:08 zsojka at seznam dot cz
  2024-02-13 18:00 ` [Bug target/113876] ICE: in ix86_expand_epilogue, at config/i386/i386.cc:10101 with -O -mpreferred-stack-boundary=3 -finstrument-functions -mapxf -mcmodel=large jakub at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: zsojka at seznam dot cz @ 2024-02-11 15:08 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 113876
           Summary: ICE: in ix86_expand_epilogue, at
                    config/i386/i386.cc:10101 with -O
                    -mpreferred-stack-boundary=3 -finstrument-functions
                    -mapxf -mcmodel=large and _BitInt()
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zsojka at seznam dot cz
  Target Milestone: ---
              Host: x86_64-pc-linux-gnu
            Target: x86_64-pc-linux-gnu

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O -mpreferred-stack-boundary=3
-finstrument-functions -mapxf -mcmodel=large testcase.c 
during RTL pass: pro_and_epilogue
testcase.c: In function 'bar':
testcase.c:1:21: internal compiler error: in ix86_expand_epilogue, at
config/i386/i386.cc:10101
    1 | _BitInt(129) bar() {}
      |                     ^
0x8b8e63 ix86_expand_epilogue(int)
        /repo/gcc-trunk/gcc/config/i386/i386.cc:10101
0x1fca31f gen_epilogue()
        /repo/gcc-trunk/gcc/config/i386/i386.md:19238
0x18eb205 target_gen_epilogue
        /repo/gcc-trunk/gcc/config/i386/i386.md:18734
0x113ac26 make_epilogue_seq
        /repo/gcc-trunk/gcc/function.cc:5970
0x113acfb thread_prologue_and_epilogue_insns()
        /repo/gcc-trunk/gcc/function.cc:6052
0x113b6a2 rest_of_handle_thread_prologue_and_epilogue
        /repo/gcc-trunk/gcc/function.cc:6565
0x113b6a2 execute
        /repo/gcc-trunk/gcc/function.cc:6651
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-8910-20240210112800-g39920447f87-checking-yes-rtl-df-extra-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
--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-8910-20240210112800-g39920447f87-checking-yes-rtl-df-extra-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240210 (experimental) (GCC)

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

* [Bug target/113876] ICE: in ix86_expand_epilogue, at config/i386/i386.cc:10101 with -O -mpreferred-stack-boundary=3 -finstrument-functions -mapxf -mcmodel=large
  2024-02-11 15:08 [Bug target/113876] New: ICE: in ix86_expand_epilogue, at config/i386/i386.cc:10101 with -O -mpreferred-stack-boundary=3 -finstrument-functions -mapxf -mcmodel=large and _BitInt() zsojka at seznam dot cz
@ 2024-02-13 18:00 ` jakub at gcc dot gnu.org
  2024-02-13 19:59 ` hjl.tools at gmail dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-02-13 18:00 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|ICE: in                     |ICE: in
                   |ix86_expand_epilogue, at    |ix86_expand_epilogue, at
                   |config/i386/i386.cc:10101   |config/i386/i386.cc:10101
                   |with -O                     |with -O
                   |-mpreferred-stack-boundary= |-mpreferred-stack-boundary=
                   |3 -finstrument-functions    |3 -finstrument-functions
                   |-mapxf -mcmodel=large and   |-mapxf -mcmodel=large
                   |_BitInt()                   |
                 CC|                            |hjl.tools at gmail dot com,
                   |                            |jakub at gcc dot gnu.org

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Doesn't need UB in the testcase to reproduce,
/* { dg-options "-O -mpreferred-stack-boundary=3 -finstrument-functions -mapxf
-mcmodel=large" } */

_BitInt(129)
bar (void)
{
  return 0;
}

ICEs too.

And it doesn't have to do anything together with _Bitint either,
/* { dg-options "-O -mpreferred-stack-boundary=3 -finstrument-functions -mapxf
-mcmodel=large" } */

void
bar (unsigned long *p)
{
  p[0] = 0;
  p[1] = 0;
  p[2] = 0;
}

ICEs the same.

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

* [Bug target/113876] ICE: in ix86_expand_epilogue, at config/i386/i386.cc:10101 with -O -mpreferred-stack-boundary=3 -finstrument-functions -mapxf -mcmodel=large
  2024-02-11 15:08 [Bug target/113876] New: ICE: in ix86_expand_epilogue, at config/i386/i386.cc:10101 with -O -mpreferred-stack-boundary=3 -finstrument-functions -mapxf -mcmodel=large and _BitInt() zsojka at seznam dot cz
  2024-02-13 18:00 ` [Bug target/113876] ICE: in ix86_expand_epilogue, at config/i386/i386.cc:10101 with -O -mpreferred-stack-boundary=3 -finstrument-functions -mapxf -mcmodel=large jakub at gcc dot gnu.org
@ 2024-02-13 19:59 ` hjl.tools at gmail dot com
  2024-02-13 20:05 ` cvs-commit at gcc dot gnu.org
  2024-02-13 20:06 ` hjl.tools at gmail dot com
  3 siblings, 0 replies; 5+ messages in thread
From: hjl.tools at gmail dot com @ 2024-02-13 19:59 UTC (permalink / raw)
  To: gcc-bugs

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

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2024-02-13
   Target Milestone|---                         |14.0
                 CC|                            |crazylht at gmail dot com
     Ever confirmed|0                           |1

--- Comment #2 from H.J. Lu <hjl.tools at gmail dot com> ---
A patch is at

https://patchwork.sourceware.org/project/gcc/list/?series=30888

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

* [Bug target/113876] ICE: in ix86_expand_epilogue, at config/i386/i386.cc:10101 with -O -mpreferred-stack-boundary=3 -finstrument-functions -mapxf -mcmodel=large
  2024-02-11 15:08 [Bug target/113876] New: ICE: in ix86_expand_epilogue, at config/i386/i386.cc:10101 with -O -mpreferred-stack-boundary=3 -finstrument-functions -mapxf -mcmodel=large and _BitInt() zsojka at seznam dot cz
  2024-02-13 18:00 ` [Bug target/113876] ICE: in ix86_expand_epilogue, at config/i386/i386.cc:10101 with -O -mpreferred-stack-boundary=3 -finstrument-functions -mapxf -mcmodel=large jakub at gcc dot gnu.org
  2024-02-13 19:59 ` hjl.tools at gmail dot com
@ 2024-02-13 20:05 ` cvs-commit at gcc dot gnu.org
  2024-02-13 20:06 ` hjl.tools at gmail dot com
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-02-13 20:05 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by H.J. Lu <hjl@gcc.gnu.org>:

https://gcc.gnu.org/g:ab71fd7ac7a2307723117c796e7ae4d7e9711058

commit r14-8966-gab71fd7ac7a2307723117c796e7ae4d7e9711058
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Tue Feb 13 11:58:00 2024 -0800

    x86-64: Use push2/pop2 only if the incoming stack is 16-byte aligned

    Since push2/pop2 requires 16-byte stack alignment, don't use them if the
    incoming stack isn't 16-byte aligned.

    gcc/

            PR target/113876
            * config/i386/i386.cc (ix86_pro_and_epilogue_can_use_push2pop2):
            Return false if the incoming stack isn't 16-byte aligned.

    gcc/testsuite/

            PR target/113876
            * gcc.target/i386/pr113876.c: New test.

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

* [Bug target/113876] ICE: in ix86_expand_epilogue, at config/i386/i386.cc:10101 with -O -mpreferred-stack-boundary=3 -finstrument-functions -mapxf -mcmodel=large
  2024-02-11 15:08 [Bug target/113876] New: ICE: in ix86_expand_epilogue, at config/i386/i386.cc:10101 with -O -mpreferred-stack-boundary=3 -finstrument-functions -mapxf -mcmodel=large and _BitInt() zsojka at seznam dot cz
                   ` (2 preceding siblings ...)
  2024-02-13 20:05 ` cvs-commit at gcc dot gnu.org
@ 2024-02-13 20:06 ` hjl.tools at gmail dot com
  3 siblings, 0 replies; 5+ messages in thread
From: hjl.tools at gmail dot com @ 2024-02-13 20:06 UTC (permalink / raw)
  To: gcc-bugs

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

H.J. Lu <hjl.tools at gmail dot com> changed:

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

--- Comment #4 from H.J. Lu <hjl.tools at gmail dot com> ---
Fixed.

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

end of thread, other threads:[~2024-02-13 20:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-11 15:08 [Bug target/113876] New: ICE: in ix86_expand_epilogue, at config/i386/i386.cc:10101 with -O -mpreferred-stack-boundary=3 -finstrument-functions -mapxf -mcmodel=large and _BitInt() zsojka at seznam dot cz
2024-02-13 18:00 ` [Bug target/113876] ICE: in ix86_expand_epilogue, at config/i386/i386.cc:10101 with -O -mpreferred-stack-boundary=3 -finstrument-functions -mapxf -mcmodel=large jakub at gcc dot gnu.org
2024-02-13 19:59 ` hjl.tools at gmail dot com
2024-02-13 20:05 ` cvs-commit at gcc dot gnu.org
2024-02-13 20:06 ` hjl.tools at gmail dot com

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).