User account creation filtered due to spam.

Bug 81025 - [8 Regression] gcc ICE while building glibc for MIPS soft-float multi-lib variant
Summary: [8 Regression] gcc ICE while building glibc for MIPS soft-float multi-lib var...
Status: UNCONFIRMED
Alias: None
Product: gcc
Classification: Unclassified
Component: rtl-optimization (show other bugs)
Version: 8.0
: P3 normal
Target Milestone: 8.0
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code, wrong-debug
Depends on:
Blocks:
 
Reported: 2017-06-08 18:47 UTC by Doug Gilmore
Modified: 2017-06-10 18:57 UTC (History)
4 users (show)

See Also:
Host:
Target: Mips
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
CPP output file (6.98 KB, text/plain)
2017-06-08 18:47 UTC, Doug Gilmore
Details
Patch to constrain the number of multi-lib variants (390 bytes, patch)
2017-06-08 18:49 UTC, Doug Gilmore
Details | Diff
patch needed to build r248863 for MIPS (568 bytes, application/mbox)
2017-06-08 18:50 UTC, Doug Gilmore
Details
cut down example via delta (1.14 KB, text/plain)
2017-06-09 07:22 UTC, Doug Gilmore
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Doug Gilmore 2017-06-08 18:47:24 UTC
Created attachment 41509 [details]
CPP output file

Our ToT GLIBC soft-float builds are failing ToT, I bisected the
problem to r248863.

To reproduce the problem with minimum effort, configure and build via:

<GCC_SRC_PATH>/configure --prefix=.../install-mips-mti-linux-gnu --disable-libssp --disable-libmudflap --disable-decimal-float --with-mips-plt --target=mips-mti-linux-gnu --enable-languages=c --without-headers --disable-shared --disable-threads --disable-libquadmath --disable-libatomic --with-sysroot=.../install-mips-mti-linux-gnu/sysroot
make maybe-all-gcc

I attached two patches:

One to restrict the number of multi-lib variants, which probably isn't
needed for maybe-all-gcc, but will speed full gcc build.

The other patch is a cherry pick of r248879 which is needed to build
r248863 for MIPS.


Build CPP file:

<BUILD_DIR>/gcc/xgcc -B<BUILD_DIR>/gcc -O2 -msoft-float -mabi=32 s_fmaf.i -c -std=gnu11 -fgnu89-inline  -O2 -Wall -Werror -Wundef -Wwrite-strings -fmerge-all-constants -fno-stack-protector -frounding-math -g -Wstrict-prototypes -Wold-style-definition


The CPP file compiles cleanly at r248862, but at r248863 with patch
for r248879 applied, the compile fails with:

during RTL pass: dwarf2
In file included from ../sysdeps/mips/ieee754/s_fmaf.c:4:0:
../soft-fp/fmasf4.c: In function '__fmaf':
../soft-fp/fmasf4.c:62:1: internal compiler error: in maybe_record_trace_start, at dwarf2cfi.c:2330
0x74ab9f maybe_record_trace_start
	/scratch/dgilmore/sgcc-pp5/src/gcc/gcc/dwarf2cfi.c:2330
0x74af2f create_trace_edges
	/scratch/dgilmore/sgcc-pp5/src/gcc/gcc/dwarf2cfi.c:2426
0x74b0af scan_trace
	/scratch/dgilmore/sgcc-pp5/src/gcc/gcc/dwarf2cfi.c:2640
0x74bd16 create_cfi_notes
	/scratch/dgilmore/sgcc-pp5/src/gcc/gcc/dwarf2cfi.c:2666
0x74bd16 execute_dwarf2_frame
	/scratch/dgilmore/sgcc-pp5/src/gcc/gcc/dwarf2cfi.c:3024
0x74bd16 execute
	/scratch/dgilmore/sgcc-pp5/src/gcc/gcc/dwarf2cfi.c:3504
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

Applying -fdump-rtl-dwarf2 to the compilation line the associated
dump file contains:

Inconsistent CFI state!
SHOULD have:
	.cfi_def_cfa 29, 0
DO have:
	.cfi_def_cfa 29, 8
	.cfi_offset 16, -4

The CPP file is quite complicated, I am investigating whether
a cut down example will reproduce the failure.
Comment 1 Doug Gilmore 2017-06-08 18:49:12 UTC
Created attachment 41510 [details]
Patch to constrain the number of multi-lib variants
Comment 2 Doug Gilmore 2017-06-08 18:50:59 UTC
Created attachment 41511 [details]
patch needed to build r248863 for MIPS
Comment 3 Doug Gilmore 2017-06-08 21:31:32 UTC
It appears that r248863 just tickles the bug.  With
the attached example produced by delta the failure mode
is exposed by r248862.    With luck, I may be able to
bisect the problem to an earlier commit.
Comment 4 Doug Gilmore 2017-06-09 07:22:43 UTC
Created attachment 41513 [details]
cut down example via delta

Sorry attachment for the last comment was dropped.

I bisected the failure to r247049 using the cut down
example, compiled via:

$dir/xgcc -B$dir -O2 -msoft-float -mabi=32 delta_1.i -c -std=gnu11 -fgnu89-inline  -O2 -fmerge-all-constants -fno-stack-protector -frounding-math -g

For this bisect I configured with --disable-multilib.

I'll look into this more tomorrow.
Comment 5 graham.stott 2017-06-09 08:35:48 UTC
Hi Doug
I build both GCC and GLIBC daily but for mips-img-linux-gnu and hard-float the only prob. I see is ADA fails building one multilib config. I do all langs I'll give try hard-float mips-mti-linux-gnu.
Graham
ps My son now has British passport

-------- Original message --------
From: "doug.gilmore at imgtec dot com" <gcc-bugzilla@gcc.gnu.org> 
Date: 09/06/2017  09:12  (GMT+00:00) 
To: gcc-bugs@gcc.gnu.org 
Subject: [Bug tree-optimization/81025] [MIPS] soft-float glibc build fails at r248863 

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

Doug Gilmore <doug.gilmore at imgtec dot com> changed:

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

--- Comment #4 from Doug Gilmore <doug.gilmore at imgtec dot com> ---
Created attachment 41513 [details]
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41513&action=edit
cut down example via delta

Sorry attachment for the last comment was dropped.

I bisected the failure to r247049 using the cut down
example, compiled via:

$dir/xgcc -B$dir -O2 -msoft-float -mabi=32 delta_1.i -c -std=gnu11
-fgnu89-inline  -O2 -fmerge-all-constants -fno-stack-protector -frounding-math
-g

For this bisect I configured with --disable-multilib.

I'll look into this more tomorrow.
Comment 6 Doug Gilmore 2017-06-10 05:55:31 UTC
We are back to having our MIPS nightly ToT toolchain builds all
working with r247049 reverted.

Given that r247049 exposes another PRE issue, see bug 80620,
does it make sense to back out until we resolve the problems
at hand?
Comment 7 rguenther@suse.de 2017-06-10 09:38:10 UTC
On June 10, 2017 7:55:31 AM GMT+02:00, "doug.gilmore at imgtec dot com" <gcc-bugzilla@gcc.gnu.org> wrote:
>https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81025
>
>Doug Gilmore <doug.gilmore at imgtec dot com> changed:
>
>           What    |Removed                     |Added
>----------------------------------------------------------------------------
>            Summary|[MIPS] soft-float glibc     |[8 Regression] gcc ICE
>                 |build fails at r248863      |while building glibc for
>                |                            |MIPS soft-float multi-lib
>                   |                            |variant
>
>--- Comment #6 from Doug Gilmore <doug.gilmore at imgtec dot com> ---
>We are back to having our MIPS nightly ToT toolchain builds all
>working with r247049 reverted.
>
>Given that r247049 exposes another PRE issue, see bug 80620,
>does it make sense to back out until we resolve the problems
>at hand?

This MIPS issue is just a latent issue exposed by said rev.  You should be able to produce a test case from the .optimized gimple IL not requiring that PRE change.
Comment 8 Andrew Pinski 2017-06-10 09:47:31 UTC
I bet this is a bug in reorg.c.  It is the least used code (major target usage: MIPS and sparc only) and also one of the more buggy code.
Comment 9 Doug Gilmore 2017-06-10 18:57:50 UTC
> I bet this is a bug in reorg.c.  It is the least used code (major
> target usage: MIPS and sparc only) and also one of the more buggy
> code.
You're right, compiling with -fno-delayed-branch doesn't tickle the bug.

Thanks!