public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/100840] New: ICE with -O1: in replace_reg, at reg-stack.c:714
@ 2021-05-31  6:02 cnsun at uwaterloo dot ca
  2021-05-31  6:10 ` [Bug target/100840] " pinskia at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: cnsun at uwaterloo dot ca @ 2021-05-31  6:02 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 100840
           Summary: ICE with -O1: in replace_reg, at reg-stack.c:714
           Product: gcc
           Version: tree-ssa
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: cnsun at uwaterloo dot ca
  Target Milestone: ---

$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/scratch/software/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/12.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /tmp/tmp.zS0RT0UjCW-gcc-builder/gcc/configure
--enable-languages=c,c++,lto --enable-checking-yes --enable-multiarch
--prefix=/scratch/software/gcc-trunk --disable-bootstrap
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 12.0.0 20210531 (experimental) [master revision
:e6428eb51:e21e93407202e62a10c372595076c593c561bb11] (GCC)

$ cat mutant.c
main() {
  long double res;
  asm("lxr\t%0,%1\n" : "=&f"(res));
  assert(res == 42.);
}

$ gcc-trunk -O1 mutant.c
mutant.c:1:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
    1 | main() {
      | ^~~~
mutant.c: In function ‘main’:
mutant.c:4:3: warning: implicit declaration of function ‘assert’
[-Wimplicit-function-declaration]
    4 |   assert(res == 42.);
      |   ^~~~~~
mutant.c:1:1: note: ‘assert’ is defined in header ‘<assert.h>’; did you forget
to ‘#include <assert.h>’?
  +++ |+#include <assert.h>
    1 | main() {
mutant.c:3:3: error: output constraint 0 must specify a single register
    3 |   asm("lxr\t%0,%1\n" : "=&f"(res));
      |   ^~~
during RTL pass: stack
mutant.c:5:1: internal compiler error: in replace_reg, at reg-stack.c:714
    5 | }
      | ^
0x72f5c6 replace_reg
        /tmp/tmp.zS0RT0UjCW-gcc-builder/gcc/gcc/reg-stack.c:714
0x72f5c6 replace_reg
        /tmp/tmp.zS0RT0UjCW-gcc-builder/gcc/gcc/reg-stack.c:712
0xe6b272 compare_for_stack_reg
        /tmp/tmp.zS0RT0UjCW-gcc-builder/gcc/gcc/reg-stack.c:1379
0xe6b272 subst_stack_regs_pat
        /tmp/tmp.zS0RT0UjCW-gcc-builder/gcc/gcc/reg-stack.c:1998
0xe6bb0a subst_stack_regs
        /tmp/tmp.zS0RT0UjCW-gcc-builder/gcc/gcc/reg-stack.c:2441
0xe6c4ec convert_regs_1
        /tmp/tmp.zS0RT0UjCW-gcc-builder/gcc/gcc/reg-stack.c:3077
0xe6c4ec convert_regs_2
        /tmp/tmp.zS0RT0UjCW-gcc-builder/gcc/gcc/reg-stack.c:3211
0xe6d160 convert_regs
        /tmp/tmp.zS0RT0UjCW-gcc-builder/gcc/gcc/reg-stack.c:3246
0xe6d160 reg_to_stack
        /tmp/tmp.zS0RT0UjCW-gcc-builder/gcc/gcc/reg-stack.c:3371
0xe6d160 rest_of_handle_stack_regs
        /tmp/tmp.zS0RT0UjCW-gcc-builder/gcc/gcc/reg-stack.c:3426
0xe6d160 execute
        /tmp/tmp.zS0RT0UjCW-gcc-builder/gcc/gcc/reg-stack.c:3458
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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

* [Bug target/100840] ICE with -O1: in replace_reg, at reg-stack.c:714
  2021-05-31  6:02 [Bug c/100840] New: ICE with -O1: in replace_reg, at reg-stack.c:714 cnsun at uwaterloo dot ca
@ 2021-05-31  6:10 ` pinskia at gcc dot gnu.org
  2021-05-31  6:12 ` pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-05-31  6:10 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

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

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

* [Bug target/100840] ICE with -O1: in replace_reg, at reg-stack.c:714
  2021-05-31  6:02 [Bug c/100840] New: ICE with -O1: in replace_reg, at reg-stack.c:714 cnsun at uwaterloo dot ca
  2021-05-31  6:10 ` [Bug target/100840] " pinskia at gcc dot gnu.org
@ 2021-05-31  6:12 ` pinskia at gcc dot gnu.org
  2021-05-31  6:13 ` pinskia at gcc dot gnu.org
  2021-05-31 11:38 ` cnsun at uwaterloo dot ca
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-05-31  6:12 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Actually wait, it is not exactly the same bug similar.

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

* [Bug target/100840] ICE with -O1: in replace_reg, at reg-stack.c:714
  2021-05-31  6:02 [Bug c/100840] New: ICE with -O1: in replace_reg, at reg-stack.c:714 cnsun at uwaterloo dot ca
  2021-05-31  6:10 ` [Bug target/100840] " pinskia at gcc dot gnu.org
  2021-05-31  6:12 ` pinskia at gcc dot gnu.org
@ 2021-05-31  6:13 ` pinskia at gcc dot gnu.org
  2021-05-31 11:38 ` cnsun at uwaterloo dot ca
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-05-31  6:13 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Dup of bug 69899 though.

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

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

* [Bug target/100840] ICE with -O1: in replace_reg, at reg-stack.c:714
  2021-05-31  6:02 [Bug c/100840] New: ICE with -O1: in replace_reg, at reg-stack.c:714 cnsun at uwaterloo dot ca
                   ` (2 preceding siblings ...)
  2021-05-31  6:13 ` pinskia at gcc dot gnu.org
@ 2021-05-31 11:38 ` cnsun at uwaterloo dot ca
  3 siblings, 0 replies; 5+ messages in thread
From: cnsun at uwaterloo dot ca @ 2021-05-31 11:38 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Chengnian Sun <cnsun at uwaterloo dot ca> ---
Hi Andrew,

GCC does not crash on the test program in PR69899. 

For the program in this PR, GCC does not crash at -O0, but from -O1.

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

end of thread, other threads:[~2021-05-31 11:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-31  6:02 [Bug c/100840] New: ICE with -O1: in replace_reg, at reg-stack.c:714 cnsun at uwaterloo dot ca
2021-05-31  6:10 ` [Bug target/100840] " pinskia at gcc dot gnu.org
2021-05-31  6:12 ` pinskia at gcc dot gnu.org
2021-05-31  6:13 ` pinskia at gcc dot gnu.org
2021-05-31 11:38 ` cnsun at uwaterloo dot ca

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