[PATCH, Fortran, pr78672, ctp1, v1] Gfortran test suite failures with a sanitized compiler

Jerry DeLisle jvdelisle@charter.net
Thu Dec 8 20:06:00 GMT 2016


On 12/08/2016 05:39 AM, Andre Vehreschild wrote:
> Hi all, hi Dominique,
>
> this is the "compile time part 1" (ctp1) patch to fix the issues reported in
> gfortran by a sanitized compiler when compiling the testsuite. The patch
> addresses all issues besides leaks (ASAN_OPTIONS="detect_leaks=false". Most of
> the issues were about assuming certain kinds of data without explicitly
> checking, e.g., taking a component-ref for an array-ref and similar.
>
> So this patch only addresses the -fsanitize=address,undefined reports (without
> leaks) for running the compiler. I liked to keep this patch small to get it
> reviewed quickly.
>

For those of us who don't always get it, can you explain this line:

-  /* There's no ABS for HOST_WIDE_INT, so here we go. It also takes care
-     of the asymmetric range of the integer type.  */
-  n = (unsigned HOST_WIDE_INT) (m < 0 ? -m : m);
+  n = wi::abs (wrhs).to_shwi ();                <======

Jerry





More information about the Fortran mailing list