[gcc-linaro wrong-code regression] gcc 4.8.1-2ubuntu1 to 4.8.1-3ubuntu1 breaks gtk on armhf

Bug #1194123 reported by Sebastien Bacher
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Linaro GCC
Fix Released
Undecided
Unassigned
gcc
Fix Released
Medium
Ubuntu
Triaged
Medium
Unassigned
gcc-4.8 (Ubuntu)
Fix Released
High
Unassigned

Bug Description

* Something in that upload is creating problems for gtk on armhf:
https://launchpad.net/ubuntu/+source/gcc-4.8/4.8.1-3ubuntu1

* The tests started failing, as showed by the saucy test rebuild:
https://launchpadlibrarian.net/142386450/buildlog_ubuntu-saucy-armhf.gtk%2B3.0_3.8.2-0ubuntu4_FAILEDTOBUILD.txt.gz

tests/a11y/text fails on a "Cannot animate property 'background-image'" error

The error can be reproduced on a porter box, downgrading gcc doing "make clean; make" in debian/build/shared/gtk leads to a working test. Building with -O0 workaround the problem, it fails when using -O1 or -O2 though

Revision history for this message
In , Ktkachov (ktkachov) wrote :

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 <email address hidden>
Zhenqiang Chen <email address hidden>

    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

Revision history for this message
In , Zhenqiang Chen (zhenqiang-chen) wrote :

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.

Revision history for this message
In , Ktkachov (ktkachov) wrote :

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

Revision history for this message
In , Zhenqiang Chen (zhenqiang-chen) wrote :

Created attachment 30330
pr57637.patch

Revision history for this message
In , Zhenqiang Chen (zhenqiang-chen) wrote :

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

Revision history for this message
In , Ktkachov (ktkachov) wrote :

> 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

Revision history for this message
In , Mikpe (mikpe) wrote :

(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

summary: - 4.8.1-2ubuntu1 to 4.8.1-3ubuntu1 breaks gtk on armhf
+ gcc 4.8.1-2ubuntu1 to 4.8.1-3ubuntu1 breaks gtk on armhf
Revision history for this message
Matthias Klose (doko) wrote : Re: gcc 4.8.1-2ubuntu1 to 4.8.1-3ubuntu1 breaks gtk on armhf

did work with the -2ubuntu1 upload, and does work with a gcc-4.8 build with the linaro changes disabled

Changed in gcc-4.8 (Ubuntu):
importance: Undecided → High
Changed in gtk+3.0 (Ubuntu):
importance: Undecided → High
Matthias Klose (doko)
summary: - gcc 4.8.1-2ubuntu1 to 4.8.1-3ubuntu1 breaks gtk on armhf
+ [gcc-linaro wrong-code regression] gcc 4.8.1-2ubuntu1 to 4.8.1-3ubuntu1
+ breaks gtk on armhf
Revision history for this message
Sebastien Bacher (seb128) wrote :

(the issue is not specific to this test, the same warning is hit when using that libgtk-3.so binary on arm)

Revision history for this message
Matthias Klose (doko) wrote :

current test case is to build gtk3 in saucy, and run the gtk3 tests

Revision history for this message
Sebastien Bacher (seb128) wrote :

Some details on how I test atm:

- apt-get source gtk+3.0
- cd gtk+-3.0-3.8.2
- debuild

That leads to a failing build on test

if you want to just run one of the failing tests:
- xvfb-run debian/build/share/tests/a11y/text

To test changes (e.g downgrading gcc or -O0):
- cd debian/build/share/gtk
- make clean
- (edit Makefile to change -O)
- make
- xvfb-run ../tests/a11y/text

-> gives a working test.

I'm trying to figure out what option exactly is breaking it, I didn't find yet what objects in gtk need to be rebuilt to trigger the problem or not though...

Revision history for this message
Sebastien Bacher (seb128) wrote :

updated/smaller testcase:
- untar the gtk source
- autoreconf
- ./configure --prefix=/usr --disable-test-print-backend --enable-x11-backend --disable-gtk-doc --enable-shared --disable-introspection --disable-colord --disable-static --disable-wayland-backend
(turning off some of the options helps to lower the turnover)
- make
- cd gtk
- xvfb-run ./tests/builder

-> that breaks

- sed -i 's#-O2# #g' Makefile
- touch gtkcssstylepropertyimpl.c; make; xvfb-run ./tests/builder

-> works

Revision history for this message
In , Zhenqiang Chen (zhenqiang-chen) wrote :

Created attachment 30364
update patch

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

Revision history for this message
In , Ktkachov (ktkachov) wrote :

(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.

Revision history for this message
Zhenqiang Chen (zhenqiang-chen) wrote :

I have no environment to reproduce it.

Would you please try option "-fno-shrink-wrap"? If it works, the root cause maybe the same as http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57637. In this case, would you please try the update patch at pr57637? If it still fails (without -fno-shrink-wrap option), please add option "-fdump-rtl-pro_and_epilogue" and attach the gtkcssstylepropertyimpl.c.*.pro_and_epilogue.

Thanks!
-Zhenqiang

Revision history for this message
Sebastien Bacher (seb128) wrote :

> Would you please try option "-fno-shrink-wrap"

That fix it, thanks!

> would you please try the update patch at pr57637?

@doko: is there any chance you could include that one in the next upload or in a test package? I'm not sure I want to try rebuilding gcc on the panda board, and I don't have root access to replace the compiler with the test version...

Changed in gtk+3.0 (Ubuntu):
status: New → Invalid
Changed in gcc:
importance: Unknown → Medium
status: Unknown → New
Revision history for this message
In , Rearnsha (rearnsha) wrote :

Marked as confirmed based on subsequent discussion

Revision history for this message
Zhenqiang Chen (zhenqiang-chen) wrote :

I had confirmed with 2013.06 release configured by --enable-languages=c,c++ --with-arch=armv7-a --with-float=hard --with-fpu=vfpv3-d16 --with-mode=thumb on Chrome book.

The root cause is the same as pr57637.

The failed functions is gtk_css_style_property_register.

Changed in gcc-linaro:
status: New → Confirmed
Changed in gcc:
status: New → Confirmed
Revision history for this message
In , Ktkachov (ktkachov) wrote :

I can confirm as of r201326:

    2013-07-30 Zhenqiang Chen <email address hidden>

        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

Changed in gcc:
status: Confirmed → Fix Released
Revision history for this message
Matthias Klose (doko) wrote :

will be fixed with new GCC upload, reopen the gtk task to remove the workaround after the GCC upload

Changed in gcc-4.8 (Ubuntu):
status: New → In Progress
affects: gtk+3.0 (Ubuntu) → ubuntu
Changed in ubuntu:
importance: High → Medium
status: Invalid → Triaged
Revision history for this message
Matthias Klose (doko) wrote :

fixed in saucy

Changed in gcc-4.8 (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
In , Hjl-0 (hjl-0) wrote :

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 <email address hidden>

 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 <email address hidden>

 * 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

Changed in gcc-linaro:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.