re PR middle-end/19382 (ACATS cxb4005 cxb5002 simple To_COBOL/To_Fortran test fails at runtime on s390-linux)
PR ada/19382 * builtins.c (fold_builtin_memcmp): When constructing the pointer type used to access data in the inlined length == 1 case, use build_pointer_type_for_mode with CAN_ALIAS_ALL set to true. (fold_builtin_strcmp, fold_builtin_strncmp): Likewise. From-SVN: r104948
This commit is contained in:
parent
84c2b4da38
commit
baab454a0a
2 changed files with 26 additions and 6 deletions
|
@ -1,3 +1,11 @@
|
|||
2005-10-04 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
|
||||
|
||||
PR ada/19382
|
||||
* builtins.c (fold_builtin_memcmp): When constructing the pointer
|
||||
type used to access data in the inlined length == 1 case, use
|
||||
build_pointer_type_for_mode with CAN_ALIAS_ALL set to true.
|
||||
(fold_builtin_strcmp, fold_builtin_strncmp): Likewise.
|
||||
|
||||
2005-10-04 Uros Bizjak <uros@kss-loka.si>
|
||||
|
||||
* config/i386/i386.h (TARGET_FISTTP): Enable also for
|
||||
|
|
|
@ -8089,7 +8089,9 @@ fold_builtin_memcmp (tree arglist)
|
|||
if (host_integerp (len, 1) && tree_low_cst (len, 1) == 1)
|
||||
{
|
||||
tree cst_uchar_node = build_type_variant (unsigned_char_type_node, 1, 0);
|
||||
tree cst_uchar_ptr_node = build_pointer_type (cst_uchar_node);
|
||||
tree cst_uchar_ptr_node
|
||||
= build_pointer_type_for_mode (cst_uchar_node, ptr_mode, true);
|
||||
|
||||
tree ind1 = fold_convert (integer_type_node,
|
||||
build1 (INDIRECT_REF, cst_uchar_node,
|
||||
fold_convert (cst_uchar_ptr_node,
|
||||
|
@ -8141,7 +8143,9 @@ fold_builtin_strcmp (tree arglist)
|
|||
if (p2 && *p2 == '\0')
|
||||
{
|
||||
tree cst_uchar_node = build_type_variant (unsigned_char_type_node, 1, 0);
|
||||
tree cst_uchar_ptr_node = build_pointer_type (cst_uchar_node);
|
||||
tree cst_uchar_ptr_node
|
||||
= build_pointer_type_for_mode (cst_uchar_node, ptr_mode, true);
|
||||
|
||||
return fold_convert (integer_type_node,
|
||||
build1 (INDIRECT_REF, cst_uchar_node,
|
||||
fold_convert (cst_uchar_ptr_node,
|
||||
|
@ -8152,7 +8156,9 @@ fold_builtin_strcmp (tree arglist)
|
|||
if (p1 && *p1 == '\0')
|
||||
{
|
||||
tree cst_uchar_node = build_type_variant (unsigned_char_type_node, 1, 0);
|
||||
tree cst_uchar_ptr_node = build_pointer_type (cst_uchar_node);
|
||||
tree cst_uchar_ptr_node
|
||||
= build_pointer_type_for_mode (cst_uchar_node, ptr_mode, true);
|
||||
|
||||
tree temp = fold_convert (integer_type_node,
|
||||
build1 (INDIRECT_REF, cst_uchar_node,
|
||||
fold_convert (cst_uchar_ptr_node,
|
||||
|
@ -8210,7 +8216,9 @@ fold_builtin_strncmp (tree arglist)
|
|||
&& tree_int_cst_sgn (len) == 1)
|
||||
{
|
||||
tree cst_uchar_node = build_type_variant (unsigned_char_type_node, 1, 0);
|
||||
tree cst_uchar_ptr_node = build_pointer_type (cst_uchar_node);
|
||||
tree cst_uchar_ptr_node
|
||||
= build_pointer_type_for_mode (cst_uchar_node, ptr_mode, true);
|
||||
|
||||
return fold_convert (integer_type_node,
|
||||
build1 (INDIRECT_REF, cst_uchar_node,
|
||||
fold_convert (cst_uchar_ptr_node,
|
||||
|
@ -8224,7 +8232,9 @@ fold_builtin_strncmp (tree arglist)
|
|||
&& tree_int_cst_sgn (len) == 1)
|
||||
{
|
||||
tree cst_uchar_node = build_type_variant (unsigned_char_type_node, 1, 0);
|
||||
tree cst_uchar_ptr_node = build_pointer_type (cst_uchar_node);
|
||||
tree cst_uchar_ptr_node
|
||||
= build_pointer_type_for_mode (cst_uchar_node, ptr_mode, true);
|
||||
|
||||
tree temp = fold_convert (integer_type_node,
|
||||
build1 (INDIRECT_REF, cst_uchar_node,
|
||||
fold_convert (cst_uchar_ptr_node,
|
||||
|
@ -8237,7 +8247,9 @@ fold_builtin_strncmp (tree arglist)
|
|||
if (host_integerp (len, 1) && tree_low_cst (len, 1) == 1)
|
||||
{
|
||||
tree cst_uchar_node = build_type_variant (unsigned_char_type_node, 1, 0);
|
||||
tree cst_uchar_ptr_node = build_pointer_type (cst_uchar_node);
|
||||
tree cst_uchar_ptr_node
|
||||
= build_pointer_type_for_mode (cst_uchar_node, ptr_mode, true);
|
||||
|
||||
tree ind1 = fold_convert (integer_type_node,
|
||||
build1 (INDIRECT_REF, cst_uchar_node,
|
||||
fold_convert (cst_uchar_ptr_node,
|
||||
|
|
Loading…
Add table
Reference in a new issue