public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/106122] New: [12/13 Regression] ICE in fixup_args_size_notes,  at expr.cc:4493
@ 2022-06-28 17:06 gscfq@t-online.de
  2022-06-29  9:44 ` [Bug target/106122] " rguenth at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: gscfq@t-online.de @ 2022-06-28 17:06 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 106122
           Summary: [12/13 Regression] ICE in fixup_args_size_notes, at
                    expr.cc:4493
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gscfq@t-online.de
  Target Milestone: ---

Started between 20211219 and 20220109,
with -Oz and file gcc.target/i386/pr104446.c :


$ gcc-12-20211219 -c pr104446.c -m32 -Oz
$
$ gcc-13-20220626 -c pr104446.c -m32 -Oz
during RTL pass: peephole2
pr104446.c: In function 'baz':
pr104446.c:15:1: internal compiler error: in fixup_args_size_notes, at
expr.cc:4493
   15 | }
      | ^
0x8d72ec fixup_args_size_notes(rtx_insn*, rtx_insn*, poly_int<1u, long>)
        ../../gcc/expr.cc:4493
0xb98f36 peep2_attempt
        ../../gcc/recog.cc:4014
0xb98f36 peephole2_optimize
        ../../gcc/recog.cc:4183
0xb98f36 rest_of_handle_peephole2
        ../../gcc/recog.cc:4331
0xb98f36 execute
        ../../gcc/recog.cc:4365

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

* [Bug target/106122] [12/13 Regression] ICE in fixup_args_size_notes,  at expr.cc:4493
  2022-06-28 17:06 [Bug c/106122] New: [12/13 Regression] ICE in fixup_args_size_notes, at expr.cc:4493 gscfq@t-online.de
@ 2022-06-29  9:44 ` rguenth at gcc dot gnu.org
  2022-06-29 12:05 ` [Bug target/106122] [12/13 Regression] ICE in fixup_args_size_notes, at expr.cc:4493 since r12-6106-gef26c151c14a8717 marxin at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-06-29  9:44 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |12.2

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

* [Bug target/106122] [12/13 Regression] ICE in fixup_args_size_notes,  at expr.cc:4493 since r12-6106-gef26c151c14a8717
  2022-06-28 17:06 [Bug c/106122] New: [12/13 Regression] ICE in fixup_args_size_notes, at expr.cc:4493 gscfq@t-online.de
  2022-06-29  9:44 ` [Bug target/106122] " rguenth at gcc dot gnu.org
@ 2022-06-29 12:05 ` marxin at gcc dot gnu.org
  2022-06-29 13:03 ` roger at nextmovesoftware dot com
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-06-29 12:05 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |marxin at gcc dot gnu.org,
                   |                            |sayle at gcc dot gnu.org,
                   |                            |uros at gcc dot gnu.org
            Summary|[12/13 Regression] ICE in   |[12/13 Regression] ICE in
                   |fixup_args_size_notes, at   |fixup_args_size_notes, at
                   |expr.cc:4493                |expr.cc:4493 since
                   |                            |r12-6106-gef26c151c14a8717

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r12-6106-gef26c151c14a8717.

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

* [Bug target/106122] [12/13 Regression] ICE in fixup_args_size_notes,  at expr.cc:4493 since r12-6106-gef26c151c14a8717
  2022-06-28 17:06 [Bug c/106122] New: [12/13 Regression] ICE in fixup_args_size_notes, at expr.cc:4493 gscfq@t-online.de
  2022-06-29  9:44 ` [Bug target/106122] " rguenth at gcc dot gnu.org
  2022-06-29 12:05 ` [Bug target/106122] [12/13 Regression] ICE in fixup_args_size_notes, at expr.cc:4493 since r12-6106-gef26c151c14a8717 marxin at gcc dot gnu.org
@ 2022-06-29 13:03 ` roger at nextmovesoftware dot com
  2022-07-01  8:20 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: roger at nextmovesoftware dot com @ 2022-06-29 13:03 UTC (permalink / raw)
  To: gcc-bugs

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

Roger Sayle <roger at nextmovesoftware dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2022-06-29
                 CC|                            |roger at nextmovesoftware dot com
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |roger at nextmovesoftware dot com

--- Comment #2 from Roger Sayle <roger at nextmovesoftware dot com> ---
Mine.  Currently testing the (obvious) one line fix:

diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 125a3b4..3b6f362 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -2588,7 +2588,8 @@
   "optimize_insn_for_size_p () && optimize_size > 1
    && operands[1] != const0_rtx
    && IN_RANGE (INTVAL (operands[1]), -128, 127)
-   && !ix86_red_zone_used"
+   && !ix86_red_zone_used
+   && REGNO (operands[0]) != SP_REG"
   [(set (match_dup 2) (match_dup 1))
    (set (match_dup 0) (match_dup 3))]
 {

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

* [Bug target/106122] [12/13 Regression] ICE in fixup_args_size_notes,  at expr.cc:4493 since r12-6106-gef26c151c14a8717
  2022-06-28 17:06 [Bug c/106122] New: [12/13 Regression] ICE in fixup_args_size_notes, at expr.cc:4493 gscfq@t-online.de
                   ` (2 preceding siblings ...)
  2022-06-29 13:03 ` roger at nextmovesoftware dot com
@ 2022-07-01  8:20 ` cvs-commit at gcc dot gnu.org
  2022-07-03 13:02 ` cvs-commit at gcc dot gnu.org
  2022-07-03 13:23 ` roger at nextmovesoftware dot com
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-07-01  8:20 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Roger Sayle <sayle@gcc.gnu.org>:

https://gcc.gnu.org/g:17419b61edd350147b0cc10c3da0b8461e51a42c

commit r13-1380-g17419b61edd350147b0cc10c3da0b8461e51a42c
Author: Roger Sayle <roger@nextmovesoftware.com>
Date:   Fri Jul 1 09:18:07 2022 +0100

    PR target/106122: Don't update %esp via the stack with -Oz on x86.

    When optimizing for size with -Oz, setting a register can be minimized by
    pushing an immediate value to the stack and popping it to the destination.
    Alas the one general register that shouldn't be updated via the stack is
    the stack pointer itself, where "pop %esp" can't be represented in GCC's
    RTL ("use of a register mentioned in pre_inc, pre_dec, post_inc or
    post_dec is not permitted within the same instruction").  This patch
    fixes PR target/106122 by explicitly checking for SP_REG in the
    problematic peephole2.

    2022-07-01  Roger Sayle  <roger@nextmovesoftware.com>

    gcc/ChangeLog
            PR target/106122
            * config/i386/i386.md (peephole2): Avoid generating pop %esp
            when optimizing for size.

    gcc/testsuite/ChangeLog
            PR target/106122
            * gcc.target/i386/pr106122.c: New test case.

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

* [Bug target/106122] [12/13 Regression] ICE in fixup_args_size_notes,  at expr.cc:4493 since r12-6106-gef26c151c14a8717
  2022-06-28 17:06 [Bug c/106122] New: [12/13 Regression] ICE in fixup_args_size_notes, at expr.cc:4493 gscfq@t-online.de
                   ` (3 preceding siblings ...)
  2022-07-01  8:20 ` cvs-commit at gcc dot gnu.org
@ 2022-07-03 13:02 ` cvs-commit at gcc dot gnu.org
  2022-07-03 13:23 ` roger at nextmovesoftware dot com
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-07-03 13:02 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-12 branch has been updated by Roger Sayle <sayle@gcc.gnu.org>:

https://gcc.gnu.org/g:55899e33de74082521708a58fdc79510e0c5efad

commit r12-8542-g55899e33de74082521708a58fdc79510e0c5efad
Author: Roger Sayle <roger@nextmovesoftware.com>
Date:   Sun Jul 3 14:01:17 2022 +0100

    PR target/106122: Don't update %esp via the stack with -Oz on x86.

    When optimizing for size with -Oz, setting a register can be minimized by
    pushing an immediate value to the stack and popping it to the destination.
    Alas the one general register that shouldn't be updated via the stack is
    the stack pointer itself, where "pop %esp" can't be represented in GCC's
    RTL ("use of a register mentioned in pre_inc, pre_dec, post_inc or
    post_dec is not permitted within the same instruction").  This patch
    fixes PR target/106122 by explicitly checking for SP_REG in the
    problematic peephole2.

    2022-07-O3  Roger Sayle  <roger@nextmovesoftware.com>

    gcc/ChangeLog
            PR target/106122
            * config/i386/i386.md (peephole2): Avoid generating pop %esp
            when optimizing for size.

    gcc/testsuite/ChangeLog
            PR target/106122
            * gcc.target/i386/pr106122.c: New test case.

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

* [Bug target/106122] [12/13 Regression] ICE in fixup_args_size_notes,  at expr.cc:4493 since r12-6106-gef26c151c14a8717
  2022-06-28 17:06 [Bug c/106122] New: [12/13 Regression] ICE in fixup_args_size_notes, at expr.cc:4493 gscfq@t-online.de
                   ` (4 preceding siblings ...)
  2022-07-03 13:02 ` cvs-commit at gcc dot gnu.org
@ 2022-07-03 13:23 ` roger at nextmovesoftware dot com
  5 siblings, 0 replies; 7+ messages in thread
From: roger at nextmovesoftware dot com @ 2022-07-03 13:23 UTC (permalink / raw)
  To: gcc-bugs

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

Roger Sayle <roger at nextmovesoftware dot com> changed:

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

--- Comment #5 from Roger Sayle <roger at nextmovesoftware dot com> ---
This should now be fixed on both mainline and the gcc12 release branch.

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

end of thread, other threads:[~2022-07-03 13:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-28 17:06 [Bug c/106122] New: [12/13 Regression] ICE in fixup_args_size_notes, at expr.cc:4493 gscfq@t-online.de
2022-06-29  9:44 ` [Bug target/106122] " rguenth at gcc dot gnu.org
2022-06-29 12:05 ` [Bug target/106122] [12/13 Regression] ICE in fixup_args_size_notes, at expr.cc:4493 since r12-6106-gef26c151c14a8717 marxin at gcc dot gnu.org
2022-06-29 13:03 ` roger at nextmovesoftware dot com
2022-07-01  8:20 ` cvs-commit at gcc dot gnu.org
2022-07-03 13:02 ` cvs-commit at gcc dot gnu.org
2022-07-03 13:23 ` roger at nextmovesoftware 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).