Bug 62300 - [5 Regression] internal compiler error: in as_a, at is-a.h:192
Summary: [5 Regression] internal compiler error: in as_a, at is-a.h:192
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: bootstrap (show other bugs)
Version: 5.0
: P3 normal
Target Milestone: 5.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-29 00:02 UTC by H.J. Lu
Modified: 2014-08-29 08:57 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2014-08-29 00:00:00


Attachments
A testcase (31.83 KB, application/octet-stream)
2014-08-29 00:07 UTC, H.J. Lu
Details
Candidate fix, only lightly tested so far (507 bytes, patch)
2014-08-29 00:47 UTC, Dave Malcolm
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description H.J. Lu 2014-08-29 00:02:43 UTC
On Linux/x86-64, when configured with --with-multilib-list=m32,m64,mx32,
r214699 failed to bootstrap:

In file included from ../../../../src-trunk/libgcc/config/libbid/bid_internal.h:27:0,
                 from ../../../../src-trunk/libgcc/config/libbid/bid_round.c:108:
../../../../src-trunk/libgcc/config/libbid/bid_round.c: In function â__bid_round64_2_18â:
../../../../src-trunk/libgcc/config/libbid/bid_conf.h:48:22: internal compiler error: in as_a, at is-a.h:192
 #define round64_2_18 __bid_round64_2_18
                      ^
../../../../src-trunk/libgcc/config/libbid/bid_round.c:111:1: note: in expansion of macro âround64_2_18â
 round64_2_18 (int q,
 ^
0x781642 rtx_insn* as_a<rtx_insn*, rtx_def>(rtx_def*)
	../../src-trunk/gcc/is-a.h:192
0x90b93c assign_parm_setup_reg
	../../src-trunk/gcc/function.c:3044
0x90d763 assign_parms
	../../src-trunk/gcc/function.c:3453
0x9117cf expand_function_start(tree_node*)
	../../src-trunk/gcc/function.c:4809
0x760cd9 execute
	../../src-trunk/gcc/cfgexpand.c:5715
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
make[8]: *** [bid_round.o] Error 1
make[8]: *** Waiting for unfinished jobs....
../../../../src-trunk/libgcc/config/libbid/bid128_fma.c: In function ârounding_correction.constpropâ:
../../../../src-trunk/libgcc/config/libbid/bid128_fma.c:33:1: internal compiler error: in as_a, at is-a.h:192
 rounding_correction (unsigned int rnd_mode,
 ^
0x781642 rtx_insn* as_a<rtx_insn*, rtx_def>(rtx_def*)
	../../src-trunk/gcc/is-a.h:192
0x90b93c assign_parm_setup_reg
	../../src-trunk/gcc/function.c:3044
0x90d763 assign_parms
	../../src-trunk/gcc/function.c:3453
0x9117cf expand_function_start(tree_node*)
	../../src-trunk/gcc/function.c:4809
0x760cd9 execute
	../../src-trunk/gcc/cfgexpand.c:5715
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
make[8]: *** [bid128_fma.o] Error 1
make[8]: Leaving directory `/export/gnu/import/git/gcc-test-x32/bld/x86_64-unknown-linux-gnu/x32/libgcc'
make[7]: *** [multi-do] Error 1
make[7]: Leaving directory `/export/gnu/import/git/gcc-test-x32/bld/x86_64-unknown-linux-gnu/libgcc'
make[6]: *** [all-multi] Error 2
make[6]: Leaving directory `/export/gnu/import/git/gcc-test-x32/bld/x86_64-unknown-linux-gnu/libgcc'
make[5]: *** [all-stage1-target-libgcc] Error 2
make[5]: Leaving directory `/export/gnu/import/git/gcc-test-x32/bld'
make[4]: *** [stage1-bubble] Error 2
make[4]: Leaving directory `/export/gnu/import/git/gcc-test-x32/bld'
make[3]: *** [bootstrap] Error 2
Comment 1 H.J. Lu 2014-08-29 00:07:33 UTC
Created attachment 33413 [details]
A testcase

[x32@gnu-35 gcc]$ ./xgcc -B./ -S -fPIC -O2 /tmp/x.i  -mx32
../../../../src-trunk/libgcc/config/libbid/bid128_fma.c: In function ‘rounding_correction.constprop’:
../../../../src-trunk/libgcc/config/libbid/bid128_fma.c:33:1: internal compiler error: in as_a, at is-a.h:192
0x781642 rtx_insn* as_a<rtx_insn*, rtx_def>(rtx_def*)
	../../src-trunk/gcc/is-a.h:192
0x90b93c assign_parm_setup_reg
	../../src-trunk/gcc/function.c:3044
0x90d763 assign_parms
	../../src-trunk/gcc/function.c:3453
0x9117cf expand_function_start(tree_node*)
	../../src-trunk/gcc/function.c:4809
0x760cd9 execute
	../../src-trunk/gcc/cfgexpand.c:5715
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
Comment 2 H.J. Lu 2014-08-29 00:09:48 UTC
r214689 is OK.
Comment 3 Dave Malcolm 2014-08-29 00:47:02 UTC
Created attachment 33414 [details]
Candidate fix, only lightly tested so far
Comment 4 Dave Malcolm 2014-08-29 00:47:39 UTC
Sorry about this.

The issue is here:

  3042            insn = as_a <rtx_insn *> (
  3043                     gen_extend_insn (op0, t, promoted_nominal_mode,
  3044                                      data->passed_mode, unsignedp));

which I mistakenly introduced in r214698.

The result of the gen_extend_insn is a SET, not an insn:

(set (reg/v:DI 151 [ ptrres ])
    (zero_extend:DI (mem/f/c:SI (reg/f:SI 77 virtual-incoming-args) [8 ptrres+0 S4 A64])))

hence the as_a <rtx_insn *> fails.

Am attaching a patch which appears to fix it.
Comment 5 David Malcolm 2014-08-29 03:12:34 UTC
Author: dmalcolm
Date: Fri Aug 29 03:12:01 2014
New Revision: 214714

URL: https://gcc.gnu.org/viewcvs?rev=214714&root=gcc&view=rev
Log:
	PR bootstrap/62300
	* function.c (assign_parm_setup_reg): Remove erroneous checked
	cast to rtx_insn * on result of gen_extend_insn in favor of
	introducing a new local rtx "pat".


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/function.c
Comment 6 Dave Malcolm 2014-08-29 03:13:06 UTC
Fix committed as r214714.
Comment 7 Richard Biener 2014-08-29 08:57:29 UTC
Fixed.