Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 555418 - sys-devel/gcc-4.8.4: internal compiler error: in assign_by_spills, at lra-assigns.c:1281 on mips
Summary: sys-devel/gcc-4.8.4: internal compiler error: in assign_by_spills, at lra-ass...
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: MIPS Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-20 07:37 UTC by abo junghichi
Modified: 2015-10-22 14:03 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
input C source (mips.c,3.54 KB, text/x-csrc)
2015-07-20 07:37 UTC, abo junghichi
Details
emerge --info (emerge.info,4.92 KB, application/x-info)
2015-07-20 07:39 UTC, abo junghichi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description abo junghichi 2015-07-20 07:37:36 UTC
Created attachment 407214 [details]
input C source

When compiling the files attached here with gcc-4.8.4, gcc reports internal error.

How to produce:

$ gcc --version
gcc (Gentoo 4.8.4 p1.6, pie-0.6.1) 4.8.4
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ gcc -O0 -S mips.c #(attached file)
mips.c: In function 'engine':
mips.c:137:1: internal compiler error: in assign_by_spills, at lra-assigns.c:1281
 }
 ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://bugs.gentoo.org/> for instructions.

then, gcc always produces the below message.

A way to avoid it:

below patch works.

----
--- mips.c      2015-07-20 15:45:10.395036405 +0900
+++ mips.no.c   2015-07-20 16:05:10.831234318 +0900
@@ -37,9 +37,9 @@
     int i;
     int rtn = 0;
     void *ijops[64], *rops[64];
-    register uint32_t inst asm("edx");
-    register uint32_t pc_exec asm("ebx") = statep->pc_exec;
-    register uint32_t pc asm("ecx") = statep->pc;
+    /* register */ uint32_t inst asm("edx");
+    /* register */ uint32_t pc_exec asm("ebx") = statep->pc_exec;
+    /* register */ uint32_t pc asm("ecx") = statep->pc;
     uint32_t *r = statep->r;
 /* */
 #define COME(name) op_##name: { uint32_t ninst = memory[pc], pc_done = pc_exec; void *nlabel = engine_decode(ijops, rops, ninst); pc_exec = pc++
----

I met this bug when I'm trying to make gcc produce good threaded code.
To make gcc replicate indirect-jump code at each tail of basic blocks,
I put some inline_assembler just before indirect-jumps.
These inline_assemblers pritend to access all registers.
So, when inline_assemblers is done, no works expect indirect-jump is left.
This method stricts gcc allocating registers very tight.
I guess, it does so tight to kill gcc.
Comment 1 abo junghichi 2015-07-20 07:39:25 UTC
Created attachment 407216 [details]
emerge --info
Comment 2 Ryan Hill (RETIRED) gentoo-dev 2015-07-23 00:57:20 UTC
4.8.5: ICE
4.9.3: Works

Please attach preprocessed source (-save-temps).
Comment 3 SpanKY gentoo-dev 2015-10-22 14:03:43 UTC
gcc-4.9 is stable now, so throwing away older bugs we don't plan on doing backports for