public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/90378] [9/10 regression] -Os -flto miscompiles 454.calculix after r266385 on Arm
       [not found] <bug-90378-4@http.gcc.gnu.org/bugzilla/>
@ 2020-03-11 13:43 ` clyon at gcc dot gnu.org
  2020-03-12 10:08 ` clyon at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 7+ messages in thread
From: clyon at gcc dot gnu.org @ 2020-03-11 13:43 UTC (permalink / raw)
  To: gcc-bugs

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

Christophe Lyon <clyon at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2020-03-11
                 CC|                            |clyon at gcc dot gnu.org
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1

--- Comment #7 from Christophe Lyon <clyon at gcc dot gnu.org> ---
I am able to reproduce the failure with the same commit mentioned by Maxim in
comment #3. Using a more recent trunk (Feb 21, 2020) made the problem
disappear.

I'm using -Os -flto -mthumb, with a GCC bootstrapped on an armv7 machine
(cortex-a15, NVidia jetson-tk1).

Like Maxim said in comment #1, if I copy the binary and runtime libs
(libgfortran, etc....) to an ARMv8 machine with AArch32 mode support, the
execution is successful.

The failure looks like this:
====================================
[...]
increment 1 attempt 1 
increment size= 5.000000e-02
sum of previous increments=0.000000e+00

ilin=0
iteration 1

Segmentation fault
====================================

Under gdb:
Program received signal SIGSEGV, Segmentation fault.
0xb6deab58 in ?? () from /home/christophe.lyon/calculix.broken/lib/libc.so.6
(gdb) bt
#0  0xb6deab58 in ?? () from
/home/christophe.lyon/calculix.broken/lib/libc.so.6
#1  0xb6deb01e in ?? () from
/home/christophe.lyon/calculix.broken/lib/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)


When using valgrind (3.11.0), several errors are reported before reaching the
point where the code normally crashes, but execution continues:
====================================
[...]
increment 1 attempt 1 
increment size= 5.000000e-02
sum of previous increments=0.000000e+00

ilin=0
iteration 1

largest residual force= 203.899659
no convergence

iteration 2
====================================
Most of the errors are "Invalid write of size 4" or "Use of uninitialised value
of size 4" in bpabi.S lines 256-259, which correspond to macro expansion of
push_for_divide and pop_for_divide in aeabi_uldivmod. The errors are about
reading/writing in the stack.


When using valgrind (3.13.0) on ARMv8 hardware, it does not report any error,
so I'm puzzled: was it a bug in valgrind-3.11.0, or are some glibc ifuncs
changing the behaviour?


Anyway, I still don't know where the program crashes on ARMv7 hardware.

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

* [Bug rtl-optimization/90378] [9/10 regression] -Os -flto miscompiles 454.calculix after r266385 on Arm
       [not found] <bug-90378-4@http.gcc.gnu.org/bugzilla/>
  2020-03-11 13:43 ` [Bug rtl-optimization/90378] [9/10 regression] -Os -flto miscompiles 454.calculix after r266385 on Arm clyon at gcc dot gnu.org
@ 2020-03-12 10:08 ` clyon at gcc dot gnu.org
  2020-03-12 11:58 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 7+ messages in thread
From: clyon at gcc dot gnu.org @ 2020-03-12 10:08 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Christophe Lyon <clyon at gcc dot gnu.org> ---
I also tried to run the program under QEMU, it works (doesn't crash)

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

* [Bug rtl-optimization/90378] [9/10 regression] -Os -flto miscompiles 454.calculix after r266385 on Arm
       [not found] <bug-90378-4@http.gcc.gnu.org/bugzilla/>
  2020-03-11 13:43 ` [Bug rtl-optimization/90378] [9/10 regression] -Os -flto miscompiles 454.calculix after r266385 on Arm clyon at gcc dot gnu.org
  2020-03-12 10:08 ` clyon at gcc dot gnu.org
@ 2020-03-12 11:58 ` jakub at gcc dot gnu.org
  2020-03-13 14:06 ` clyon at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-03-12 11:58 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|9.3                         |9.4

--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 9.3.0 has been released, adjusting target milestone.

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

* [Bug rtl-optimization/90378] [9/10 regression] -Os -flto miscompiles 454.calculix after r266385 on Arm
       [not found] <bug-90378-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2020-03-12 11:58 ` jakub at gcc dot gnu.org
@ 2020-03-13 14:06 ` clyon at gcc dot gnu.org
  2021-06-01  8:14 ` [Bug rtl-optimization/90378] [9/10/11/12 " rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 7+ messages in thread
From: clyon at gcc dot gnu.org @ 2020-03-13 14:06 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from Christophe Lyon <clyon at gcc dot gnu.org> ---
I checked the stack settings on the ARMv7 and ARMv8 machines:
ARMv7: beced000-bed0e000 rw-p 00000000 00:00 0          [stack]
ARMv8: fff12000-fff33000 rw-p 00000000 00:00 0          [stack]

In both cases ulimit -a says:
stack size              (kbytes, -s) 8192


I recompiled with "-Os -flto  -g -mthumb" (ie. I added -g) and execution
sometimes reaches iteration 2, sometimes not.

Using gdb I got a bit more info:
Program received signal SIGSEGV, Segmentation fault.
_int_free (av=0xc59a20, p=<optimized out>, have_lock=12975032) at malloc.c:4088
4088    malloc.c: No such file or directory.

But this is random too, another run gave:
Program received signal SIGSEGV, Segmentation fault.
__brk (addr=0x1) at ../sysdeps/unix/sysv/linux/arm/brk.c:31
31      ../sysdeps/unix/sysv/linux/arm/brk.c: No such file or directory.


Other runs from the same gdb gave no backtrace at all, and at least one of them
reached iteration 4.

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

* [Bug rtl-optimization/90378] [9/10/11/12 regression] -Os -flto miscompiles 454.calculix after r266385 on Arm
       [not found] <bug-90378-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2020-03-13 14:06 ` clyon at gcc dot gnu.org
@ 2021-06-01  8:14 ` rguenth at gcc dot gnu.org
  2021-06-01 10:02 ` mkuvyrkov at gcc dot gnu.org
  2021-10-01 16:03 ` mkuvyrkov at gcc dot gnu.org
  6 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-06-01  8:14 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|9.4                         |9.5

--- Comment #11 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 9.4 is being released, retargeting bugs to GCC 9.5.

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

* [Bug rtl-optimization/90378] [9/10/11/12 regression] -Os -flto miscompiles 454.calculix after r266385 on Arm
       [not found] <bug-90378-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2021-06-01  8:14 ` [Bug rtl-optimization/90378] [9/10/11/12 " rguenth at gcc dot gnu.org
@ 2021-06-01 10:02 ` mkuvyrkov at gcc dot gnu.org
  2021-10-01 16:03 ` mkuvyrkov at gcc dot gnu.org
  6 siblings, 0 replies; 7+ messages in thread
From: mkuvyrkov at gcc dot gnu.org @ 2021-06-01 10:02 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #12 from Maxim Kuvyrkov <mkuvyrkov at gcc dot gnu.org> ---
I'm now more of the opinion that this problem is due to the unfortunate stack
layout on older ARMv7 systems.  I.e., LTO increases stack usage, which causes
the process to run out of stack.  I don't think anything needs to be fixed on
GCC side, and, hopefully, we can fix this on our end by upgrading from 3.10
kernel to something more modern.

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

* [Bug rtl-optimization/90378] [9/10/11/12 regression] -Os -flto miscompiles 454.calculix after r266385 on Arm
       [not found] <bug-90378-4@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2021-06-01 10:02 ` mkuvyrkov at gcc dot gnu.org
@ 2021-10-01 16:03 ` mkuvyrkov at gcc dot gnu.org
  6 siblings, 0 replies; 7+ messages in thread
From: mkuvyrkov at gcc dot gnu.org @ 2021-10-01 16:03 UTC (permalink / raw)
  To: gcc-bugs

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

Maxim Kuvyrkov <mkuvyrkov at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |WORKSFORME
             Status|NEW                         |RESOLVED

--- Comment #13 from Maxim Kuvyrkov <mkuvyrkov at gcc dot gnu.org> ---
This problem has not been occurring since we have moved aarch32 benchmarking to
a machine with newer kernel.  Closing.

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

end of thread, other threads:[~2021-10-01 16:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-90378-4@http.gcc.gnu.org/bugzilla/>
2020-03-11 13:43 ` [Bug rtl-optimization/90378] [9/10 regression] -Os -flto miscompiles 454.calculix after r266385 on Arm clyon at gcc dot gnu.org
2020-03-12 10:08 ` clyon at gcc dot gnu.org
2020-03-12 11:58 ` jakub at gcc dot gnu.org
2020-03-13 14:06 ` clyon at gcc dot gnu.org
2021-06-01  8:14 ` [Bug rtl-optimization/90378] [9/10/11/12 " rguenth at gcc dot gnu.org
2021-06-01 10:02 ` mkuvyrkov at gcc dot gnu.org
2021-10-01 16:03 ` mkuvyrkov 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).