This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

Re: [PATCH] Fix PR middle-end/18859



On Mar 9, 2006, at 6:28 PM, Eric Botcazou wrote:


Hi,
2006-03-09  Eric Botcazou  <ebotcazou@adacore.com>

	PR middle-end/18859
	* stmt.c (expand_case): Discard empty ranges beforehand.

I wonder if this shouldn't be discarded in the gimplification or the lowering
process instead of this late?


Also here is an example which fails at all optimizations levels:
int foo(int a)
{
  switch (a)
  {
    case 0 ... -1:  /* { dg-warning "empty range" } */
      a = a+2;
      break;

    case 1 ... 2:
      a = 0;
      break;

    case 3 ... 4:
      a = 1;
      break;

    case 5 ... 6:
      a = 0;
      break;
  }
  return a;
}

Which might be want to put into torture instead of into gcc.dg.

-- Pinski


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