[Bug target/41240] [4.5 regression] ICE: in get_attr_got, at config/mips/mips.md:455 building stage1 N64 libgcc

2009-10-05 Thread pinskia at gcc dot gnu dot org


-- 

pinskia at gcc dot gnu dot org changed:

   What|Removed |Added

   Target Milestone|--- |4.5.0


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



[Bug target/41240] [4.5 regression] ICE: in get_attr_got, at config/mips/mips.md:455 building stage1 N64 libgcc

2009-09-03 Thread aoliva at gcc dot gnu dot org


--- Comment #9 from aoliva at gcc dot gnu dot org  2009-09-03 21:32 ---
Richard Sandiford has already fixed this, and he has indeed excluded debug
insns from USEFUL_INSN_P.


-- 

aoliva at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||aoliva at gcc dot gnu dot
   ||org, rdsandiford at
   ||googlemail dot com
 Status|UNCONFIRMED |RESOLVED
 Resolution||FIXED


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



[Bug target/41240] [4.5 regression] ICE: in get_attr_got, at config/mips/mips.md:455 building stage1 N64 libgcc

2009-09-03 Thread aoliva at gcc dot gnu dot org


--- Comment #8 from aoliva at gcc dot gnu dot org  2009-09-03 21:28 ---
Just started looking into the proposed patch and, without actually looking at
the code, I wonder: should USEFUL_INSN_P really hold for debug insns?  I mean,
they're useful for something, but maybe not in the sense of that macro :-)


-- 


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



[Bug target/41240] [4.5 regression] ICE: in get_attr_got, at config/mips/mips.md:455 building stage1 N64 libgcc

2009-09-03 Thread ro at techfak dot uni-bielefeld dot de


--- Comment #7 from ro at techfak dot uni-bielefeld dot de  2009-09-03 
13:53 ---
Subject: Re:  [4.5 regression] ICE: in get_attr_got, at config/mips/mips.md:455
building stage1 N64 libgcc

> --- Comment #5 from ubizjak at gmail dot com  2009-09-03 13:08 ---
> (In reply to comment #3)
> 
> > I'm sort of stuck now.
> 
> Add -save-temps to failing command on a native compiler, create a 
> crosscompiler
> on i.e. x86_64 and debug ../gcc/cc1 from crosscompiler with -O2 -g
> .i in x86_64 host. You don't even need to create binutils cross to
> create cc1, although the full build won't finish.

Good point: I routinely forget about cross compilers until I really have
to.  This was really beneficial in this case, since the X4450 is a *much*
faster box.  I did have to build cross binutils, though, since the bug is
only triggered when certain assembler features are present (I haven't
checked exactly which ones, but a cross compiler without a cross gas 2.19.1
didn't ICE).

I've come up with the following patch, similar to your's for the alpha:

2009-09-03  Rainer Orth  

PR target/41240
* config/mips/mips.c (mips_function_has_gp_insn): Ignore debug insn.

Index: config/mips/mips.c
===
--- config/mips/mips.c  (revision 151371)
+++ config/mips/mips.c  (working copy)
@@ -8579,7 +8579,7 @@

   push_topmost_sequence ();
   for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
-   if (USEFUL_INSN_P (insn)
+   if (USEFUL_INSN_P (insn) && !DEBUG_INSN_P (insn)
&& (get_attr_got (insn) != GOT_UNSET
|| mips_small_data_pattern_p (PATTERN (insn
  {

With it, my testcase passed and the cross-build ran until it hit missing
target headers.  I'm now continuing the really bootstrap and will submit it
once that finishes.

Thanks alot.

Rainer


-- 


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



[Bug target/41240] [4.5 regression] ICE: in get_attr_got, at config/mips/mips.md:455 building stage1 N64 libgcc

2009-09-03 Thread ro at techfak dot uni-bielefeld dot de


--- Comment #6 from ro at techfak dot uni-bielefeld dot de  2009-09-03 
13:09 ---
Subject: Re:  [4.5 regression] ICE: in get_attr_got, at config/mips/mips.md:455
building stage1 N64 libgcc

> --- Comment #4 from jakub at gcc dot gnu dot org  2009-09-03 13:03 ---
> Just try latest CVS gdb, or apply the 2 fixes recently mentioned on 
> gcc-patches
> ml (DW_CFA_restore_state gdb fix and DW_LNE_set_distriminator fix), or just
> recompile anything you see in the backtrace with -g -O0.

gdb 6.8 should be able to cope with gcc 3.4.5 output, and since this is in
stage1, everything was already built with -g only.

I'll try the CVS gdb to see if this helps.

Rainer


-- 


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



[Bug target/41240] [4.5 regression] ICE: in get_attr_got, at config/mips/mips.md:455 building stage1 N64 libgcc

2009-09-03 Thread ubizjak at gmail dot com


--- Comment #5 from ubizjak at gmail dot com  2009-09-03 13:08 ---
(In reply to comment #3)

> I'm sort of stuck now.

Add -save-temps to failing command on a native compiler, create a crosscompiler
on i.e. x86_64 and debug ../gcc/cc1 from crosscompiler with -O2 -g
.i in x86_64 host. You don't even need to create binutils cross to
create cc1, although the full build won't finish.


-- 


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



[Bug target/41240] [4.5 regression] ICE: in get_attr_got, at config/mips/mips.md:455 building stage1 N64 libgcc

2009-09-03 Thread jakub at gcc dot gnu dot org


--- Comment #4 from jakub at gcc dot gnu dot org  2009-09-03 13:03 ---
Just try latest CVS gdb, or apply the 2 fixes recently mentioned on gcc-patches
ml (DW_CFA_restore_state gdb fix and DW_LNE_set_distriminator fix), or just
recompile anything you see in the backtrace with -g -O0.


-- 


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



[Bug target/41240] [4.5 regression] ICE: in get_attr_got, at config/mips/mips.md:455 building stage1 N64 libgcc

2009-09-03 Thread ro at techfak dot uni-bielefeld dot de


--- Comment #3 from ro at techfak dot uni-bielefeld dot de  2009-09-03 
12:45 ---
Subject: Re:  [4.5 regression] ICE: in get_attr_got, at config/mips/mips.md:455
building stage1 N64 libgcc

> --- Comment #1 from ubizjak at gmail dot com  2009-09-03 11:17 ---
> get_attr_* does not work with DEBUG_INSN instructions. Backtrace will tell you
> where to put NONDEBUG_INSN_P instead of INSN_P.

Unfortunately, gdb 6.8 cannot cope with the debug information created by
either gcc 3.4.5 (my current bootstrap compiler) or mainline as of 20090828
(pre-VTA):

#0  fancy_abort (file=0x10fd1be0
"/vol/gcc/src/gcc-dist/gcc/config/mips/mips.md", line=455, function=0x10fd8590
"get_attr_got") at /vol/gcc/src/gcc-dist/gcc/diagnostic.c:728
#1  0x10aab0f4 in _fatal_insn (msgid=0x10fe9df8 "unrecognizable insn:",
insn=0x41b8c60, file=0x10fd1be0
"/vol/gcc/src/gcc-dist/gcc/config/mips/mips.md", line=455, function=0x10fd8590
"get_attr_got") at /vol/gcc/src/gcc-dist/gcc/rtl-error.c:112
#2  0x10aab158 in _fatal_insn_not_found (insn=0x41b8c60, file=0x10fd1be0
"/vol/gcc/src/gcc-dist/gcc/config/mips/mips.md", line=455, function=0x10fd8590
"get_attr_got") at /vol/gcc/src/gcc-dist/gcc/rtl-error.c:120
#3  0x10a06d9c in get_attr_got (insn=0x41b8c60) at
/vol/gcc/src/gcc-dist/gcc/config/mips/mips.md:455
#4  0x10232148 in ?? ()
#5  0x10232434 in ?? ()
#6  0x10232d78 in ?? ()
#7  0x10234098 in mips_initial_elimination_offset (from=77, to=29) at
/vol/gcc/src/gcc-dist/gcc/config/mips/mips.c:9124
#8  0x101fdc54 in ?? ()
#9  0x101f3ce8 in reload (first=0x41b8600, global=1) at
/vol/gcc/src/gcc-dist/gcc/reload1.c:971
#10 0x101d8c58 in ?? ()
#11 0x101d92a8 in ?? ()
#12 0x1070fd38 in ?? ()
#13 0x10710184 in execute_pass_list (pass=0x11067900) at
/vol/gcc/src/gcc-dist/gcc/passes.c:1341
#14 0x107101b0 in execute_pass_list (pass=0x11069310) at
/vol/gcc/src/gcc-dist/gcc/passes.c:1342
#15 0x10c15be8 in tree_rest_of_compilation (fndecl=0x412dd00) at
/vol/gcc/src/gcc-dist/gcc/tree-optimize.c:390
#16 0x10acbcd8 in ?? ()
#17 0x10acbfc4 in ?? ()
#18 0x10acca44 in ?? ()
#19 0x10acb840 in cgraph_finalize_compilation_unit () at
/vol/gcc/src/gcc-dist/gcc/cgraphunit.c:1042
#20 0x100b22a4 in c_write_global_declarations () at
/vol/gcc/src/gcc-dist/gcc/c-decl.c:9378
#21 0x101c2e54 in ?? ()
#22 0x101c63c8 in ?? ()
#23 0x101c6528 in toplev_main (argc=5, argv=0x7ffb7ef4) at
/vol/gcc/src/gcc-dist/gcc/toplev.c:2414
#24 0x101a5d40 in main (argc=5, argv=0x7ffb7ef4) at
/vol/gcc/src/gcc-dist/gcc/main.c:35

The line number in mips.md is useless since it's inside a comment.

The 4.5 backtrace is even less useful since gdb aborts at some point:

#0  fancy_abort (file=0x11001a98
"/vol/gcc/src/gcc-dist/gcc/config/mips/mips.md", line=455, function=0x1100eaf0
"get_attr_got") at /vol/gcc/src/gcc-dist/gcc/diagnostic.c:728
#1  0x10aab1ac in _fatal_insn (msgid=0x11019cc0 "unrecognizable insn:",
insn=0x41b8c60, file=0x11001a98
"/vol/gcc/src/gcc-dist/gcc/config/mips/mips.md", line=455, function=0x1100eaf0
"get_attr_got") at /vol/gcc/src/gcc-dist/gcc/rtl-error.c:112
#2  0x10aab214 in _fatal_insn_not_found (insn=0x41b8c60, file=0x11001a98
"/vol/gcc/src/gcc-dist/gcc/config/mips/mips.md", line=455, function=0x1100eaf0
"get_attr_got") at /vol/gcc/src/gcc-dist/gcc/rtl-error.c:120
#3  0x109fe898 in get_attr_got (insn=0x41b8c60) at
/vol/gcc/src/gcc-dist/gcc/config/mips/mips.md:455
#4  0x102310b8 in ?? ()
warning: GDB can't find the start of the function at 0x102310b7.

GDB is unable to find the start of the function at 0x102310b7
and thus can't determine the size of that function's stack frame.
This means that GDB may be unable to access that stack frame, or
the frames below it.
This problem is most likely caused by an invalid program counter or
stack pointer.
However, if you think GDB should simply search farther back
from 0x102310b7 for code which looks like the beginning of a
function, you can increase the range of the search using the `set
heuristic-fence-post' command.
Backtrace stopped: previous frame inner to this frame (corrupt stack?)

I'm sort of stuck now.

Rainer


-- 


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



[Bug target/41240] [4.5 regression] ICE: in get_attr_got, at config/mips/mips.md:455 building stage1 N64 libgcc

2009-09-03 Thread ubizjak at gmail dot com


--- Comment #2 from ubizjak at gmail dot com  2009-09-03 11:24 ---
FYI, similar failure happens on alpha, fixed by:

Index: config/alpha/alpha.c
===
--- config/alpha/alpha.c(revision 151367)
+++ config/alpha/alpha.c(working copy)
@@ -7664,7 +7664,7 @@ alpha_does_function_need_gp (void)
   pop_topmost_sequence ();

   for (; insn; insn = NEXT_INSN (insn))
-if (INSN_P (insn)
+if (NONDEBUG_INSN_P (insn)
&& ! JUMP_TABLE_DATA_P (insn)
&& GET_CODE (PATTERN (insn)) != USE
&& GET_CODE (PATTERN (insn)) != CLOBBER


-- 


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



[Bug target/41240] [4.5 regression] ICE: in get_attr_got, at config/mips/mips.md:455 building stage1 N64 libgcc

2009-09-03 Thread ubizjak at gmail dot com


--- Comment #1 from ubizjak at gmail dot com  2009-09-03 11:17 ---
get_attr_* does not work with DEBUG_INSN instructions. Backtrace will tell you
where to put NONDEBUG_INSN_P instead of INSN_P.


-- 


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