public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/108673] New: ICE with -fstack-clash-protection and noreturn attribute on x86_64-w64-mingw32
@ 2023-02-04 13:03 lh_mouse at 126 dot com
  2023-02-04 15:49 ` [Bug target/108673] " franke at computer dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: lh_mouse at 126 dot com @ 2023-02-04 13:03 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 108673
           Summary: ICE with -fstack-clash-protection and noreturn
                    attribute on x86_64-w64-mingw32
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: lh_mouse at 126 dot com
  Target Milestone: ---

Original reported by Théo Cavignac here:
https://sourceforge.net/p/mingw-w64/mailman/message/37773946/

The ICE is only reproducible on x86_64-w64-mingw32, not on i686-w64-mingw32.
Original testcase follows:

```
/*
   /usr/bin/x86_64-w64-mingw32-gcc \
     -O2 -fstack-clash-protection -c \
     -freport-bug \
     -o f.o f.c
  */
void exit(int) __attribute__((noreturn));

void foo(int p) {
   exit(p);
}
```

```
# gcc -O2 -fstack-clash-protection f.c
during RTL pass: final
f.c: In function 'foo':
f.c:11:4: internal compiler error: in seh_emit_stackalloc, at
config/i386/winnt.cc:1055
   11 |    }
      |    ^
libbacktrace could not find executable to open
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
See <https://github.com/lhmouse/MINGW-packages/issues> for instructions.
```

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

* [Bug target/108673] ICE with -fstack-clash-protection and noreturn attribute on x86_64-w64-mingw32
  2023-02-04 13:03 [Bug target/108673] New: ICE with -fstack-clash-protection and noreturn attribute on x86_64-w64-mingw32 lh_mouse at 126 dot com
@ 2023-02-04 15:49 ` franke at computer dot org
  2023-02-04 20:22 ` pinskia at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: franke at computer dot org @ 2023-02-04 15:49 UTC (permalink / raw)
  To: gcc-bugs

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

Christian Franke <franke at computer dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |franke at computer dot org

--- Comment #1 from Christian Franke <franke at computer dot org> ---
Could also be reproduced with x86_64-pc-cygwin-gcc 11.3.0 and
x86_64-w64-mingw32-gcc 11.3.0 from current Cygwin distribution:

$ gcc -O1 -fstack-clash-protection -S f.c
during RTL pass: final
x.c: In function ‘foo’:
x.c:5:1: internal compiler error: in seh_emit_stackalloc, at
config/i386/winnt.c:1056
    5 | }
      | ^
...


The error does not occur if -fipa-pure-const ("Discover which functions are
pure or constant") is disabled:

$ gcc -O3 -fno-ipa-pure-const -fstack-clash-protection -S f.c; echo $?
0

Assembly output looks sane then.

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

* [Bug target/108673] ICE with -fstack-clash-protection and noreturn attribute on x86_64-w64-mingw32
  2023-02-04 13:03 [Bug target/108673] New: ICE with -fstack-clash-protection and noreturn attribute on x86_64-w64-mingw32 lh_mouse at 126 dot com
  2023-02-04 15:49 ` [Bug target/108673] " franke at computer dot org
@ 2023-02-04 20:22 ` pinskia at gcc dot gnu.org
  2023-02-14 17:12 ` amy.mclaughlin at iar dot com
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-02-04 20:22 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |DUPLICATE
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Dup of bug 90458.

*** This bug has been marked as a duplicate of bug 90458 ***

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

* [Bug target/108673] ICE with -fstack-clash-protection and noreturn attribute on x86_64-w64-mingw32
  2023-02-04 13:03 [Bug target/108673] New: ICE with -fstack-clash-protection and noreturn attribute on x86_64-w64-mingw32 lh_mouse at 126 dot com
  2023-02-04 15:49 ` [Bug target/108673] " franke at computer dot org
  2023-02-04 20:22 ` pinskia at gcc dot gnu.org
@ 2023-02-14 17:12 ` amy.mclaughlin at iar dot com
  2023-02-14 18:01 ` franke at computer dot org
  2023-02-14 18:11 ` ebotcazou at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: amy.mclaughlin at iar dot com @ 2023-02-14 17:12 UTC (permalink / raw)
  To: gcc-bugs

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

amy.mclaughlin at iar dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |amy.mclaughlin at iar dot com

--- Comment #3 from amy.mclaughlin at iar dot com ---
Regarding Comment 1, the bug in Cygwin's gcc (11.3.0) can't be worked around
with `-fno-ipa-pure-const`. The workaround also fails for the msys2 msys build
of gcc (also 11.3.0) but succeeds for the mingw64 build.

So I suspect that the bug reproduced with x86_64-pc-cygwin-gcc may not be the
same bug as the one in this report, despite the similar symptoms.

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

* [Bug target/108673] ICE with -fstack-clash-protection and noreturn attribute on x86_64-w64-mingw32
  2023-02-04 13:03 [Bug target/108673] New: ICE with -fstack-clash-protection and noreturn attribute on x86_64-w64-mingw32 lh_mouse at 126 dot com
                   ` (2 preceding siblings ...)
  2023-02-14 17:12 ` amy.mclaughlin at iar dot com
@ 2023-02-14 18:01 ` franke at computer dot org
  2023-02-14 18:11 ` ebotcazou at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: franke at computer dot org @ 2023-02-14 18:01 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Christian Franke <franke at computer dot org> ---
I get similar results with x86_64-pc-cygwin-gcc (aka gcc) 11.3.0 and
x86_64-w64-mingw32-gcc 11.3.0, both from current Cygwin distro and with
x86_64-w64-mingw32-gcc (aka gcc) 12.2.0 from current MSYS2 distro.

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

* [Bug target/108673] ICE with -fstack-clash-protection and noreturn attribute on x86_64-w64-mingw32
  2023-02-04 13:03 [Bug target/108673] New: ICE with -fstack-clash-protection and noreturn attribute on x86_64-w64-mingw32 lh_mouse at 126 dot com
                   ` (3 preceding siblings ...)
  2023-02-14 18:01 ` franke at computer dot org
@ 2023-02-14 18:11 ` ebotcazou at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2023-02-14 18:11 UTC (permalink / raw)
  To: gcc-bugs

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

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ebotcazou at gcc dot gnu.org

--- Comment #5 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
-fstack-clash-protection must simply not be used on Windows, as Windows has had
builtin stack clash protection since the beginning.

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

end of thread, other threads:[~2023-02-14 18:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-04 13:03 [Bug target/108673] New: ICE with -fstack-clash-protection and noreturn attribute on x86_64-w64-mingw32 lh_mouse at 126 dot com
2023-02-04 15:49 ` [Bug target/108673] " franke at computer dot org
2023-02-04 20:22 ` pinskia at gcc dot gnu.org
2023-02-14 17:12 ` amy.mclaughlin at iar dot com
2023-02-14 18:01 ` franke at computer dot org
2023-02-14 18:11 ` ebotcazou 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).