This is the mail archive of the gcc@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]

Re: PPro patch for egcs


> Ok, I simplified output_int_conditional_move. We have to handle some
> special cases for integer conditional move. It is better to do it
> in one place.

Please describe the special cases.

> if ((code == GT || code == LE)
>     && (cc_prev_status.flags & CC_NO_OVERFLOW))
>   return NULL_PTR;

It's not clear to me that this is correct.  The general form for
a conditional move is:

  r <- cond ? arg1 : arg2

It seems that the above code will result in missing move instructions
in some situations.  A comment in the code describing what's intended
would be helpful.

As a personal style issue I prefer using:

  switch ( variable )
    {
      case xxx:
        ...
        break;

      case yyy:
        ...
        break;

      .
      .
      .
    }

over:

  if (variable == xxx)
    {
      ...
    }
  else if (variable == yyy)
    {
      ...
    }
  else if ...
    .
    .
    .

-- John
-------------------------------------------------------------------------
|   Feith Systems  |   Voice: 1-215-646-8000  |  Email: john@feith.com  |
|    John Wehle    |     Fax: 1-215-540-5495  |                         |
-------------------------------------------------------------------------



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