Bug 39241 - [4.4 Regression] ICE in subreg_get_info, at rtlanal.c:3104
Summary: [4.4 Regression] ICE in subreg_get_info, at rtlanal.c:3104
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: rtl-optimization (show other bugs)
Version: 4.4.0
: P1 normal
Target Milestone: 4.4.0
Assignee: Not yet assigned to anyone
URL: http://gcc.gnu.org/ml/gcc-patches/200...
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2009-02-19 12:40 UTC by Richard Biener
Modified: 2009-02-25 18:55 UTC (History)
2 users (show)

See Also:
Host:
Target: i?86-*-*
Build:
Known to work:
Known to fail:
Last reconfirmed: 2009-02-19 15:44:25


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Biener 2009-02-19 12:40:40 UTC
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);
        }
    }
}
Comment 1 Jakub Jelinek 2009-02-19 13:16:59 UTC
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)];
}
Comment 2 H.J. Lu 2009-02-19 15:44:25 UTC
It is caused by revision 138804:

http://gcc.gnu.org/ml/gcc-cvs/2008-08/msg00363.html
Comment 3 H.J. Lu 2009-02-20 01:21:13 UTC
A patch is posted at

http://gcc.gnu.org/ml/gcc-patches/2009-02/msg00937.html
Comment 4 H.J. Lu 2009-02-20 01:58:10 UTC
The updated patch is at

http://gcc.gnu.org/ml/gcc-patches/2009-02/msg00939.html
Comment 5 H.J. Lu 2009-02-20 17:14:49 UTC
A new patch is at

http://gcc.gnu.org/ml/gcc-patches/2009-02/msg00961.html
Comment 6 H.J. Lu 2009-02-25 15:52:14 UTC
An updated patch is at

http://gcc.gnu.org/ml/gcc-patches/2009-02/msg01171.html
Comment 7 hjl@gcc.gnu.org 2009-02-25 18:49:43 UTC
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

Comment 8 hjl@gcc.gnu.org 2009-02-25 18:55:27 UTC
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

Comment 9 H.J. Lu 2009-02-25 18:55:47 UTC
Fixed.