From jeroen.ooms at stat.ucla.edu  Mon Sep 14 20:49:37 2015
From: jeroen.ooms at stat.ucla.edu (Jeroen Ooms)
Date: Mon, 14 Sep 2015 20:49:37 +0200
Subject: [Rd] Optimization bug when byte compiling with gcc 5.2.0 on
	windows
In-Reply-To: <55F6D6A7.3060603@gmail.com>
References: <CABFfbXsdT2-jBdaqr4oCtZ2AvBWZ++tQHa49DyWc=m3G_qE7bw@mail.gmail.com>
	<alpine.LFD.2.20.1509140826370.19382@itasca.stat.uiowa.edu>
	<55F6D6A7.3060603@gmail.com>
Message-ID: <CABFfbXtsZwUhQGdVG-3OAq_bReZGNkSJ2SRVpXkrFT06a7AuYg@mail.gmail.com>

On Mon, Sep 14, 2015 at 4:16 PM, Duncan Murdoch
<murdoch.duncan at gmail.com> wrote:
> I think the reason for the earlier restriction is the assumption that
> eventually gcc will be fixed and this workaround won't be necessary, but
> apparently 5.2.0 still has the same problem.

I tested this hypothesis by replacing '__GNUC__ <= 4' with '__GNUC__
<= 5' and rebuilding R, but this introduces a whole lot of problems
that were not there before. In particular R crashes when using the
graphics device, which it did not without this fix.

I first thought this was an unrelated random crash, but 'make check'
consistently fails in base-Ex.R at the first invocation of boxplot().
Same for 'check recommended', each package fails when making a plot.
None of this happens with the original source code, where everything
works fine, besides the optimized version of sqrt(NA) giving NaN. Did
something perhaps change in gcc 5 for the ISNAN macro that makes it
unsuitable to be used in this way?

FWIW it looks like the original fix was introduced by Luke about a
year ago in r66652:
https://github.com/wch/r-source/commit/e9aaf8fdeddf27c2a9078cd214a41475c8ff6f40



[Rd] Optimization bug when byte compiling with gcc 5.2.0 on windows
Jeroen Ooms