This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/17076] New: ICE on variable size array initialization in debug mode in C++


An internal compiler error in G++ version 3.4.1 in debug mode using variable
size arrays.  The size of the array is taken from the member of a struct that is
returned by a function.  The source is in preprocessed C++.  

----------BEGIN FILE bug.ii---------
struct Integer
{
	int x;
};

Integer f()
{
	return (Integer){45};
}

int main()
{
	int numbers[f().x];
	return 0;
}
------END FILE bug.ii-----------

Sample session:

$ g++ bug.ii
$ g++ -g bug.ii
bug.ii: In function `int main()':
bug.ii:15: internal compiler error: in loc_descriptor_from_tree, at dwarf2out.c:8863
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
$ gcc --version
gcc (GCC) 3.4.1

Notes:
-When compiled as the file "bug.i" using "gcc", no ICE happens and the compiler
reports an error.
-I don't know whether the code is correct.
-The ICE could not be reproduced in gcc 3.3.3 on i686-suse-linux.

-- 
           Summary: ICE on variable size array initialization in debug mode
                    in C++
           Product: gcc
           Version: 3.4.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: kunegis at cs dot tu-berlin dot de
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: sparc-sun-solaris2.9
  GCC host triplet: sparc-sun-solaris2.9
GCC target triplet: sparc-sun-solaris2.9


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]