Thread View: gnu.g++.bug
1 messages
1 total messages
Started by Igor Metz
Mon, 26 Sep 1988 10:57
g++ 1.27.0
Author: Igor Metz
Date: Mon, 26 Sep 1988 10:57
Date: Mon, 26 Sep 1988 10:57
202 lines
9150 bytes
9150 bytes
Hi,
I have some problems with the latest g++ version. I compile it on my
SUN 3/260 (SunOS 3.5) and I get the following warnings from gcc 1.27
===== the beginning ======
gcc -g -c fold-const.c
In function fold:
fold-const.c:1435: warning: comparison is always 0 due to limited range of data type
fold-const.c:1452: warning: comparison is always 0 due to limited range of data type
gcc -g -c expr.c
In function expand_increment:
expr.c:3258: warning: comparison is always 0 due to limited range of data type
expr.c:3258: warning: comparison is always 0 due to limited range of data type
gcc -g -c class.c
In function instantiate_type:
class.c:3454: warning: case value out of range
class.c:3455: warning: case value out of range
class.c:3456: warning: case value out of range
class.c:3457: warning: case value out of range
gcc -g -c method.c
In function dump_init:
method.c:690: warning: case value out of range
method.c:691: warning: case value out of range
method.c:696: warning: case value out of range
method.c:697: warning: case value out of range
gcc -g -c search.c
In function my_tree_cons:
search.c:172: warning: initialization between incompatible pointer types
In function my_build_string:
search.c:186: warning: initialization between incompatible pointer types
==== the end ====
When I then try to compile the following little program, gcc-c++ abort()'s
itself (see below for typescript of gdb session), when it tries to expand
an expression:
==== the beginning ====
#include <stream.h>
const int dim = 10;
class Vektor {
short vec[dim];
public:
Vektor();
short& operator[](int i) { return(vec[i]); }
};
Vektor::Vektor()
{
for (int i= 0; i<dim; i++)
vec[i] = 0; // or any other value needed
}
class Matrix {
Vektor mat[dim];
public :
Vektor& operator[](int i) { return(mat[i]); }
};
main()
{
Matrix m;
int i, j;
for (i=0; i<dim; i++)
for (j=0; j<dim; j++)
m[i][j] = j + i*dim;
for (i=0; i<dim; i++) {
for (j=0; j<dim; j++) cout << m[i][j] << "\t";
cout << "\n";
}
}
==== the end ====
==== the beginning ====
Script started on Mon Sep 26 11:39:01 1988
gina:/u-gina/metz/g++/g++% gdb ~/lib/gcc-c++ core
GDB 2.3, Copyright (C) 1987 Free Software Foundation, Inc.
There is ABSOLUTELY NO WARRANTY for GDB; type "info warranty" for details.
GDB is free software and you are welcome to distribute copies of it
under certain conditions; type "info copying" to see the conditions.
Reading symbol data from /u-gina/metz/lib/gcc-c++...done.
Core file is from "gcc-c++".
Type "help" for a list of commands.
(gdb) whe
#0 0xa3f84 in kill ()
#1 0x337a0 in expand_expr (exp=(tree) 0xd4848, target=(rtx) 0x0,
tmode=VOIDmode, modifier=EXPAND_NORMAL) (expr.c line 3018)
#2 0x372ba in expand_expr_stmt (exp=(tree) 0xd4848) (stmt.c line 752)
#3 0xef90 in yyparse () (parse.y line 1802)
#4 0x3162 in compile_file (name=(char *) 0xefffc30 "/tmp/cca00218.cpp")
(toplev.c line 905)
#5 0x4a28 in main (argc=9, argv=(char **) 0xefffbc8,
envp=(char **) 0xefffbf0) (toplev.c line 1716)
(gdb) up 1
#1 0x337a0 in expand_expr (exp=(tree) 0xd4848, target=(rtx) 0x0,
tmode=VOIDmode, modifier=EXPAND_NORMAL) (expr.c line 3018)
3018 abort ();
(gdb) li
3013
3014 case ERROR_MARK:
3015 return const0_rtx;
3016
3017 default:
3018 abort ();
3019 }
3020
3021 /* Here to do an ordinary binary operator, generating an instruction
3022 from the optab already placed in `this_optab'. */
(gdb) i lo
code = -124
exp = (tree) 0xd4848
ignore = 1
mode = SImode
negate_1 = 251656602
op0 = (rtx) 0xefff698
op1 = (rtx) 0xefffbf0
original_target = (rtx) 0x0
subtarget = (rtx) 0x0
temp = (rtx) 0x9
this_optab = (optab) 0xefff698
type = (tree) 0xd2d90
(gdb) p *exp
$1 = {common = {uid = 13992, chain = 0x0, type = 0xd2d90, code = -2079326208,
external_attr = 0, public_attr = 0, static_attr = 0, volatile_attr = 1,
packed_attr = 0, readonly_attr = 0, literal_attr = 0, nonlocal_attr = 0,
permanent_attr = 0, addressable_attr = 0, regdecl_attr = 0, this_vol_attr = 0,
unsigned_attr = 0, asm_written_attr = 0, overloaded_attr = 0, private_attr =
0, protected_attr = 0, virtual_attr = 0, inline_attr = 0, everused_attr = 0,
has_ctor_attr = 0, needs_ctor_attr = 0, has_dtor_attr = 0, needs_dtor_attr =
0}, int_cst = {common =
{"\000\0006\250\000\000\000\000\000\r-\220\204\020\000\000"}, int_cst_low =
1478668, int_cst_high = 883658}, real_cst = {common =
{"\000\0006\250\000\000\000\000\000\r-\220\204\020\000\000"}, rtl = 0x16900c,
real_cst = 1.87512e-308}, string = {common =
{"\000\0006\250\000\000\000\000\000\r-\220\204\020\000\000"}, rtl = 0x16900c,
length = 883658, pointer = 0xd480c ""}, complex = {common =
{"\000\0006\250\000\000\000\000\000\r-\220\204\020\000\000"}, rtl = 0x16900c,
real = 0xd7bca, imag = 0xd480c}, identifier = {common =
{"\000\0006\250\000\000\000\000\000\r-\220\204\020\000\000"}, length =
1478668, pointer = 0xd7bca "", global_value = 0xd480c, class_value = 0xd486c,
local_value = 0xc91a8, label_value = 0x36ab, implicit_decl = 0x0}, decl =
{common = {"\000\0006\250\000\000\000\000\000\r-\220\204\020\000\000"},
filename = 0x16900c "", linenum = 883658, size = 0xd480c, mode = 870508,
size_unit = 0 '\000', align = 12 '\f', voffset_unit = 145 '\221', name =
0x36ab, original_name = 0x0, context = 0x1664c2, offset = 855638016, voffset =
0xd3824, arguments = 0x166556, result = 0x36ad, initial = 0x0, rtl = 0xd328a,
frame_size = 956301312, saved_insns = 0xd486c, block_symtab_address =
1478668}, type = {common =
{"\000\0006\250\000\000\000\000\000\r-\220\204\020\000\000"}, values =
0x16900c, sep = 0xd7bca, size = 0xd480c, size_unit = 0 '\000', align = 13
'\r', sep_unit = 72 'H', mode = 1811942545, pointer_to = 0xc91a8, reference_to
= 0x36ab, parse_info = 0, symtab_address = 1467586, name = 0x33000000, max =
0xd3824, next_variant = 0x166556, main_variant = 0x36ad}, classtype =
{type_info =
{"\000\0006\250\000\000\000\000\000\r-\220\204\020\000\000\000\026\220\f\000\r{\312\000\rH\f\000\rHl\000\f\221\250\000\0006\253\000\000\000\000\000\026d\3023\000\000\000\000\r8$\000\026eV\000\0006\255"},
type_flags = {has_type_conversion_attr = 0, has_int_conversion_attr = 0,
has_float_conversion_attr = 0, gets_init_ref_attr = 0, gets_new_attr = 0,
gets_delete_attr = 0, has_assignment_attr = 0, gets_assignment_attr = 0,
has_assign_ref_attr = 0, gets_assign_ref_attr = 0, has_wrapper = 0,
needs_wrapper = 0, has_wrapper_pred = 0, has_method_call_overloaded = 0,
gets_init_aggr_attr = 0, has_call_overloaded = 0, has_array_ref_overloaded =
0, any_assigns_this = 0, none_assign_this = 0, uses_multiple_inheritance = 0,
marked = 0, marked2 = 0, marked3 = 0, marked4 = 0, declared_class = 0, dummy_6
= 0}, offset = 0xd328a, vtable = 0x39000000, virtuals = 0xd486c, vfield =
0x16900c, vsize = 13998, n_parents = 0, cid = 863632, types = 0x25020000,
n_ancestors = 0, by_bfs = 0x0, for_bfs = 0x36af, by_dfs = 0x0, for_dfs =
0xd328a, tags = 0x75000000, main_class_variant = 0xd489c, next_class_variant =
0x36b0, memoized_table_entry = 0x0, via_pub_or_virt = 0xd328a "", sep =
0x25020000, size = 0x0, size_unit = 0 '\000', align = 0 '\000', sep_unit = 0
'\000', mode = 54, base_init_list = 0x36b1, member_init_list = 0x0}, list =
{common = {"\000\0006\250\000\000\000\000\000\r-\220\204\020\000\000"},
purpose = 0x16900c, value = 0xd7bca}, exp = {common =
{"\000\0006\250\000\000\000\000\000\r-\220\204\020\000\000"}, operands =
{0x16900c}}, stmt = {common =
{"\000\0006\250\000\000\000\000\000\r-\220\204\020\000\000"}, filename =
0x16900c "", linenum = 883658, body = 0xd480c}, if_stmt = {common =
{"\000\0006\250\000\000\000\000\000\r-\220\204\020\000\000"}, filename =
0x16900c "", linenum = 883658, cond = 0xd480c, thenpart = 0xd486c, elsepart =
0xc91a8}, bind_stmt = {common =
{"\000\0006\250\000\000\000\000\000\r-\220\204\020\000\000"}, filename =
0x16900c "", linenum = 883658, body = 0xd480c, vars = 0xd486c, supercontext =
0xc91a8, bind_size = 0x36ab, type_tags = 0x0}, case_stmt = {common =
{"\000\0006\250\000\000\000\000\000\r-\220\204\020\000\000"}, filename =
0x16900c "", linenum = 883658, index = 0xd480c, case_list = 0xd486c}}
(gdb) q
==== the end ====
In my earlier experiments gcc-cpp+ crashed in malloc until I used the GNUEmacs
version of malloc.
Is there anybody out there who can help???
Thank you in advance
Igor Metz X400: metz@iam.unibe.ch
Institut fuer Informatik ARPA: metz%iam.unibe.ch@relay.cs.net
und angewandte Mathematik UUCP: ..!uunet!mcvax!iam.unibe.ch!metz
Universitaet Bern
Switzerland Phone: (+41) 31 65 49 02
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads