This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, 4.6 regression]. New error: case label does not reduce
First, if there isn't a bug in Bugzilla for this problem please file one
so it's properly tracked if it takes a while to work out how to solve it.
As I understand it from your testcases, it's a matter of certain code that
is not valid ISO C but you would like to be accepted unless -pedantic, by
analogy with other such code that is accepted.
On Thu, 16 Feb 2012, Christian Bruel wrote:
> What I'm unsure is why we couldn't have a TREE_NO_WARNING on a
> !CAN_HAVE_LOCATION_P. This seems necessary on some cases without using a
> NOP_EXPR.
Richard explained this.
What is the code adding TREE_NO_WARNING in the first place (before
folding) for your testcase?
It may sometimes be safe to copy constants with copy_node to put
TREE_NO_WARNING on the copies. But you'd still need to be careful because
there are some tree-node-equality comparisons for constants, against
truthvalue_true_node and truthvalue_false_node at least, so those might
need to be relaxed a bit to allow any non-overflowed integer-type integer
constant with the right value.
--
Joseph S. Myers
joseph@codesourcery.com