mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-05 10:50:51 +08:00
gimple-fold.c (gimple_fold_stmt_to_constant_1): Also check the TYPE_MODE to recognize useless pointer conversions.
* gimple-fold.c (gimple_fold_stmt_to_constant_1) <GIMPLE_UNARY_RHS>: Also check the TYPE_MODE to recognize useless pointer conversions. From-SVN: r182178
This commit is contained in:
parent
6d1c2bd3ae
commit
8f420307e0
@ -1,3 +1,8 @@
|
||||
2011-12-09 Eric Botcazou <ebotcazou@adacore.com>
|
||||
|
||||
* gimple-fold.c (gimple_fold_stmt_to_constant_1) <GIMPLE_UNARY_RHS>:
|
||||
Also check the TYPE_MODE to recognize useless pointer conversions.
|
||||
|
||||
2011-12-09 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR tree-optimization/51117
|
||||
|
@ -2517,8 +2517,10 @@ gimple_fold_stmt_to_constant_1 (gimple stmt, tree (*valueize) (tree))
|
||||
if (CONVERT_EXPR_CODE_P (subcode)
|
||||
&& POINTER_TYPE_P (TREE_TYPE (lhs))
|
||||
&& POINTER_TYPE_P (TREE_TYPE (op0))
|
||||
&& (TYPE_ADDR_SPACE (TREE_TYPE (lhs))
|
||||
== TYPE_ADDR_SPACE (TREE_TYPE (op0))))
|
||||
&& TYPE_ADDR_SPACE (TREE_TYPE (lhs))
|
||||
== TYPE_ADDR_SPACE (TREE_TYPE (op0))
|
||||
&& TYPE_MODE (TREE_TYPE (lhs))
|
||||
== TYPE_MODE (TREE_TYPE (op0)))
|
||||
return op0;
|
||||
|
||||
return
|
||||
|
@ -1,3 +1,7 @@
|
||||
2011-12-09 Eric Botcazou <ebotcazou@adacore.com>
|
||||
|
||||
* gcc.c-torture/compile/20111209-1.c: New test.
|
||||
|
||||
2011-12-09 Jason Merrill <jason@redhat.com>
|
||||
|
||||
PR c++/51151
|
||||
|
13
gcc/testsuite/gcc.c-torture/compile/20111209-1.c
Normal file
13
gcc/testsuite/gcc.c-torture/compile/20111209-1.c
Normal file
@ -0,0 +1,13 @@
|
||||
/* { dg-do compile { target s390x-*-* *-*-*vms* } } */
|
||||
|
||||
typedef char* char_ptr32 __attribute__ ((mode(SI)));
|
||||
|
||||
char_ptr32 getenv (const char *name);
|
||||
unsigned long strlen (const char *str);
|
||||
|
||||
void
|
||||
__gnat_getenv (char *name, int *len, char **value)
|
||||
{
|
||||
*value = getenv (name);
|
||||
*len = strlen (*value);
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user