8/16bit oddities on avr-gcc

Michael Kukat michael@unixiron.org
Fri Mar 2 13:17:00 GMT 2007


Hi,

2007/3/2, Rupert Wood <me@rupey.net>:
> I think he wants the perftest.c.099t.optimized file that'd be generated on disk.

ah, okay, didn't use that option for now, so i didn't know that the
necessary info is written to files :) Here it comes:

;; Function test (test)

Analyzing Edge Insertions.
test ()
{
  unsigned int ivtmp.28;
  uint8_t ivtmp.27;
  uint8_t pretmp.25;
  uint8_t ctr;

<bb 0>:
  ivtmp.28 = 0;

<L0>:;
  ctr = (uint8_t) ivtmp.28;
  xx = ctr;
  ivtmp.28 = ivtmp.28 + 1;
  if (ivtmp.28 != 64) goto <L0>; else goto <L1>;

<L1>:;
  return;

}

Hm. It creates "unsigned int" for this comparison.

Now trying without the assignment within the loop:

;; Function test (test)

Analyzing Edge Insertions.
test ()
{
  uint8_t ivtmp.27;
  uint8_t pretmp.25;
  uint8_t ctr;

<bb 0>:
  ctr = 0;

<L0>:;
  __asm__ __volatile__("nop"::);
  ctr = ctr + 1;
  if (ctr != 64) goto <L0>; else goto <L1>;

<L1>:;
  return;

}

Here, ctr is taken for the comparison, not one of those ivtmp variables.

...Michael



More information about the Gcc-help mailing list