This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [PATCH, Fortran, pr78672, ctp1, v1] Gfortran test suite failures with a sanitized compiler
- From: Jerry DeLisle <jvdelisle at charter dot net>
- To: fortran at gcc dot gnu dot org
- Date: Thu, 8 Dec 2016 12:06:48 -0800
- Subject: Re: [PATCH, Fortran, pr78672, ctp1, v1] Gfortran test suite failures with a sanitized compiler
- Authentication-results: sourceware.org; auth=none
- References: <20161208143937.0153b2a8@vepi2>
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