Bug 40061 - [4.3 Regression] Bootstrap failure in dwarf2out.c, function add_subscript_info: 'dimension_number' undefined
Summary: [4.3 Regression] Bootstrap failure in dwarf2out.c, function add_subscript_inf...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: bootstrap (show other bugs)
Version: 4.3.4
: P1 normal
Target Milestone: 4.3.4
Assignee: Not yet assigned to anyone
URL:
Keywords: build
: 40268 40477 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-05-07 13:30 UTC by Gerald Pfeifer
Modified: 2009-06-18 20:06 UTC (History)
4 users (show)

See Also:
Host: alpha-unknown-freebsd6.4
Target:
Build:
Known to work: 4.3.3
Known to fail:
Last reconfirmed: 2009-05-07 14:39:37


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gerald Pfeifer 2009-05-07 13:30:30 UTC
gmake[3]: Entering directory `/usr/ports/lang/gcc43/work/build/gcc'
gcc43 -c   -g -fkeep-inline-functions -DIN_GCC   -W -Wall -Wwrite-strings
-Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition
-Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros
-Wno-overlength-strings -fno-common   -DHAVE_CONFIG_H -I. -I.
-I.././..//gcc-4.3-20090503/gcc -I.././..//gcc-4.3-20090503/gcc/.
-I.././..//gcc-4.3-20090503/gcc/../include
-I.././..//gcc-4.3-20090503/gcc/../libcpp/include -I/usr/local/include
-I.././..//gcc-4.3-20090503/gcc/../libdecnumber
-I.././..//gcc-4.3-20090503/gcc/../libdecnumber/dpd -I../libdecnumber
-I/usr/local/include   .././..//gcc-4.3-20090503/gcc/dwarf2out.c -o
dwarf2out.o
.././..//gcc-4.3-20090503/gcc/dwarf2out.c: In function 'add_subscript_info':
.././..//gcc-4.3-20090503/gcc/dwarf2out.c:11327: error: 'dimension_number'
undeclared (first use in this function)
.././..//gcc-4.3-20090503/gcc/dwarf2out.c:11327: error: (Each undeclared
identifier is reported only once
.././..//gcc-4.3-20090503/gcc/dwarf2out.c:11327: error: for each function it
appears in.)
.././..//gcc-4.3-20090503/gcc/dwarf2out.c:11328: error: break statement not
within loop or switch
gmake[3]: *** [dwarf2out.o] Error 1


I believe this is caused by

 2009-04-24  Tobias Burnus  <burnus@net-b.de>

        PR fortran/39791
        Backport from mainline:

        2008-08-22  Jakub Jelinek  <jakub@redhat.com>

        * dwarf2out.c (add_subscript_info): Stop on Fortran TYPE_STRING_FLAG
        types.
        (gen_array_type_die): Emit DW_TAG_string_type for Fortran character
        types.
Comment 1 Tobias Burnus 2009-05-07 14:39:37 UTC
Confirmed. I need to understand what MIPS_DEBUGGING_INFO means - and why it is not present in 4.4 - but maybe reverting it and suggesting in PR fortran/39791
to use 4.4/4.5 is be safer/better alternative. - Thanks for the report!
Comment 2 Tobias Burnus 2009-05-07 14:51:37 UTC
Stupid but working fix: Reverting the patch for PR 39791 on MIPS_DEBUGGING_INFO only. I think that's the safest to do - even if it is not the most elegant way of doing it. I don't like backporting Rev. 137975 which would be the proper fix as one probably would need more modifications, risking regressions - and that does not seem to be worthwile for PR 39791 on 4.3.x.

--- dwarf2out.c (revision 147216)
+++ dwarf2out.c (working copy)
@@ -11324,8 +11324,11 @@
     {
       tree domain = TYPE_DOMAIN (type);

+#ifndef MIPS_DEBUGGING_INFO
+      /* See PR bootstrap/40061 for the ifndef  */
       if (TYPE_STRING_FLAG (type) && is_fortran () && dimension_number > 0)
        break;
+#endif

       /* Arrays come in three flavors: Unspecified bounds, fixed bounds,
         and (in GNU C only) variable bounds.  Handle all three forms
Comment 3 Jakub Jelinek 2009-05-07 14:58:58 UTC
This patch is correct.
Alternatively, you could define the dimension_number variable unconditionally
(remove #ifndef and #endif around it), initialize it to 0 and not initialize it
in for init expression.  For MIPS_DEBUGGING_INFO, dimension_number is never > 0
in the body of the for cycle in 4.4+...
Comment 4 Tobias Burnus 2009-05-12 19:27:01 UTC
Subject: Bug 40061

Author: burnus
Date: Tue May 12 19:26:46 2009
New Revision: 147445

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=147445
Log:
2009-05-12  Tobias Burnus  <burnus@net-b.de>

        PR bootstrap/40061
        * dwarf2.out.c (add_subscript_info): Initialize dimension for
        MIPS_DEBUGGING_INFO.


Modified:
    branches/gcc-4_3-branch/gcc/ChangeLog
    branches/gcc-4_3-branch/gcc/dwarf2out.c

Comment 5 Tobias Burnus 2009-05-12 19:42:32 UTC
FIXED on the 4.3 branch. Thanks for reporting the problem and sorry for the breakage.
Comment 6 Uroš Bizjak 2009-05-27 08:41:17 UTC
*** Bug 40268 has been marked as a duplicate of this bug. ***
Comment 7 Uroš Bizjak 2009-05-27 08:42:42 UTC
(In reply to comment #5)
> FIXED on the 4.3 branch. Thanks for reporting the problem and sorry for the
> breakage.

Not really, see PR 40268 for description and proposed patch.

Confirmed fail on cross to alpha-linux-gnu.

Comment 8 Richard Biener 2009-06-17 19:46:55 UTC
*** Bug 40477 has been marked as a duplicate of this bug. ***
Comment 9 Richard Biener 2009-06-17 19:48:13 UTC
Still broken.  Please fix ASAP.
Comment 10 Tobias Burnus 2009-06-18 20:06:18 UTC
Subject: Bug 40061

Author: burnus
Date: Thu Jun 18 20:06:04 2009
New Revision: 148668

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=148668
Log:
2009-06-18  Tobias Burnus  <burnus@net-b.de>
            Mikael Pettersson  <mikpe@it.uu.se>

        PR debug/40061
        * dwarf2out.c (add_subscript_info): Fix build for
        MIPS_DEBUGGING_INFO.


Modified:
    branches/gcc-4_3-branch/gcc/ChangeLog
    branches/gcc-4_3-branch/gcc/dwarf2out.c

Comment 11 Tobias Burnus 2009-06-18 20:06:38 UTC
Hopefully now really FIXED.