public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/57637] New: Miscompare on 178.galgel in SPEC2000 on arm
@ 2013-06-17  9:55 ktkachov at gcc dot gnu.org
  2013-06-18  7:48 ` [Bug target/57637] " zhenqiang.chen at linaro dot org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: ktkachov at gcc dot gnu.org @ 2013-06-17  9:55 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57637

            Bug ID: 57637
           Summary: Miscompare on 178.galgel in SPEC2000 on arm
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ktkachov at gcc dot gnu.org
                CC: bernds at codesourcery dot com, zhenqiang.chen at linaro dot org
            Target: armv7l-unknown-linux-gnueabihf

We're getting a miscompare on the 178.galgel benchmark in SPEC2000 on
armv7l-unknown-linux-gnueabihf, on a Cortex-A15.
The .mis file just says 'galgel.out' short.

Bisection shows it started with r199439.

2013-05-30 Bernd Schmidt <bernds@codesourcery.com>
Zhenqiang Chen <zhenqiang.chen@linaro.org>

    config/arm/arm-protos.h: Add and update function protos.
    config/arm/arm.c (use_simple_return_p): New added.
    (thumb2_expand_return): Check simple_return flag.
    config/arm/arm.md: Add simple_return and conditional simple_return.
    config/arm/iterators.md: Add iterator for return and simple_return.


The compiler was configured: "--with-cpu=cortex-a15 --with-fpu=neon-vfpv4
--with-mode=thumb --with-float=hard --enable-languages=c,c++,fortran"

The flags for the benchmark are -ffixed-form -mthumb -mcpu=cortex-a15
-mfpu=neon-vfpv4 -mfloat-abi=hard -O3.
It works with -O1, fails at -O2 and -O3


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

* [Bug target/57637] Miscompare on 178.galgel in SPEC2000 on arm
  2013-06-17  9:55 [Bug target/57637] New: Miscompare on 178.galgel in SPEC2000 on arm ktkachov at gcc dot gnu.org
@ 2013-06-18  7:48 ` zhenqiang.chen at linaro dot org
  2013-06-18  8:18 ` ktkachov at gcc dot gnu.org
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: zhenqiang.chen at linaro dot org @ 2013-06-18  7:48 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57637

--- Comment #1 from zhenqiang.chen at linaro dot org ---

I had reproduced it on chrome book. It failed due to "alignment exception" for
O3.

I will do more investigation.

If this bug blocks your work, please try "-fno-shrink-wrap" to disable the
optimization.


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

* [Bug target/57637] Miscompare on 178.galgel in SPEC2000 on arm
  2013-06-17  9:55 [Bug target/57637] New: Miscompare on 178.galgel in SPEC2000 on arm ktkachov at gcc dot gnu.org
  2013-06-18  7:48 ` [Bug target/57637] " zhenqiang.chen at linaro dot org
@ 2013-06-18  8:18 ` ktkachov at gcc dot gnu.org
  2013-06-21  5:06 ` zhenqiang.chen at linaro dot org
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: ktkachov at gcc dot gnu.org @ 2013-06-18  8:18 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57637

--- Comment #2 from ktkachov at gcc dot gnu.org ---
Thanks, Zhenqiang.

For me, it's a segfault in function DGETF2. gdb backtrace:
Program received signal SIGSEGV, Segmentation fault.
0x0001d964 in dgetf2_ ()
(gdb) bt
#0  0x0001d964 in dgetf2_ ()
#1  0x000255a4 in dgetrf_ ()
#2  0x00015856 in sysnsl_ ()
#3  0x0001194e in MAIN__ () at galgel.f90:9


Looking further into it, the segfault seems to be from the function idamax that
is inlined in dgetf2.

Hope this helps,
Kyrill


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

* [Bug target/57637] Miscompare on 178.galgel in SPEC2000 on arm
  2013-06-17  9:55 [Bug target/57637] New: Miscompare on 178.galgel in SPEC2000 on arm ktkachov at gcc dot gnu.org
  2013-06-18  7:48 ` [Bug target/57637] " zhenqiang.chen at linaro dot org
  2013-06-18  8:18 ` ktkachov at gcc dot gnu.org
@ 2013-06-21  5:06 ` zhenqiang.chen at linaro dot org
  2013-06-21  5:13 ` zhenqiang.chen at linaro dot org
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: zhenqiang.chen at linaro dot org @ 2013-06-21  5:06 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57637

--- Comment #3 from zhenqiang.chen at linaro dot org ---
Created attachment 30330
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30330&action=edit
pr57637.patch


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

* [Bug target/57637] Miscompare on 178.galgel in SPEC2000 on arm
  2013-06-17  9:55 [Bug target/57637] New: Miscompare on 178.galgel in SPEC2000 on arm ktkachov at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2013-06-21  5:06 ` zhenqiang.chen at linaro dot org
@ 2013-06-21  5:13 ` zhenqiang.chen at linaro dot org
  2013-06-21  9:14 ` ktkachov at gcc dot gnu.org
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: zhenqiang.chen at linaro dot org @ 2013-06-21  5:13 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57637

--- Comment #4 from zhenqiang.chen at linaro dot org ---
Root cause:

For ARM, gcc might generate cond_exec insns before shrink-wrapping. But
DF_LR_BB_INFO (bb)->def does not include def info from cond_exec insns. So the
check in function move_insn_for_shrink_wrap is not enough.

We'd check DF_LIVE_BB_INFO (bb)->gen.

Kyrill,

Please try the attached patch. If it works, I will send it for community
review.

Thanks!
-Zhenqiang


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

* [Bug target/57637] Miscompare on 178.galgel in SPEC2000 on arm
  2013-06-17  9:55 [Bug target/57637] New: Miscompare on 178.galgel in SPEC2000 on arm ktkachov at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2013-06-21  5:13 ` zhenqiang.chen at linaro dot org
@ 2013-06-21  9:14 ` ktkachov at gcc dot gnu.org
  2013-06-21 20:15 ` mikpe at it dot uu.se
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: ktkachov at gcc dot gnu.org @ 2013-06-21  9:14 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57637

--- Comment #5 from ktkachov at gcc dot gnu.org ---

> Please try the attached patch. If it works, I will send it for community
> review.

Hi Zhenqiang,

This seems to fix the miscompare on my setup, thanks!
I haven't ran a full regression test on it though, but it seems reasonable at
first glance.

Kyrill


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

* [Bug target/57637] Miscompare on 178.galgel in SPEC2000 on arm
  2013-06-17  9:55 [Bug target/57637] New: Miscompare on 178.galgel in SPEC2000 on arm ktkachov at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2013-06-21  9:14 ` ktkachov at gcc dot gnu.org
@ 2013-06-21 20:15 ` mikpe at it dot uu.se
  2013-06-26  7:29 ` zhenqiang.chen at linaro dot org
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: mikpe at it dot uu.se @ 2013-06-21 20:15 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57637

Mikael Pettersson <mikpe at it dot uu.se> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mikpe at it dot uu.se

--- Comment #6 from Mikael Pettersson <mikpe at it dot uu.se> ---
(In reply to zhenqiang.chen from comment #3)
> Created attachment 30330 [details]
> pr57637.patch

This patch breaks Ada bootstrap on x86_64 for me:

/tmp/objdir/./prev-gcc/xgcc -B/tmp/objdir/./prev-gcc/
-B/tmp/install49/x86_64-unknown-linux-gnu/bin/
-B/tmp/install49/x86_64-unknown-linux-gnu/bin/
-B/tmp/install49/x86_64-unknown-linux-gnu/lib/ -isystem
/tmp/install49/x86_64-unknown-linux-gnu/include -isystem
/tmp/install49/x86_64-unknown-linux-gnu/sys-include    -c -g -O2 -gtoggle 
-gnatpg  -W -Wall -g -O1 -fno-inline \
 -nostdinc -I- -I. -Iada -I/tmp/gcc-4.9-20130616/gcc/ada
-I/tmp/gcc-4.9-20130616/gcc/ada/gcc-interface
/tmp/gcc-4.9-20130616/gcc/ada/a-except.adb -o ada/a-except.o

raised STORAGE_ERROR : stack overflow or erroneous memory access
make[3]: *** [ada/a-except.o] Error 1
make[3]: Leaving directory `/tmp/objdir/gcc'
make[2]: *** [all-stage2-gcc] Error 2
make[2]: Leaving directory `/tmp/objdir'
make[1]: *** [stage2-bubble] Error 2
make[1]: Leaving directory `/tmp/objdir'
make: *** [bootstrap] Error 2


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

* [Bug target/57637] Miscompare on 178.galgel in SPEC2000 on arm
  2013-06-17  9:55 [Bug target/57637] New: Miscompare on 178.galgel in SPEC2000 on arm ktkachov at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2013-06-21 20:15 ` mikpe at it dot uu.se
@ 2013-06-26  7:29 ` zhenqiang.chen at linaro dot org
  2013-06-26  9:23 ` ktkachov at gcc dot gnu.org
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: zhenqiang.chen at linaro dot org @ 2013-06-26  7:29 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57637

--- Comment #7 from zhenqiang.chen at linaro dot org ---
Created attachment 30364
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30364&action=edit
update patch


Please try the updated patch. Local tests: x86-64 and pandaboard bootstrap OK.


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

* [Bug target/57637] Miscompare on 178.galgel in SPEC2000 on arm
  2013-06-17  9:55 [Bug target/57637] New: Miscompare on 178.galgel in SPEC2000 on arm ktkachov at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2013-06-26  7:29 ` zhenqiang.chen at linaro dot org
@ 2013-06-26  9:23 ` ktkachov at gcc dot gnu.org
  2013-06-28 10:35 ` [Bug rtl-optimization/57637] " rearnsha at gcc dot gnu.org
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: ktkachov at gcc dot gnu.org @ 2013-06-26  9:23 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57637

--- Comment #8 from ktkachov at gcc dot gnu.org ---
(In reply to zhenqiang.chen from comment #7)
> Created attachment 30364 [details]
> update patch
> 
> 
> Please try the updated patch. Local tests: x86-64 and pandaboard bootstrap

This fixes the segfault in SPEC on arm for me.

Is there a way to produce a testsuite testcase for this regression? The
benchmark where this occurs is a large chunk of Fortran, not sure how easy it
is to reduce it.


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

* [Bug rtl-optimization/57637] Miscompare on 178.galgel in SPEC2000 on arm
  2013-06-17  9:55 [Bug target/57637] New: Miscompare on 178.galgel in SPEC2000 on arm ktkachov at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2013-06-26  9:23 ` ktkachov at gcc dot gnu.org
@ 2013-06-28 10:35 ` rearnsha at gcc dot gnu.org
  2013-07-30 10:21 ` [Bug rtl-optimization/57637] [4.9 regression] " ktkachov at gcc dot gnu.org
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: rearnsha at gcc dot gnu.org @ 2013-06-28 10:35 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57637

Richard Earnshaw <rearnsha at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-06-28
          Component|target                      |rtl-optimization
     Ever confirmed|0                           |1

--- Comment #9 from Richard Earnshaw <rearnsha at gcc dot gnu.org> ---
Marked as confirmed based on subsequent discussion


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

* [Bug rtl-optimization/57637] [4.9 regression] Miscompare on 178.galgel in SPEC2000 on arm
  2013-06-17  9:55 [Bug target/57637] New: Miscompare on 178.galgel in SPEC2000 on arm ktkachov at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2013-06-28 10:35 ` [Bug rtl-optimization/57637] " rearnsha at gcc dot gnu.org
@ 2013-07-30 10:21 ` ktkachov at gcc dot gnu.org
  2013-07-30 10:22 ` ktkachov at gcc dot gnu.org
  2014-03-31 16:22 ` hjl at gcc dot gnu.org
  11 siblings, 0 replies; 13+ messages in thread
From: ktkachov at gcc dot gnu.org @ 2013-07-30 10:21 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57637

ktkachov at gcc dot gnu.org changed:

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

--- Comment #10 from ktkachov at gcc dot gnu.org ---
I can confirm as of r201326:

    2013-07-30  Zhenqiang Chen  <zhenqiang.chen@linaro.org>

        PR rtl-optimization/57637
        * function.c (move_insn_for_shrink_wrap): Also check the
        GEN set of the LIVE problem for the liveness analysis
        if it exists, otherwise give up.

the segfault is gone.

Thanks,
Kyrill


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

* [Bug rtl-optimization/57637] [4.9 regression] Miscompare on 178.galgel in SPEC2000 on arm
  2013-06-17  9:55 [Bug target/57637] New: Miscompare on 178.galgel in SPEC2000 on arm ktkachov at gcc dot gnu.org
                   ` (9 preceding siblings ...)
  2013-07-30 10:21 ` [Bug rtl-optimization/57637] [4.9 regression] " ktkachov at gcc dot gnu.org
@ 2013-07-30 10:22 ` ktkachov at gcc dot gnu.org
  2014-03-31 16:22 ` hjl at gcc dot gnu.org
  11 siblings, 0 replies; 13+ messages in thread
From: ktkachov at gcc dot gnu.org @ 2013-07-30 10:22 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57637

ktkachov at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.9.0


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

* [Bug rtl-optimization/57637] [4.9 regression] Miscompare on 178.galgel in SPEC2000 on arm
  2013-06-17  9:55 [Bug target/57637] New: Miscompare on 178.galgel in SPEC2000 on arm ktkachov at gcc dot gnu.org
                   ` (10 preceding siblings ...)
  2013-07-30 10:22 ` ktkachov at gcc dot gnu.org
@ 2014-03-31 16:22 ` hjl at gcc dot gnu.org
  11 siblings, 0 replies; 13+ messages in thread
From: hjl at gcc dot gnu.org @ 2014-03-31 16:22 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57637

--- Comment #11 from hjl at gcc dot gnu.org <hjl at gcc dot gnu.org> ---
Author: hjl
Date: Mon Mar 31 16:21:30 2014
New Revision: 208963

URL: http://gcc.gnu.org/viewcvs?rev=208963&root=gcc&view=rev
Log:
Backport revision 201326

gcc/

    PR rtl-optimization/60700
    2013-07-30  Zhenqiang Chen  <zhenqiang.chen@linaro.org>

    PR rtl-optimization/57637
    * function.c (move_insn_for_shrink_wrap): Also check the
    GEN set of the LIVE problem for the liveness analysis
    if it exists, otherwise give up.

gcc/testsuite/

    PR rtl-optimization/60700
    2013-07-30  Zhenqiang Chen  <zhenqiang.chen@linaro.org>

    * gcc.target/arm/pr57637.c: New testcase.

Added:
    branches/gcc-4_8-branch/gcc/testsuite/gcc.target/arm/pr57637.c
Modified:
    branches/gcc-4_8-branch/gcc/ChangeLog
    branches/gcc-4_8-branch/gcc/function.c
    branches/gcc-4_8-branch/gcc/testsuite/ChangeLog


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

end of thread, other threads:[~2014-03-31 16:22 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-17  9:55 [Bug target/57637] New: Miscompare on 178.galgel in SPEC2000 on arm ktkachov at gcc dot gnu.org
2013-06-18  7:48 ` [Bug target/57637] " zhenqiang.chen at linaro dot org
2013-06-18  8:18 ` ktkachov at gcc dot gnu.org
2013-06-21  5:06 ` zhenqiang.chen at linaro dot org
2013-06-21  5:13 ` zhenqiang.chen at linaro dot org
2013-06-21  9:14 ` ktkachov at gcc dot gnu.org
2013-06-21 20:15 ` mikpe at it dot uu.se
2013-06-26  7:29 ` zhenqiang.chen at linaro dot org
2013-06-26  9:23 ` ktkachov at gcc dot gnu.org
2013-06-28 10:35 ` [Bug rtl-optimization/57637] " rearnsha at gcc dot gnu.org
2013-07-30 10:21 ` [Bug rtl-optimization/57637] [4.9 regression] " ktkachov at gcc dot gnu.org
2013-07-30 10:22 ` ktkachov at gcc dot gnu.org
2014-03-31 16:22 ` hjl 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).