This is the mail archive of the 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 C/18715, warning about enum not handled with ...

Andrew Pinski wrote:
The problem here is that we don't find the node in splay tree if it was not
an exact match for the lower bound.  We need to look to see if there is a
predecessor or a successor so that the enum value fits in the value of the
CASE statement.  This patch implements that, copying from c_add_case_label.
This should not have a slow down if you don't use ranges in switches
and implements all enums.

OK? Bootstrapped and tested on powerpc-darwin with no regression.

The concept is OK, but this comment:

+	      /* Check to see if the HIGH_BOUND overlaps.  The low end of that
+		 range is bigger than the low end of the current range, so we
+		 are only interested if the current range is a real range, and
+		 not an ordinary case label.  */

which makes sense, does not seem to be implemented. You're checking high_bound for non-NULL, not whether or not the current case is really a range.

Mark Mitchell
CodeSourcery, LLC
(916) 791-8304

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