gcc-patches@gcc.gnu.org
[Top] [All Lists]

Re: [C++ PATCH] Fix switch handling in C++ FE (PR c++/39371)

Subject: Re: [C++ PATCH] Fix switch handling in C++ FE PR c++/39371
From: Mark Mitchell
Date: Mon, 09 Mar 2009 08:44:55 -0700
Jakub Jelinek wrote:

> 2009-03-09  Jakub Jelinek  <jakub@xxxxxxxxxx>
> 
>       PR c++/39371
>       * semantics.c (finish_switch_cond): Don't call get_unwidened.
>       * decl.c (finish_case_label): Pass SWITCH_STMT_TYPE as 3rd argument
>       instead of TREE_TYPE (cond).
> 
>       * g++.dg/opt/switch2.C: Add -w to dg-options.
>       * g++.dg/warn/Wswitch-1.C: Adjust expected warnings.
>       * g++.dg/warn/switch1.C: New test.
>       * g++.dg/other/switch3.C: New test.

I've always been suspicious of this code.  I agree that the FE shouldn't
be modifying the types of expressions in this way.  I suspect that it
used to be profitable in some situation, but it really shouldn't be anymore.

But, Jason might have more context.  So, I'll approve this, assuming
that Jason doesn't object within 24 hours.

-- 
Mark Mitchell
CodeSourcery
mark@xxxxxxxxxxxxxxxx
(650) 331-3385 x713

<Prev in Thread] Current Thread [Next in Thread>