Commit dae1bf4d by Nathan Sidwell Committed by Nathan Sidwell

re PR c++/22551 ([ICE] in tree_low_cst, at tree.c:3843)

.:	PR c++/22551
	* c-common.c (c_add_case_label): Revert my 2005-10-14 clearing of
	overflow flags.
testsuite:
	PR c++/22551
	* g++.dg/other/switch2.C: Remove expected warnings.

From-SVN: r105501
parent 61efc800
2005-10-17 Nathan Sidwell <nathan@codesourcery.com>
PR c++/22551
* c-common.c (c_add_case_label): Revert my 2005-10-14 clearing of
overflow flags.
2005-10-17 Kaz Kojima <kkojima@gcc.gnu.org>
* config/sh/sh.h (OPTIMIZATION_OPTIONS): Set flag_schedule_insns
......
......@@ -3590,10 +3590,6 @@ c_add_case_label (splay_tree cases, tree cond, tree orig_type,
low_value = convert_and_check (type, low_value);
if (low_value == error_mark_node)
goto error_out;
/* Do not propagate any overflow information past this point.
It is safe to just clear the flags, as any constants with
them set will not be shared. */
TREE_CONSTANT_OVERFLOW (low_value) = TREE_OVERFLOW (low_value) = 0;
}
if (high_value)
{
......@@ -3601,7 +3597,6 @@ c_add_case_label (splay_tree cases, tree cond, tree orig_type,
high_value = convert_and_check (type, high_value);
if (high_value == error_mark_node)
goto error_out;
TREE_CONSTANT_OVERFLOW (high_value) = TREE_OVERFLOW (high_value) = 0;
}
if (low_value && high_value)
......
2005-10-17 Nathan Sidwell <nathan@codesourcery.com>
PR c++/22551
* g++.dg/other/switch2.C: Remove expected warnings.
PR c++/21353
* g++.dg/template/defarg6.C: New.
......@@ -4,7 +4,7 @@
// PR 22551:ICE
// Origin: Johnny Casey <emailwastefilter-bugzillagccorg@yahoo.com>
const int B = 0x80000000;
const int B = ~(~0u >> 1);
#define b(x) (B + x)
......@@ -13,10 +13,11 @@ int Foo (int error)
{
switch (error)
{
case b (1): return 0; // { dg-error "overflow" "" }
case b (2): return 0; // { dg-error "overflow" "" }
case b (3): return 0; // { dg-error "overflow" "" }
case b (4): return 0; // { dg-error "overflow" "" }
case b (5): return 0; // { dg-error "overflow" "" }
}
case b (1): return 0;
case b (2): return 0;
case b (3): return 0;
case b (4): return 0;
case b (5): return 0;
}
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment