ICEs with -O[123s], likely due to the VIEW_CONVERT_EXPR we construct from *((int*)&f) after inlining. struct FTprocCompressor { float * _amp; float * _env; float * _as; }; static inline int f_round(float f) { return *((int*)&f) - 0x4b400000; } void process (struct FTprocCompressor *_this, float *attack, float *release, float *data, unsigned int fftn) { float ga; float gr; float att, rel; int fftN2 = (fftn+1) >> 1; int i; for (i = 0; i < fftN2-1; i++) { att = ((attack[i])<(0.002f)?(0.002f):((attack[i])>(1.0f)?(1.0f):(attack[i]))); rel = ((release[i])<(att)?(att):((release[i])>(1.0f)?(1.0f):(release[i]))); ga = _this->_as[f_round(att * (float)(256 -1))]; gr = _this->_as[f_round(rel * (float)(256 -1))]; if (_this->_amp[i] > _this->_env[i]) { _this->_env[i] = _this->_env[i] * ga + _this->_amp[i] * (1.0f - ga); _this->_env[i] = _this->_env[i] * gr + _this->_amp[i] * (1.0f - gr); } } }
Reduced testcase: static inline int foo (float f) { return *((int *) &f) - 1; } float bar (float x, float y, float *z) { float c = y < 0.002f ? 0.002f : y; float d = x < c ? c : x; return z[foo (c)] + z[foo (d * 255.0f)]; }
It is caused by revision 138804: http://gcc.gnu.org/ml/gcc-cvs/2008-08/msg00363.html
A patch is posted at http://gcc.gnu.org/ml/gcc-patches/2009-02/msg00937.html
The updated patch is at http://gcc.gnu.org/ml/gcc-patches/2009-02/msg00939.html
A new patch is at http://gcc.gnu.org/ml/gcc-patches/2009-02/msg00961.html
An updated patch is at http://gcc.gnu.org/ml/gcc-patches/2009-02/msg01171.html
Subject: Bug 39241 Author: hjl Date: Wed Feb 25 18:49:28 2009 New Revision: 144430 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=144430 Log: gcc/ 2008-02-25 H.J. Lu <hongjiu.lu@intel.com> PR rtl-optimization/39241 * jump.c (rtx_renumbered_equal_p): Remove 2 superfluous calls to subreg_offset_representable_p. gcc/testsuite/ 2008-02-25 H.J. Lu <hongjiu.lu@intel.com> PR rtl-optimization/39241 * gcc.dg/torture/pr39241.c: New. Added: trunk/gcc/testsuite/gcc.dg/torture/pr39241.c Modified: trunk/gcc/ChangeLog trunk/gcc/jump.c trunk/gcc/testsuite/ChangeLog
Subject: Bug 39241 Author: hjl Date: Wed Feb 25 18:55:14 2009 New Revision: 144431 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=144431 Log: 2009-02-25 H.J. Lu <hongjiu.lu@intel.com> Backport from mainline: 2008-02-25 H.J. Lu <hongjiu.lu@intel.com> PR rtl-optimization/39241 * gcc.dg/torture/pr39241.c: New. Added: branches/gcc-4_3-branch/gcc/testsuite/gcc.dg/torture/pr39241.c - copied unchanged from r144430, trunk/gcc/testsuite/gcc.dg/torture/pr39241.c Modified: branches/gcc-4_3-branch/gcc/testsuite/ChangeLog
Fixed.