public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/110789] New: Internal Compiler Error: Illegal instruction
@ 2023-07-24  8:47 pledr at gmx dot net
  2023-07-24  8:55 ` [Bug c/110789] " pinskia at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: pledr at gmx dot net @ 2023-07-24  8:47 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 110789
           Summary: Internal Compiler Error: Illegal instruction
           Product: gcc
           Version: og12 (devel/omp/gcc-12)
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pledr at gmx dot net
  Target Milestone: ---

Created attachment 55617
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55617&action=edit
all facts collected in 1 file

see attachment
c++ shows the same error

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

* [Bug c/110789] Internal Compiler Error: Illegal instruction
  2023-07-24  8:47 [Bug c/110789] New: Internal Compiler Error: Illegal instruction pledr at gmx dot net
@ 2023-07-24  8:55 ` pinskia at gcc dot gnu.org
  2023-07-24  8:59 ` pledr at gmx dot net
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-07-24  8:55 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2023-07-24

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
How did you configure gcc?

I suspect the issue is you compiled gcc to only run on the first machine which
has avx2 while the second one does not.

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

* [Bug c/110789] Internal Compiler Error: Illegal instruction
  2023-07-24  8:47 [Bug c/110789] New: Internal Compiler Error: Illegal instruction pledr at gmx dot net
  2023-07-24  8:55 ` [Bug c/110789] " pinskia at gcc dot gnu.org
@ 2023-07-24  8:59 ` pledr at gmx dot net
  2023-07-24  9:04 ` arsen at gcc dot gnu.org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pledr at gmx dot net @ 2023-07-24  8:59 UTC (permalink / raw)
  To: gcc-bugs

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

Peter Lezoch <pledr at gmx dot net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #55617|0                           |1
        is obsolete|                            |

--- Comment #2 from Peter Lezoch <pledr at gmx dot net> ---
Created attachment 55618
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55618&action=edit
gcc -v

bash-5.2# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/12.2.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../configure --prefix=/usr LD=ld --enable-languages=c,c++
--enable-default-pie --enable-default-ssp --enable-multilib
--with-multilib-list=m64,m32,mx32 --disable-bootstrap --with-system-zlib
--with-long-double-128
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 12.2.0 (GCC) 
bash-5.2#

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

* [Bug c/110789] Internal Compiler Error: Illegal instruction
  2023-07-24  8:47 [Bug c/110789] New: Internal Compiler Error: Illegal instruction pledr at gmx dot net
  2023-07-24  8:55 ` [Bug c/110789] " pinskia at gcc dot gnu.org
  2023-07-24  8:59 ` pledr at gmx dot net
@ 2023-07-24  9:04 ` arsen at gcc dot gnu.org
  2023-07-24 15:07 ` pledr at gmx dot net
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: arsen at gcc dot gnu.org @ 2023-07-24  9:04 UTC (permalink / raw)
  To: gcc-bugs

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

Arsen Arsenović <arsen at gcc dot gnu.org> changed:

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

--- Comment #3 from Arsen Arsenović <arsen at gcc dot gnu.org> ---
did you happen to se -march=native in CFLAGS or such when building gcc?

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

* [Bug c/110789] Internal Compiler Error: Illegal instruction
  2023-07-24  8:47 [Bug c/110789] New: Internal Compiler Error: Illegal instruction pledr at gmx dot net
                   ` (2 preceding siblings ...)
  2023-07-24  9:04 ` arsen at gcc dot gnu.org
@ 2023-07-24 15:07 ` pledr at gmx dot net
  2023-07-24 16:29 ` pledr at gmx dot net
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pledr at gmx dot net @ 2023-07-24 15:07 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Peter Lezoch <pledr at gmx dot net> ---
I have a complete buildLog and there is NO  -march=native

I'm just rebuilding now with --disable-avx2

Have to build on R9 because on Zeut gcc reports 'internal error' again !!!





On 2023-07-24 11:04, arsen at gcc dot gnu.org wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110789
>
> Arsen Arsenović <arsen at gcc dot gnu.org> changed:
>
>             What    |Removed                     |Added
> ----------------------------------------------------------------------------
>                   CC|                            |arsen at gcc dot gnu.org
>
> --- Comment #3 from Arsen Arsenović <arsen at gcc dot gnu.org> ---
> did you happen to se -march=native in CFLAGS or such when building gcc?
>

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

* [Bug c/110789] Internal Compiler Error: Illegal instruction
  2023-07-24  8:47 [Bug c/110789] New: Internal Compiler Error: Illegal instruction pledr at gmx dot net
                   ` (3 preceding siblings ...)
  2023-07-24 15:07 ` pledr at gmx dot net
@ 2023-07-24 16:29 ` pledr at gmx dot net
  2023-07-26  6:44 ` pledr at gmx dot net
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pledr at gmx dot net @ 2023-07-24 16:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Peter Lezoch <pledr at gmx dot net> ---
I built a new gcc with --disable-avx2:

bash-5.2# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/12.2.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../configure --prefix=/usr --disable-avx2
--enable-multilib --with-multili
b-list=m64,m32,mx32 --with-system-zlib --enable-default-pie
--enable-default-ssp --with-lon
g-double-128 --enable-languages=c,c++,fortran
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.2.0 (GCC)
bash-5.2#

BUT: get the same internal error

     ==>> no improvement !!!


On 2023-07-24 10:55, pinskia at gcc dot gnu.org wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110789
>
> Andrew Pinski <pinskia at gcc dot gnu.org> changed:
>
>             What    |Removed                     |Added
> ----------------------------------------------------------------------------
>               Status|UNCONFIRMED                 |WAITING
>       Ever confirmed|0                           |1
>     Last reconfirmed|                            |2023-07-24
>
> --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
> How did you configure gcc?
>
> I suspect the issue is you compiled gcc to only run on the first machine which
> has avx2 while the second one does not.
>

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

* [Bug c/110789] Internal Compiler Error: Illegal instruction
  2023-07-24  8:47 [Bug c/110789] New: Internal Compiler Error: Illegal instruction pledr at gmx dot net
                   ` (4 preceding siblings ...)
  2023-07-24 16:29 ` pledr at gmx dot net
@ 2023-07-26  6:44 ` pledr at gmx dot net
  2023-07-26  6:49 ` pinskia at gcc dot gnu.org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pledr at gmx dot net @ 2023-07-26  6:44 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Peter Lezoch <pledr at gmx dot net> ---


In the passed days, I have further investigated the issue:

  the backtrace leads to: 0xba137d real_from_string(real_value*, char const*)
                            ../../gcc/real.cc:2110  which is the following line
of code:

                            -->    inexact = mpfr_strtofr (m, str, NULL, 10,
MPFR_RNDZ);

                            --> MPFR -- GNU Multiple Precision Floating-Point
Reliable Library

  so I rebuilt mpfr-4.2.0  and found in the configure step a strong connection
to

                            --> GMP -- GNU Multiple Precision Arithmetic
Library (GMP)

  In
https://www.linuxfromscratch.org/lfs/view/stable-systemd/chapter08/gmp.html
  I found TWO remarkable NOTEs:

----------------------------------------------------------
   Note

The default settings of GMP produce libraries optimized for the host processor.
If libraries suitable for processors less capable than the host's CPU are
desired, generic libraries can be created by running the following:

cp -v configfsf.guess config.guess
cp -v configfsf.sub   config.sub

----------------------------------------------------------

and

----------------------------------------------------------

 Caution

The code in gmp is highly optimized for the processor where it is built.
Occasionally, the code that detects the processor misidentifies the system
capabilities and there will be errors in the tests or other applications using
the gmp libraries with the message "Illegal instruction". In this case, gmp
should be reconfigured with the option --build=x86_64-pc-linux-gnu and rebuilt.

----------------------------------------------------------

BINGO !!!!

So rebuilding of gmp-6.2.1 with above options and precautions and
   rebuilding of mpfr-42.0 and
   rebuilding of gcc-12.2 without --disable-avx2

solved all the observed issues !!




So thanks to all for there efforts !
From my point of view the Bug 110789 is solved and can be closed !!!

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

* [Bug c/110789] Internal Compiler Error: Illegal instruction
  2023-07-24  8:47 [Bug c/110789] New: Internal Compiler Error: Illegal instruction pledr at gmx dot net
                   ` (5 preceding siblings ...)
  2023-07-26  6:44 ` pledr at gmx dot net
@ 2023-07-26  6:49 ` pinskia at gcc dot gnu.org
  2023-07-27  1:30 ` xry111 at gcc dot gnu.org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-07-26  6:49 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
If you compile GMP (MPFR and MPC) as part of GCC build rather than seperately,
the build will do the correct thing and not use the "native" options by
default.


You could also configure GMP using --target=none-linux-gnu
--host=none-linux-gnu --build=none-linux-gnu to disable that similar thing
(just as building GMP as part of GCC's build).

From Makefile.def:
host_modules= { module= gmp; lib_path=.libs; bootstrap=true;
                // Work around in-tree gmp configure bug with missing flex.
                extra_configure_flags='--disable-shared LEX="touch lex.yy.c"
@host_libs_picflag@';
                extra_make_flags='AM_CFLAGS="-DNO_ASM"';
                no_install= true;
                // none-*-* disables asm optimizations, bootstrap-testing
                // the compiler more thoroughly.
                host="none-${host_vendor}-${host_os}";
                // gmp's configure will complain if given anything
                // different from host for target.
                target="none-${host_vendor}-${host_os}"; };

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

* [Bug c/110789] Internal Compiler Error: Illegal instruction
  2023-07-24  8:47 [Bug c/110789] New: Internal Compiler Error: Illegal instruction pledr at gmx dot net
                   ` (6 preceding siblings ...)
  2023-07-26  6:49 ` pinskia at gcc dot gnu.org
@ 2023-07-27  1:30 ` xry111 at gcc dot gnu.org
  2023-07-27  5:05 ` xry111 at gcc dot gnu.org
  2023-07-27  5:09 ` xry111 at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: xry111 at gcc dot gnu.org @ 2023-07-27  1:30 UTC (permalink / raw)
  To: gcc-bugs

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

Xi Ruoyao <xry111 at gcc dot gnu.org> changed:

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

--- Comment #8 from Xi Ruoyao <xry111 at gcc dot gnu.org> ---
For LFS specific issue please ask lfs-support@lists.linuxfromscratch.org first. 

If you'd done so you'd avoid a unnecessary two-day debug session and we'd
reduce one invalid bug report in upstream issue tracker.

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

* [Bug c/110789] Internal Compiler Error: Illegal instruction
  2023-07-24  8:47 [Bug c/110789] New: Internal Compiler Error: Illegal instruction pledr at gmx dot net
                   ` (7 preceding siblings ...)
  2023-07-27  1:30 ` xry111 at gcc dot gnu.org
@ 2023-07-27  5:05 ` xry111 at gcc dot gnu.org
  2023-07-27  5:09 ` xry111 at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: xry111 at gcc dot gnu.org @ 2023-07-27  5:05 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Xi Ruoyao <xry111 at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #7)
> If you compile GMP (MPFR and MPC) as part of GCC build rather than
> seperately, the build will do the correct thing and not use the "native"
> options by default.
> 
> 
> You could also configure GMP using --target=none-linux-gnu
> --host=none-linux-gnu --build=none-linux-gnu to disable that similar thing
> (just as building GMP as part of GCC's build).
> 
> From Makefile.def:
> host_modules= { module= gmp; lib_path=.libs; bootstrap=true;
>                 // Work around in-tree gmp configure bug with missing flex.
>                 extra_configure_flags='--disable-shared LEX="touch lex.yy.c"
> @host_libs_picflag@';
>                 extra_make_flags='AM_CFLAGS="-DNO_ASM"';
>                 no_install= true;
>                 // none-*-* disables asm optimizations, bootstrap-testing
>                 // the compiler more thoroughly.
>                 host="none-${host_vendor}-${host_os}";
>                 // gmp's configure will complain if given anything
>                 // different from host for target.
>                 target="none-${host_vendor}-${host_os}"; };

FWIW when I try this, configure script says:

configure: WARNING: the "none" host is obsolete, use --disable-assembly

So I'll change the LFS book to use --disable-assembly instead of these fancy
"cp configfsf" things.  Not sure if we should use --disable-assembly too for
GCC in-tree GMP (I don't know which the first version of GMP supports
--disable-assembly).

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

* [Bug c/110789] Internal Compiler Error: Illegal instruction
  2023-07-24  8:47 [Bug c/110789] New: Internal Compiler Error: Illegal instruction pledr at gmx dot net
                   ` (8 preceding siblings ...)
  2023-07-27  5:05 ` xry111 at gcc dot gnu.org
@ 2023-07-27  5:09 ` xry111 at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: xry111 at gcc dot gnu.org @ 2023-07-27  5:09 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from Xi Ruoyao <xry111 at gcc dot gnu.org> ---
(In reply to Xi Ruoyao from comment #9)
> (In reply to Andrew Pinski from comment #7)
> > If you compile GMP (MPFR and MPC) as part of GCC build rather than
> > seperately, the build will do the correct thing and not use the "native"
> > options by default.
> > 
> > 
> > You could also configure GMP using --target=none-linux-gnu
> > --host=none-linux-gnu --build=none-linux-gnu to disable that similar thing
> > (just as building GMP as part of GCC's build).
> > 
> > From Makefile.def:
> > host_modules= { module= gmp; lib_path=.libs; bootstrap=true;
> >                 // Work around in-tree gmp configure bug with missing flex.
> >                 extra_configure_flags='--disable-shared LEX="touch lex.yy.c"
> > @host_libs_picflag@';
> >                 extra_make_flags='AM_CFLAGS="-DNO_ASM"';
> >                 no_install= true;
> >                 // none-*-* disables asm optimizations, bootstrap-testing
> >                 // the compiler more thoroughly.
> >                 host="none-${host_vendor}-${host_os}";
> >                 // gmp's configure will complain if given anything
> >                 // different from host for target.
> >                 target="none-${host_vendor}-${host_os}"; };
> 
> FWIW when I try this, configure script says:
> 
> configure: WARNING: the "none" host is obsolete, use --disable-assembly
> 
> So I'll change the LFS book to use --disable-assembly instead of these fancy
> "cp configfsf" things.  Not sure if we should use --disable-assembly too for
> GCC in-tree GMP (I don't know which the first version of GMP supports
> --disable-assembly).

Nope, --disable-assembly still sets CFLAGS to -march=nehalem.  So the configure
script is lying :(.

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

end of thread, other threads:[~2023-07-27  5:09 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-24  8:47 [Bug c/110789] New: Internal Compiler Error: Illegal instruction pledr at gmx dot net
2023-07-24  8:55 ` [Bug c/110789] " pinskia at gcc dot gnu.org
2023-07-24  8:59 ` pledr at gmx dot net
2023-07-24  9:04 ` arsen at gcc dot gnu.org
2023-07-24 15:07 ` pledr at gmx dot net
2023-07-24 16:29 ` pledr at gmx dot net
2023-07-26  6:44 ` pledr at gmx dot net
2023-07-26  6:49 ` pinskia at gcc dot gnu.org
2023-07-27  1:30 ` xry111 at gcc dot gnu.org
2023-07-27  5:05 ` xry111 at gcc dot gnu.org
2023-07-27  5:09 ` xry111 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).