public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "zhan3299 at purdue dot edu" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/98991] New: ICE: Max. number of generated reload insns per insn is achieved (90)
Date: Sun, 07 Feb 2021 23:00:23 +0000	[thread overview]
Message-ID: <bug-98991-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 98991
           Summary: ICE: Max. number of generated reload insns per insn is
                    achieved (90)
           Product: gcc
           Version: 10.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zhan3299 at purdue dot edu
  Target Milestone: ---

Created attachment 50140
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50140&action=edit
poc.cc

Hi all,

I am not sure whether it is indeed an ICE, so I do apologize in advance for any
possible inconvenience. 

I have a file generated by my little toy fuzzer, named poc.cc.

When I compile it with: "g++ poc.cc -fpermissive", I got an "internal compiler
error: Max. number of generated reload insns per insn is achieved (90)".

Followings are the detailed information.

--- poc.cc starts ---
namespace{thread_local;__attribute((e()))n(){int;long;float
f;__attribute(())((((__builtin_constant_p(0)))==0));try{}catch(int){}sizeof(reinterpret_cast<int>(0));asm("":"=rmf"(f),"=d"([t(reinterpret_cast<int>(0))]{}):"0"(((0))),""((0)));static_assert(1);__attribute(())class{}t;{__builtin_unreachable;int{reinterpret_cast<int>(0)};(&f);}}y(){float;}}short;namespace{int;template<typename>f(){}}struct
s;
--- poc.cc ends ---


--- md5 of poc.cc starts ---
c11f34bb78474a2a8bdcb5c5de6d19a2 
--- md5 of poc.cc ends ---


--- error trace starts ---
$ ./xg++ poc.cc -fpermissive

poc.cc:1:11: warning: declaration does not declare anything [-fpermissive]
    1 | namespace{thread_local;__attribute((e()))n(){int;long;float
f;__attribute(())((((__builtin_constant_p(0)))==0));try{}catch(int){}sizeof(reinterpret_cast<int>(0));asm("":"=rmf"(f),"=d"([t(reinterpret_cast<int>(0))]{}):"0"(((0))),""((0)));static_assert(1);__attribute(())class{}t;{__builtin_unreachable;int{reinterpret_cast<int>(0)};(&f);}}y(){float;}}short;namespace{int;template<typename>f(){}}struct
s;
      |           ^~~~~~~~~~~~
poc.cc:1:42: warning: ISO C++ forbids declaration of ‘n’ with no type
[-fpermissive]
    1 | namespace{thread_local;__attribute((e()))n(){int;long;float
f;__attribute(())((((__builtin_constant_p(0)))==0));try{}catch(int){}sizeof(reinterpret_cast<int>(0));asm("":"=rmf"(f),"=d"([t(reinterpret_cast<int>(0))]{}):"0"(((0))),""((0)));static_assert(1);__attribute(())class{}t;{__builtin_unreachable;int{reinterpret_cast<int>(0)};(&f);}}y(){float;}}short;namespace{int;template<typename>f(){}}struct
s;
      |                                          ^
poc.cc:1:44: warning: ‘e’ attribute directive ignored [-Wattributes]
    1 | namespace{thread_local;__attribute((e()))n(){int;long;float
f;__attribute(())((((__builtin_constant_p(0)))==0));try{}catch(int){}sizeof(reinterpret_cast<int>(0));asm("":"=rmf"(f),"=d"([t(reinterpret_cast<int>(0))]{}):"0"(((0))),""((0)));static_assert(1);__attribute(())class{}t;{__builtin_unreachable;int{reinterpret_cast<int>(0)};(&f);}}y(){float;}}short;namespace{int;template<typename>f(){}}struct
s;
      |                                            ^
poc.cc: In function ‘int {anonymous}::n()’:
poc.cc:1:46: warning: declaration does not declare anything [-fpermissive]
    1 | namespace{thread_local;__attribute((e()))n(){int;long;float
f;__attribute(())((((__builtin_constant_p(0)))==0));try{}catch(int){}sizeof(reinterpret_cast<int>(0));asm("":"=rmf"(f),"=d"([t(reinterpret_cast<int>(0))]{}):"0"(((0))),""((0)));static_assert(1);__attribute(())class{}t;{__builtin_unreachable;int{reinterpret_cast<int>(0)};(&f);}}y(){float;}}short;namespace{int;template<typename>f(){}}struct
s;
      |                                              ^~~
poc.cc:1:50: warning: declaration does not declare anything [-fpermissive]
    1 | namespace{thread_local;__attribute((e()))n(){int;long;float
f;__attribute(())((((__builtin_constant_p(0)))==0));try{}catch(int){}sizeof(reinterpret_cast<int>(0));asm("":"=rmf"(f),"=d"([t(reinterpret_cast<int>(0))]{}):"0"(((0))),""((0)));static_assert(1);__attribute(())class{}t;{__builtin_unreachable;int{reinterpret_cast<int>(0)};(&f);}}y(){float;}}short;namespace{int;template<typename>f(){}}struct
s;
      |                                                  ^~~~
poc.cc:1:237: warning: using rvalue as lvalue [-fpermissive]
    1 | ocal;__attribute((e()))n(){int;long;float
f;__attribute(())((((__builtin_constant_p(0)))==0));try{}catch(int){}sizeof(reinterpret_cast<int>(0));asm("":"=rmf"(f),"=d"([t(reinterpret_cast<int>(0))]{}):"0"(((0))),""((0)));static_assert(1);__attribute(())class{}t;{__builtin_unreachable;int{reinterpret_cast<int>(0)};(&f);}}y(){float;}}short;namespace{int;template<typename>f(){}}struct
s;
      |                                                                        
                                                                               
                                                                  ^

poc.cc:1:338: warning: no return statement in function returning non-void
[-Wreturn-type]
    1 |
tch(int){}sizeof(reinterpret_cast<int>(0));asm("":"=rmf"(f),"=d"([t(reinterpret_cast<int>(0))]{}):"0"(((0))),""((0)));static_assert(1);__attribute(())class{}t;{__builtin_unreachable;int{reinterpret_cast<int>(0)};(&f);}}y(){float;}}short;namespace{int;template<typename>f(){}}struct
s;
      |                                                                        
                                                                               
                                                                  ^

poc.cc: At global scope:
poc.cc:1:339: warning: ISO C++ forbids declaration of ‘y’ with no type
[-fpermissive]
    1 |
ch(int){}sizeof(reinterpret_cast<int>(0));asm("":"=rmf"(f),"=d"([t(reinterpret_cast<int>(0))]{}):"0"(((0))),""((0)));static_assert(1);__attribute(())class{}t;{__builtin_unreachable;int{reinterpret_cast<int>(0)};(&f);}}y(){float;}}short;namespace{int;template<typename>f(){}}struct
s;
      |                                                                        
                                                                               
                                                                  ^

poc.cc: In function ‘int {anonymous}::y()’:
poc.cc:1:343: warning: declaration does not declare anything [-fpermissive]
    1 |
nt){}sizeof(reinterpret_cast<int>(0));asm("":"=rmf"(f),"=d"([t(reinterpret_cast<int>(0))]{}):"0"(((0))),""((0)));static_assert(1);__attribute(())class{}t;{__builtin_unreachable;int{reinterpret_cast<int>(0)};(&f);}}y(){float;}}short;namespace{int;template<typename>f(){}}struct
s;
      |                                                                        
                                                                               
                                                                  ^~~~~

poc.cc:1:349: warning: no return statement in function returning non-void
[-Wreturn-type]
    1 |
izeof(reinterpret_cast<int>(0));asm("":"=rmf"(f),"=d"([t(reinterpret_cast<int>(0))]{}):"0"(((0))),""((0)));static_assert(1);__attribute(())class{}t;{__builtin_unreachable;int{reinterpret_cast<int>(0)};(&f);}}y(){float;}}short;namespace{int;template<typename>f(){}}struct
s;
      |                                                                        
                                                                               
                                                                  ^

poc.cc: At global scope:
poc.cc:1:351: warning: declaration does not declare anything [-fpermissive]
    1 |
eof(reinterpret_cast<int>(0));asm("":"=rmf"(f),"=d"([t(reinterpret_cast<int>(0))]{}):"0"(((0))),""((0)));static_assert(1);__attribute(())class{}t;{__builtin_unreachable;int{reinterpret_cast<int>(0)};(&f);}}y(){float;}}short;namespace{int;template<typename>f(){}}struct
s;
      |                                                                        
                                                                               
                                                                  ^~~~~

poc.cc:1:367: warning: declaration does not declare anything [-fpermissive]
    1 |
cast<int>(0));asm("":"=rmf"(f),"=d"([t(reinterpret_cast<int>(0))]{}):"0"(((0))),""((0)));static_assert(1);__attribute(())class{}t;{__builtin_unreachable;int{reinterpret_cast<int>(0)};(&f);}}y(){float;}}short;namespace{int;template<typename>f(){}}struct
s;
      |                                                                        
                                                                               
                                                                  ^~~

poc.cc:1:389: warning: ISO C++ forbids declaration of ‘f’ with no type
[-fpermissive]
    1 |
=rmf"(f),"=d"([t(reinterpret_cast<int>(0))]{}):"0"(((0))),""((0)));static_assert(1);__attribute(())class{}t;{__builtin_unreachable;int{reinterpret_cast<int>(0)};(&f);}}y(){float;}}short;namespace{int;template<typename>f(){}}struct
s;
      |                                                                        
                                                                               
                                                                  ^

poc.cc: In function ‘int {anonymous}::f()’:
poc.cc:1:393: warning: no return statement in function returning non-void
[-Wreturn-type]
    1 |
"(f),"=d"([t(reinterpret_cast<int>(0))]{}):"0"(((0))),""((0)));static_assert(1);__attribute(())class{}t;{__builtin_unreachable;int{reinterpret_cast<int>(0)};(&f);}}y(){float;}}short;namespace{int;template<typename>f(){}}struct
s;
      |                                                                        
                                                                               
                                                                  ^

during RTL pass: reload
poc.cc: In function ‘int {anonymous}::n()’:
poc.cc:1:338: internal compiler error: maximum number of generated reload insns
per insn achieved (90)
    1 |
tch(int){}sizeof(reinterpret_cast<int>(0));asm("":"=rmf"(f),"=d"([t(reinterpret_cast<int>(0))]{}):"0"(((0))),""((0)));static_assert(1);__attribute(())class{}t;{__builtin_unreachable;int{reinterpret_cast<int>(0)};(&f);}}y(){float;}}short;namespace{int;template<typename>f(){}}struct
s;
      |                                                                        
                                                                               
                                                                  ^

0xb37790 lra_constraints(bool)
        ../../gcc/gcc/lra-constraints.c:4952
0xb259e4 lra(_IO_FILE*)
        ../../gcc/gcc/lra.c:2440
0xae38d1 do_reload
        ../../gcc/gcc/ira.c:5523
0xae38d1 execute
        ../../gcc/gcc/ira.c:5709
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.
--- error trace ends ---

             reply	other threads:[~2021-02-07 23:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-07 23:00 zhan3299 at purdue dot edu [this message]
2021-02-08  9:06 ` [Bug c++/98991] " marxin at gcc dot gnu.org
2021-02-08  9:34 ` [Bug inline-asm/98991] " rguenth at gcc dot gnu.org
2021-02-08 15:31 ` zhan3299 at purdue dot edu
2021-02-08 15:36 ` zhan3299 at purdue dot edu
2021-09-14  7:34 ` [Bug target/98991] " pinskia at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-98991-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).