This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

optimization/2293: ICE in print_rtl_and_abort



>Number:         2293
>Category:       optimization
>Synopsis:       Internal compiler error in print_rtl_and_abort, at flow.c:6601
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          ice-on-legal-code
>Submitter-Id:   net
>Arrival-Date:   Thu Mar 15 12:26:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Dirk Mueller
>Release:        3.0 20010315 (prerelease)
>Organization:
>Environment:
System: Linux 2.4.2-ac19 
Architecture: i686
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ../configure --enable-shared --enable-languages=c,c++
>Description:

# gcc -march=athlon -O3 -c ../../../kmidi/TIMIDITY/resample.c
resample.c: In function `pre_resample':
resample.c:119: Internal compiler error in
print_rtl_and_abort, at flow.c:6601

on this file: 

=== Cut ===
typedef unsigned int uint32;
typedef int int32; 
typedef char int8;
typedef unsigned char uint8;
typedef double FLOAT_T;
typedef unsigned short uint16;
typedef short int16;

  typedef int16 sample_t;
   typedef int32 final_volume_t;

#define FRACTION_BITS 13
#define INTEGER_MASK (0xFFFFFFFF << FRACTION_BITS)
#define FRACTION_MASK (~ INTEGER_MASK)

#define OVERSHOOT_STEP 50

typedef struct {
  int (*cmsg)(int type, int verbosity_level, const char *fmt, ...);
} ControlMode;

typedef struct {
  uint32
    loop_start, loop_end, data_length,
    sample_rate, low_freq, high_freq, root_freq;

  uint8
    root_tune, fine_tune;

  uint32
    envelope_rate[7], envelope_offset[7],
    modulation_rate[7], modulation_offset[7];
  FLOAT_T
    volume, resonance,
    modEnvToFilterFc, modEnvToPitch, modLfoToFilterFc;
  sample_t *data;
  int32 
    tremolo_sweep_increment, tremolo_phase_increment, 
    lfo_sweep_increment, lfo_phase_increment, 
    vibrato_sweep_increment;
  uint32
    vibrato_control_ratio,
    cutoff_freq;
  uint8
    reverberation, chorusdepth,
    tremolo_depth, vibrato_depth,
    modes;
  uint8
    panning, note_to_use, exclusiveClass;
  int16
    scale_tuning, keyToModEnvHold, keyToModEnvDecay,
    keyToVolEnvHold, keyToVolEnvDecay;
  uint8
    attenuation, freq_center;
  int32
    freq_scale, vibrato_delay;
} Sample;

extern ControlMode * ctl;

void pre_resample(Sample * sp)
{
  double a, xdiff;
  uint32 i, incr, ofs, newlen, count, overshoot;
  int16 *newdata, *dest, *src = (int16 *)sp->data, *vptr, *endptr;
  int32 v1, v2, v3, v4;
  static const char note_name[12][3] =
  {
    "C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B"
  };
  endptr = src + (sp->data_length >> FRACTION_BITS) - 1;
  if (*endptr < 0) overshoot = (uint32)(-(*endptr / OVERSHOOT_STEP));
  else overshoot = (uint32)(*endptr / OVERSHOOT_STEP);
  if (overshoot < 2) overshoot = 0;
  newlen = (int32)(sp->data_length / a);
  count = (newlen >> FRACTION_BITS) - 1;
  ofs = incr = (sp->data_length - (1 << FRACTION_BITS)) / count;

  if((double)newlen + incr >= 0x7fffffffL)
  {
      /* Too large to compute */
      ctl->cmsg(0, 1, " *** Can't pre-resampling for note %d",
		sp->note_to_use);
      return;
  }
  dest = newdata = (int16 *)safe_malloc((newlen >> (FRACTION_BITS - 1)) + 2 + 2*overshoot);
  if (--count)
    *dest++ = src[0];

  /* Since we're pre-processing and this doesn't have to be done in
     real-time, we go ahead and do the full sliding cubic interpolation. */
  count--;
  for(i = 0; i < count + overshoot; i++)
    {
      vptr = src + (ofs >> FRACTION_BITS);
      if (i < count - 2 || !overshoot)
	{
          v1 = *(vptr - 1);
          v2 = *vptr;
          v3 = *(vptr + 1);
          v4 = *(vptr + 2);
	}
      else
	{
	  if (i < count + 1) v1 = *(vptr - 1);
	  else v1 = *endptr - (count-i+2) * *endptr / overshoot;
	  if (i < count) v2 = *vptr;
	  else v2 = *endptr - (count-i+1) * *endptr / overshoot;
	  if (i < count - 1) v3 = *(vptr + 1);
	  else v3 = *endptr - (count-i) * *endptr / overshoot;
	  v4 = *endptr - (count-i-1) * *endptr / overshoot;
	}
      xdiff = FRSCALENEG((int32)(ofs & FRACTION_MASK), FRACTION_BITS);
      *dest++ = v2 + (xdiff / 6.0) * (-2 * v1 - 3 * v2 + 6 * v3 - v4 +
      xdiff * (3 * (v1 - 2 * v2 + v3) + xdiff * (-v1 + 3 * (v2 - v3) + v4)));
      ofs += incr;
    }
}
== end === 
>How-To-Repeat:

works fine when omitting the -march=athlon or replacing -O3 by -O2. 
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]