------- Comment #4 from jakub at gcc dot gnu dot org  2008-11-28 14:12 -------
*.optimized dump is:
  D.1611 = (int) (long long unsigned int) g % 2123;
  if (D.1611 != 0)
    goto <bb 3>;
  else
    goto <bb 5>;

<bb 3>:
  if ((signed char) (0 / D.1611) == 1)
    goto <bb 4>;
  else
    goto <bb 5>;

<bb 4>:
  vol.2 ={v} h;

<bb 5>:
  return;

The problem is that fold_comparison doesn't fold EQ_EXPR (signed char) (0 /
D.1611) with 1 (signed char type) into 0 / D.1611, false, nor anything else
optimizes this at the tree level.  I guess e.g. VRP should be able to find this
out.  Even when that is fixed (can look at it), I guess there still be
possibilities that tree optimizers miss something that the RTL optimizers might
DCE away (otherwise, why would we run RTL DCE at all?).

The call BTW doesn't pop any arguments on return.

I guess option 3 is remove this i386.c optimization, assume only very few calls
will be DCEd at RTL level and count with the fact that their argument stores
might not have been eliminated.  For x86_64 this wouldn't make a difference for
calls that pass args only in registers - the outgoing args size will be 0 in
that case anyway.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38245

Reply via email to