diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-02-17 23:56:54 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-02-17 23:56:54 +0000 |
commit | 728d11f05479ab60992fffca74b3add274f168f8 (patch) | |
tree | f4c298b83bfc6b9caea7a518fe9dcb10b44535a7 /gcc | |
parent | 06bf91cbff74301a0a7b0c75472caa7002a00b78 (diff) | |
download | gcc-728d11f05479ab60992fffca74b3add274f168f8.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@95208 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/convert.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/opt/switch3.C | 16 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/compile/20050217-1.c | 14 |
5 files changed, 40 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 610d47ac393..77930b280fa 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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 diff --git a/gcc/convert.c b/gcc/convert.c index c48b242b655..f900ace21e4 100644 --- a/gcc/convert.c +++ b/gcc/convert.c @@ -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); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ccfd4ef6929..668d6e471c3 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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. diff --git a/gcc/testsuite/g++.dg/opt/switch3.C b/gcc/testsuite/g++.dg/opt/switch3.C new file mode 100644 index 00000000000..643cac3235b --- /dev/null +++ b/gcc/testsuite/g++.dg/opt/switch3.C @@ -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; + } +} diff --git a/gcc/testsuite/gcc.c-torture/compile/20050217-1.c b/gcc/testsuite/gcc.c-torture/compile/20050217-1.c new file mode 100644 index 00000000000..f4b928d1e04 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/20050217-1.c @@ -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; + } +} |