Bug 48422 - [4.7 Regression] bootstrap failure for i686-*-* targets by ICE
Summary: [4.7 Regression] bootstrap failure for i686-*-* targets by ICE
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.7.0
: P3 normal
Target Milestone: 4.7.0
Assignee: Not yet assigned to anyone
URL:
Keywords: build, ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2011-04-03 07:45 UTC by Kai Tietz
Modified: 2011-04-03 20:10 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kai Tietz 2011-04-03 07:45:25 UTC
The following trivial program leads to an ICE.

t_ice.f90:
program main

end

------------------

$ i686-w64-mingw32-gfortran.exe -c -o t.o t_ice.f90
t_ice.f90: In function 'main':
t_ice.f90:3:0: internal compiler error: in lhd_set_decl_assembler_name, at langhooks.c:158
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
Comment 1 Tobias Burnus 2011-04-03 15:30:55 UTC
Kai wrote in #gcc that it is due to Rev. 171862.

http://gcc.gnu.org/ml/gcc-cvs/2011-04/msg00054.html
Comment 2 Eric Botcazou 2011-04-03 16:23:41 UTC
> Kai wrote in #gcc that it is due to Rev. 171862.
> 
> http://gcc.gnu.org/ml/gcc-cvs/2011-04/msg00054.html

This patch is a no-op except for Ada.  You probably didn't rebuild the entire compiler, did you?  If no, there are very likely missing dependencies in the Fortran Makefile fragment, namely:

fortran/f95-lang.o: $(GFORTRAN_TRANS_DEPS) fortran/mathbuiltins.def \
  gt-fortran-f95-lang.h gtype-fortran.h $(CGRAPH_H) $(TARGET_H) fortran/cpp.h \
  $(BUILTINS_DEF) fortran/types.def \
  libfuncs.h expr.h
Comment 3 Kai Tietz 2011-04-03 17:10:22 UTC
Yes, a complete rebuild fixed the issue.

The following patch to fortran/Make-lang.in should solve this also for a partial rebuild:

Index: Make-lang.in
===================================================================
--- Make-lang.in        (revision 171910)
+++ Make-lang.in        (working copy)
@@ -336,7 +336,7 @@
 fortran/f95-lang.o: $(GFORTRAN_TRANS_DEPS) fortran/mathbuiltins.def \
   gt-fortran-f95-lang.h gtype-fortran.h $(CGRAPH_H) $(TARGET_H) fortran/cpp.h \

   $(BUILTINS_DEF) fortran/types.def \
-  libfuncs.h expr.h
+  libfuncs.h expr.h langhooks.h
 fortran/scanner.o: toplev.h fortran/cpp.h
 fortran/convert.o: $(GFORTRAN_TRANS_DEPS)
 fortran/frontend-passes.o: $(GFORTRAN_TRANS_DEPS)

Ok for apply?
Comment 4 Eric Botcazou 2011-04-03 17:36:28 UTC
> Ok for apply?

Other languages have langhooks.h $(LANGHOOKS_DEF_H) here.  There are other missing dependencies for this file though.
Comment 5 Kai Tietz 2011-04-03 19:01:57 UTC
Yes, there are. I added the most obvious one now to my patch.

Index: Make-lang.in
===================================================================
--- Make-lang.in        (revision 171910)
+++ Make-lang.in        (working copy)
@@ -336,7 +336,8 @@
 fortran/f95-lang.o: $(GFORTRAN_TRANS_DEPS) fortran/mathbuiltins.def \
   gt-fortran-f95-lang.h gtype-fortran.h $(CGRAPH_H) $(TARGET_H) fortran/cpp.h \
   $(BUILTINS_DEF) fortran/types.def \
-  libfuncs.h expr.h
+  $(TM_H) debug.h langhooks.h $(FLAGS_H) $(EXPR_H) $(LANGHOOKS_DEF_H) \
+  libfuncs.h expr.h $(DIAGNOSTIC_H)
 fortran/scanner.o: toplev.h fortran/cpp.h
 fortran/convert.o: $(GFORTRAN_TRANS_DEPS)
 fortran/frontend-passes.o: $(GFORTRAN_TRANS_DEPS)

ok for apply?
Comment 6 Tobias Burnus 2011-04-03 20:04:49 UTC
(In reply to comment #5)
> Yes, there are. I added the most obvious one now to my patch.
[...]
> ok for apply?

OK. I think there are more (esp. for other files), but I think it should cover the most important omissions. Thanks for the patch!
Comment 7 Kai Tietz 2011-04-03 20:09:52 UTC
Author: ktietz
Date: Sun Apr  3 20:09:46 2011
New Revision: 171916

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=171916
Log:
2011-04-03  Kai Tietz  <ktietz@redhat.com>

        PR middle-end/48422
        * Make-lang.in (f95-lang.o): Add some missing dependencies.


Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/Make-lang.in
Comment 8 Kai Tietz 2011-04-03 20:10:25 UTC
Fixed.