public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libitm/105710] New: libitm/alloc_c.cc:40:1: internal compiler error: in extract_insn, at recog.c:2770
@ 2022-05-24  2:30 vital.had at gmail dot com
  2022-05-24  2:35 ` [Bug target/105710] " pinskia at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: vital.had at gmail dot com @ 2022-05-24  2:30 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 105710
           Summary: libitm/alloc_c.cc:40:1: internal compiler error: in
                    extract_insn, at recog.c:2770
           Product: gcc
           Version: 11.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libitm
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vital.had at gmail dot com
                CC: iains at gcc dot gnu.org
  Target Milestone: ---
            Target: powerpc-apple-darwin

Created attachment 53026
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53026&action=edit
ii file produced with -v -save-temps

I have tried to rebuild gcc11 @11.3.0 with TLS enabled on 10.6 PPC, and it
failed in stage 3 on libitm:

checking for freelocale...
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_gcc11/gcc11/work/gcc-11.3.0/libitm/alloc_c.cc:
In function 'void* _ITM_malloc(size_t)':
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_gcc11/gcc11/work/gcc-11.3.0/libitm/alloc_c.cc:40:1:
error: unrecognizable insn:
   40 | }
      | ^
(insn 23 22 24 4 (set (reg:SI 3 r3)
        (unspec:SI [
                (symbol_ref:SI ("_ZN3GTM12_gtm_thr_tlsE") [flags 0x1252]
<var_decl 0x1c66054 _gtm_thr_tls>)
                (reg:SI 126)
            ] UNSPEC_TLSGD))
"/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_gcc11/gcc11/work/gcc-11.3.0/libitm/config/generic/tls.h":52:59
-1
     (nil))
during RTL pass: vregs
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_gcc11/gcc11/work/gcc-11.3.0/libitm/alloc_c.cc:40:1:
internal compiler error: in extract_insn, at recog.c:2770
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://trac.macports.org/newticket> for instructions.
make[4]: *** [alloc_c.lo] Error 1
make[4]: *** Waiting for unfinished jobs....
yes
mv -f .deps/alloc.Tpo .deps/alloc.Plo
checking for uselocale... mv -f .deps/aatree.Tpo .deps/aatree.Plo
make[4]: Leaving directory
`/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_gcc11/gcc11/work/build/ppc-apple-darwin10/libitm'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory
`/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_gcc11/gcc11/work/build/ppc-apple-darwin10/libitm'
make[2]: *** [all] Error 2
make[2]: Leaving directory
`/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_gcc11/gcc11/work/build/ppc-apple-darwin10/libitm'
make[1]: *** [all-target-libitm] Error 2

P. S. Yes, this is a non-standard OS version, but the same version of gcc11
built just fine with TLS disabled on it.

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

* [Bug target/105710] libitm/alloc_c.cc:40:1: internal compiler error: in extract_insn, at recog.c:2770
  2022-05-24  2:30 [Bug libitm/105710] New: libitm/alloc_c.cc:40:1: internal compiler error: in extract_insn, at recog.c:2770 vital.had at gmail dot com
@ 2022-05-24  2:35 ` pinskia at gcc dot gnu.org
  2022-05-24  2:39 ` [Bug target/105710] ICE on powerpc darwin with TLS enabled vital.had at gmail dot com
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-05-24  2:35 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
>TLS enabled

TLS support for powerpc darwin was never added.

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

* [Bug target/105710] ICE on powerpc darwin with TLS enabled
  2022-05-24  2:30 [Bug libitm/105710] New: libitm/alloc_c.cc:40:1: internal compiler error: in extract_insn, at recog.c:2770 vital.had at gmail dot com
  2022-05-24  2:35 ` [Bug target/105710] " pinskia at gcc dot gnu.org
@ 2022-05-24  2:39 ` vital.had at gmail dot com
  2022-05-24  2:40 ` pinskia at gcc dot gnu.org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: vital.had at gmail dot com @ 2022-05-24  2:39 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Sergey Fedorov <vital.had at gmail dot com> ---
(In reply to Andrew Pinski from comment #1)
> >TLS enabled
> 
> TLS support for powerpc darwin was never added.

Iain writes that emulated TLS is supported on all Darwin versions starting from
10.5:
https://github.com/ruby/ruby/pull/5927?notification_referrer_id=NT_kwDOBXwLlrMzNjYyMzQ0NjYzOjkyMDE1NTEw#issuecomment-1133843490

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

* [Bug target/105710] ICE on powerpc darwin with TLS enabled
  2022-05-24  2:30 [Bug libitm/105710] New: libitm/alloc_c.cc:40:1: internal compiler error: in extract_insn, at recog.c:2770 vital.had at gmail dot com
  2022-05-24  2:35 ` [Bug target/105710] " pinskia at gcc dot gnu.org
  2022-05-24  2:39 ` [Bug target/105710] ICE on powerpc darwin with TLS enabled vital.had at gmail dot com
@ 2022-05-24  2:40 ` pinskia at gcc dot gnu.org
  2022-05-24  3:24 ` vital.had at gmail dot com
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-05-24  2:40 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Sergey Fedorov from comment #2)
> (In reply to Andrew Pinski from comment #1)
> > >TLS enabled
> > 
> > TLS support for powerpc darwin was never added.
> 
> Iain writes that emulated TLS is supported on all Darwin versions starting
> from 10.5:
> https://github.com/ruby/ruby/pull/
> 5927?notification_referrer_id=NT_kwDOBXwLlrMzNjYyMzQ0NjYzOjkyMDE1NTEw#issueco
> mment-1133843490

That is enabled by default though --enable-tls tries to enable native TLS
support.

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

* [Bug target/105710] ICE on powerpc darwin with TLS enabled
  2022-05-24  2:30 [Bug libitm/105710] New: libitm/alloc_c.cc:40:1: internal compiler error: in extract_insn, at recog.c:2770 vital.had at gmail dot com
                   ` (2 preceding siblings ...)
  2022-05-24  2:40 ` pinskia at gcc dot gnu.org
@ 2022-05-24  3:24 ` vital.had at gmail dot com
  2022-05-24  6:31 ` iains at gcc dot gnu.org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: vital.had at gmail dot com @ 2022-05-24  3:24 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Sergey Fedorov <vital.had at gmail dot com> ---
(In reply to Andrew Pinski from comment #3)
> (In reply to Sergey Fedorov from comment #2)
> > (In reply to Andrew Pinski from comment #1)
> > > >TLS enabled
> > > 
> > > TLS support for powerpc darwin was never added.
> > 
> > Iain writes that emulated TLS is supported on all Darwin versions starting
> > from 10.5:
> > https://github.com/ruby/ruby/pull/
> > 5927?notification_referrer_id=NT_kwDOBXwLlrMzNjYyMzQ0NjYzOjkyMDE1NTEw#issueco
> > mment-1133843490
> 
> That is enabled by default though --enable-tls tries to enable native TLS
> support.

>From what I understand, native TLS does not exist with gcc, at least for
Darwin.

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

* [Bug target/105710] ICE on powerpc darwin with TLS enabled
  2022-05-24  2:30 [Bug libitm/105710] New: libitm/alloc_c.cc:40:1: internal compiler error: in extract_insn, at recog.c:2770 vital.had at gmail dot com
                   ` (3 preceding siblings ...)
  2022-05-24  3:24 ` vital.had at gmail dot com
@ 2022-05-24  6:31 ` iains at gcc dot gnu.org
  2022-05-24  7:27 ` vital.had at gmail dot com
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: iains at gcc dot gnu.org @ 2022-05-24  6:31 UTC (permalink / raw)
  To: gcc-bugs

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

Iain Sandoe <iains at gcc dot gnu.org> changed:

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

--- Comment #5 from Iain Sandoe <iains at gcc dot gnu.org> ---
(In reply to Sergey Fedorov from comment #4)
> (In reply to Andrew Pinski from comment #3)
> > (In reply to Sergey Fedorov from comment #2)
> > > (In reply to Andrew Pinski from comment #1)
> > > > >TLS enabled
> > > > 
> > > > TLS support for powerpc darwin was never added.
> > > 
> > > Iain writes that emulated TLS is supported on all Darwin versions starting
> > > from 10.5:
> > > https://github.com/ruby/ruby/pull/
> > > 5927?notification_referrer_id=NT_kwDOBXwLlrMzNjYyMzQ0NjYzOjkyMDE1NTEw#issueco
> > > mment-1133843490
> > 
> > That is enabled by default though --enable-tls tries to enable native TLS
> > support.
> 
> From what I understand, native TLS does not exist with gcc, at least for
> Darwin.

Correct (even if it did exist it would only be for 10.7+) so --enable-tls is a
configuration error.

(as I have said several times, the idea of configure is to choose the correct
settings for the target _automatically_ - extra config options should only be
added if there is a very good reason and you know exactly what they do).

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

* [Bug target/105710] ICE on powerpc darwin with TLS enabled
  2022-05-24  2:30 [Bug libitm/105710] New: libitm/alloc_c.cc:40:1: internal compiler error: in extract_insn, at recog.c:2770 vital.had at gmail dot com
                   ` (4 preceding siblings ...)
  2022-05-24  6:31 ` iains at gcc dot gnu.org
@ 2022-05-24  7:27 ` vital.had at gmail dot com
  2022-05-24 13:51 ` egallager at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: vital.had at gmail dot com @ 2022-05-24  7:27 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Sergey Fedorov <vital.had at gmail dot com> ---

> Correct (even if it did exist it would only be for 10.7+) so --enable-tls is
> a configuration error.
> 
> (as I have said several times, the idea of configure is to choose the
> correct settings for the target _automatically_ - extra config options
> should only be added if there is a very good reason and you know exactly
> what they do).

Got it, thank you!

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

* [Bug target/105710] ICE on powerpc darwin with TLS enabled
  2022-05-24  2:30 [Bug libitm/105710] New: libitm/alloc_c.cc:40:1: internal compiler error: in extract_insn, at recog.c:2770 vital.had at gmail dot com
                   ` (5 preceding siblings ...)
  2022-05-24  7:27 ` vital.had at gmail dot com
@ 2022-05-24 13:51 ` egallager at gcc dot gnu.org
  2022-05-24 14:01 ` iains at gcc dot gnu.org
  2022-05-24 14:14 ` vital.had at gmail dot com
  8 siblings, 0 replies; 10+ messages in thread
From: egallager at gcc dot gnu.org @ 2022-05-24 13:51 UTC (permalink / raw)
  To: gcc-bugs

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

Eric Gallager <egallager at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |egallager at gcc dot gnu.org
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=52268,
                   |                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=53504

--- Comment #7 from Eric Gallager <egallager at gcc dot gnu.org> ---
(In reply to Sergey Fedorov from comment #4)
> (In reply to Andrew Pinski from comment #3)
> > (In reply to Sergey Fedorov from comment #2)
> > > (In reply to Andrew Pinski from comment #1)
> > > > >TLS enabled
> > > > 
> > > > TLS support for powerpc darwin was never added.
> > > 
> > > Iain writes that emulated TLS is supported on all Darwin versions starting
> > > from 10.5:
> > > https://github.com/ruby/ruby/pull/5927?notification_referrer_id=NT_kwDOBXwLlrMzNjYyMzQ0NjYzOjkyMDE1NTEw#issuecomment-1133843490
> > 
> > That is enabled by default though --enable-tls tries to enable native TLS
> > support.
> 
> From what I understand, native TLS does not exist with gcc, at least for
> Darwin.

That's bug 52268, for reference.

(In reply to Iain Sandoe from comment #5)
> Correct (even if it did exist it would only be for 10.7+) so --enable-tls is
> a configuration error.
> 
> (as I have said several times, the idea of configure is to choose the
> correct settings for the target _automatically_ - extra config options
> should only be added if there is a very good reason and you know exactly
> what they do).

Well we could at least make the error happen earlier rather than letting it
turn into an ICE. I think making the configure script smarter about whether TLS
works or not could be worthwhile; see bug 53504

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

* [Bug target/105710] ICE on powerpc darwin with TLS enabled
  2022-05-24  2:30 [Bug libitm/105710] New: libitm/alloc_c.cc:40:1: internal compiler error: in extract_insn, at recog.c:2770 vital.had at gmail dot com
                   ` (6 preceding siblings ...)
  2022-05-24 13:51 ` egallager at gcc dot gnu.org
@ 2022-05-24 14:01 ` iains at gcc dot gnu.org
  2022-05-24 14:14 ` vital.had at gmail dot com
  8 siblings, 0 replies; 10+ messages in thread
From: iains at gcc dot gnu.org @ 2022-05-24 14:01 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Iain Sandoe <iains at gcc dot gnu.org> ---
(In reply to Eric Gallager from comment #7)


> > (as I have said several times, the idea of configure is to choose the
> > correct settings for the target _automatically_ - extra config options
> > should only be added if there is a very good reason and you know exactly
> > what they do).
> 
> Well we could at least make the error happen earlier rather than letting it
> turn into an ICE. I think making the configure script smarter about whether
> TLS works or not could be worthwhile; see bug 53504

If we try to do this for every irrelevant configure option, that's going to
be quite a lot of work.

Really [IMO, at least], configure options are not intended for end-users 
- the goal for end users is that:

 configure --prefix=xxxxxx && make && install

should 'just work' (OK, we don't quite achieve that, but actually we're quite
close)

adding out-of-band configure options is for distributions and expert use
(we assume distributions are expert in the options they need to apply to 
customise the install).

However, of course, if you want to write patches to respond to all the options
that Darwin does not need, I'm happy to review :)

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

* [Bug target/105710] ICE on powerpc darwin with TLS enabled
  2022-05-24  2:30 [Bug libitm/105710] New: libitm/alloc_c.cc:40:1: internal compiler error: in extract_insn, at recog.c:2770 vital.had at gmail dot com
                   ` (7 preceding siblings ...)
  2022-05-24 14:01 ` iains at gcc dot gnu.org
@ 2022-05-24 14:14 ` vital.had at gmail dot com
  8 siblings, 0 replies; 10+ messages in thread
From: vital.had at gmail dot com @ 2022-05-24 14:14 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Sergey Fedorov <vital.had at gmail dot com> ---
(In reply to Iain Sandoe from comment #8)
> If we try to do this for every irrelevant configure option, that's going to
> be quite a lot of work.
> 
> Really [IMO, at least], configure options are not intended for end-users 
> - the goal for end users is that:
> 
>  configure --prefix=xxxxxx && make && install
> 
> should 'just work' (OK, we don't quite achieve that, but actually we're
> quite close)
> 
> adding out-of-band configure options is for distributions and expert use
> (we assume distributions are expert in the options they need to apply to 
> customise the install).
> 
> However, of course, if you want to write patches to respond to all the
> options
> that Darwin does not need, I'm happy to review :)

I agree with Iain here, in fact it is a problem with Macports, since it’s
`--disable-tls` option lists a reason totally unrelated to PPC or Darwin
version:

># see https://lists.macports.org/pipermail/macports-dev/2017-August/036209.html
># --disable-tls does not limit functionality
># it only determines how std::call_once works
>configure.args-append \
>                    --disable-tls

Then it was me who misunderstood Iain’s reply in my PR to Ruby. I thought that
Macports disables TLS for no clear reason, while Ruby wants it provided by the
compiler, and tried to build it with `--enable-tls`.
Sorry for a confusion. I just had an impression that all ICEs have to be
reported.

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

end of thread, other threads:[~2022-05-24 14:14 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-24  2:30 [Bug libitm/105710] New: libitm/alloc_c.cc:40:1: internal compiler error: in extract_insn, at recog.c:2770 vital.had at gmail dot com
2022-05-24  2:35 ` [Bug target/105710] " pinskia at gcc dot gnu.org
2022-05-24  2:39 ` [Bug target/105710] ICE on powerpc darwin with TLS enabled vital.had at gmail dot com
2022-05-24  2:40 ` pinskia at gcc dot gnu.org
2022-05-24  3:24 ` vital.had at gmail dot com
2022-05-24  6:31 ` iains at gcc dot gnu.org
2022-05-24  7:27 ` vital.had at gmail dot com
2022-05-24 13:51 ` egallager at gcc dot gnu.org
2022-05-24 14:01 ` iains at gcc dot gnu.org
2022-05-24 14:14 ` vital.had 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).