aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRobert Dubner <rdubner@symas.com>2025-08-19 23:08:48 -0400
committerRobert Dubner <rdubner@symas.com>2025-08-19 23:29:43 -0400
commite78eb2f85b9b61cf193dfc721bbd58966bea76df (patch)
tree9f839c5e9185d406bbb2c037b6bd19c81349a243 /gcc
parent2478bdf175d8804d49925b0109cac0bc4e2cb802 (diff)
downloadgcc-e78eb2f85b9b61cf193dfc721bbd58966bea76df.zip
gcc-e78eb2f85b9b61cf193dfc721bbd58966bea76df.tar.gz
gcc-e78eb2f85b9b61cf193dfc721bbd58966bea76df.tar.bz2
cobol: Eliminate errors that cause valgrind messages.
gcc/cobol/ChangeLog: * genutil.cc (get_binary_value): Fix a comment. * parse.y: udf_args_valid(): Fix loc calculation. * symbols.cc (assert): extend_66_capacity(): Avoid assert(e < e2) in -O0 build until symbol_table expansion is fixed. libgcobol/ChangeLog: * libgcobol.cc (format_for_display_internal): Handle NumericDisplay properly. (compare_88): Fix memory access error. (__gg__unstring): Likewise.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cobol/genutil.cc2
-rw-r--r--gcc/cobol/parse.y5
-rw-r--r--gcc/cobol/symbols.cc10
3 files changed, 15 insertions, 2 deletions
diff --git a/gcc/cobol/genutil.cc b/gcc/cobol/genutil.cc
index 3682b10..4b296e4 100644
--- a/gcc/cobol/genutil.cc
+++ b/gcc/cobol/genutil.cc
@@ -819,7 +819,7 @@ get_binary_value( tree value,
}
ELSE
{
- // We are dealing with an ordinary NumericEdited value
+ // We are dealing with an ordinary NumericDisplay value
gg_assign(pointer, source_address);
if( rdigits )
diff --git a/gcc/cobol/parse.y b/gcc/cobol/parse.y
index 59cc64d..039cb95 100644
--- a/gcc/cobol/parse.y
+++ b/gcc/cobol/parse.y
@@ -11959,7 +11959,10 @@ current_t::udf_args_valid( const cbl_label_t *L,
if( arg.field ) { // else omitted
auto tgt = cbl_field_of(symbol_at(udf.linkage_fields.at(i).isym));
if( ! valid_move(tgt, arg.field) ) {
- auto loc = symbol_field_location(field_index(arg.field));
+ auto loc = current_location;
+ if( ! is_temporary(arg.field) ) {
+ loc = symbol_field_location(field_index(arg.field));
+ }
error_msg(loc, "FUNCTION %s argument %zu, '%s' cannot be passed to %s, type %s",
L->name, i, arg.field->pretty_name(),
tgt->pretty_name(), 3 + cbl_field_type_str(tgt->type) );
diff --git a/gcc/cobol/symbols.cc b/gcc/cobol/symbols.cc
index f2cd1b5..bbe99b6 100644
--- a/gcc/cobol/symbols.cc
+++ b/gcc/cobol/symbols.cc
@@ -1598,7 +1598,17 @@ extend_66_capacity( cbl_field_t *alias ) {
symbol_elem_t *e = symbol_at(alias->parent);
symbol_elem_t *e2 =
reinterpret_cast<symbol_elem_t*>(const_cast<char*>(alias->data.picture));
+#ifndef __OPTIMIZE__
+#pragma message "The assert(e < e2) needs fixing"
+ // The following assert fails when valgrind is involved. This is the known
+ // problem of expecting mmap() to put new memory maps after older memory
+ // maps; that assumption fails when valgrind is involved.
+
+ // For now I am defeating the assert when using -O0 so that I can run the
+ // NIST "make valgrind" tests. But this should be fixed so that the
+ // symbol table index is used, not the entry locations.
assert(e < e2);
+#endif
alias->data.picture = NULL;
capacity_of cap;