https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118059
Bug ID: 118059
Summary: [15 Regression] ubsan instrumented gcc: valid value
for type 'expr_t' in gcc/fortran/trans-expr.cc
Product: gcc
Version: 15.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: pheeck at gcc dot gnu.org
Blocks: 63426
Target Milestone: ---
Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
Running current trunk gcc instrumented with ubsan on the gcc testsuite testcase
gfortran.dg/class_transformational_1.f90 results in
gcc gcc/testsuite/gfortran.dg/class_transformational_1.f90
/home/worker/buildworker/tiber-gcc-ubsan/build/gcc/fortran/trans-expr.cc:11397:33:
runtime error: load of value 1818451807, which is not a valid value for type
'expr_t'
This is how the relevant location in trans-expr.cc looks like
11392 /* Character array functions need temporaries unless the
11393 character lengths are the same. */
11394 if (expr2->ts.type == BT_CHARACTER && expr2->rank > 0)
11395 {
11396 if (expr1->ts.u.cl->length == NULL
11397 || expr1->ts.u.cl->length->expr_type != EXPR_CONSTANT)
11398 return true;
11399
11400 if (expr2->ts.u.cl->length == NULL
11401 || expr2->ts.u.cl->length->expr_type != EXPR_CONSTANT)
11402 return true;
11403
11404 if (mpz_cmp (expr1->ts.u.cl->length->value.integer,
11405 expr2->ts.u.cl->length->value.integer) != 0)
11406 return true;
11407 }
Maybe this is similar to pr117901? I'm just guessing based on the same
testsuite file being involved.
Referenced Bugs:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63426
[Bug 63426] [meta-bug] Issues found with -fsanitize=undefined