re PR c++/20023 (internal compiler error: Segmentation fault)

PR c++/20023
	PR tree-optimization/20009
	* convert.c (convert_to_integer): Revert 2005-02-16 change.

	* gcc.c-torture/compile/20050217-1.c: New test.
	* g++.dg/opt/switch3.C: New test.

From-SVN: r95208
This commit is contained in:
Jakub Jelinek 2005-02-18 00:56:54 +01:00 committed by Jakub Jelinek
parent 5820359990
commit 0948e3921d
5 changed files with 40 additions and 2 deletions

View File

@ -1,5 +1,9 @@
2005-02-18 Jakub Jelinek <jakub@redhat.com>
PR c++/20023
PR tree-optimization/20009
* convert.c (convert_to_integer): Revert 2005-02-16 change.
PR tree-optimization/18947
* cgraphunit.c (cgraph_finalize_function): When redefining an extern
inline, remove all nodes that are inlined into the extern inline

View File

@ -387,8 +387,7 @@ convert_to_integer (tree type, tree expr)
expr = integer_zero_node;
else
expr = fold (build1 (CONVERT_EXPR,
lang_hooks.types.type_for_size
(POINTER_SIZE, TYPE_UNSIGNED (type)),
lang_hooks.types.type_for_size (POINTER_SIZE, 0),
expr));
return convert_to_integer (type, expr);

View File

@ -1,5 +1,10 @@
2005-02-18 Jakub Jelinek <jakub@redhat.com>
PR c++/20023
PR tree-optimization/20009
* gcc.c-torture/compile/20050217-1.c: New test.
* g++.dg/opt/switch3.C: New test.
PR tree-optimization/18947
* gcc.c-torture/compile/20050215-1.c: New test.
* gcc.c-torture/compile/20050215-2.c: New test.

View File

@ -0,0 +1,16 @@
// PR c++/20023
// { dg-do compile }
// { dg-options "-O2" }
void f (void);
typedef __SIZE_TYPE__ size_t;
void g (void *a)
{
size_t b = (size_t) a;
switch (b)
{
case 1:
f ();
break;
}
}

View File

@ -0,0 +1,14 @@
/* PR c++/20023 */
void f (void);
typedef __SIZE_TYPE__ size_t;
void g (void *a)
{
size_t b = (size_t) a;
switch (b)
{
case 1:
f ();
break;
}
}