mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-15 07:50:29 +08:00
tree-chrec.c (chrec_convert_1): Only fold (T2)(t +- x) to (T2)t +- (T2)x if only integer types are involved.
* tree-chrec.c (chrec_convert_1): Only fold (T2)(t +- x) to (T2)t +- (T2)x if only integer types are involved. * gcc.c-torture/compile/20091215-1.c: New test. From-SVN: r155288
This commit is contained in:
parent
9245e113af
commit
dc01fed168
@ -1,3 +1,8 @@
|
||||
2009-12-16 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
* tree-chrec.c (chrec_convert_1): Only fold (T2)(t +- x) to
|
||||
(T2)t +- (T2)x if only integer types are involved.
|
||||
|
||||
2009-12-16 Ben Elliston <bje@au.ibm.com>
|
||||
|
||||
* tree-data-ref.h (dot_rdg): Remove prototype.
|
||||
|
@ -1,5 +1,7 @@
|
||||
2009-12-16 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
* gcc.c-torture/compile/20091215-1.c: New test.
|
||||
|
||||
* gcc.dg/debug/tls-1.c: New test.
|
||||
|
||||
2009-12-15 Jason Merrill <jason@redhat.com>
|
||||
|
15
gcc/testsuite/gcc.c-torture/compile/20091215-1.c
Normal file
15
gcc/testsuite/gcc.c-torture/compile/20091215-1.c
Normal file
@ -0,0 +1,15 @@
|
||||
void bar ();
|
||||
|
||||
void
|
||||
foo (void *x, short y)
|
||||
{
|
||||
bar (x, y + 1);
|
||||
}
|
||||
|
||||
void
|
||||
bar (x, y)
|
||||
void *x;
|
||||
char *y;
|
||||
{
|
||||
baz (y);
|
||||
}
|
@ -1293,6 +1293,8 @@ keep_cast:
|
||||
if (use_overflow_semantics
|
||||
&& (TREE_CODE (chrec) == PLUS_EXPR
|
||||
|| TREE_CODE (chrec) == MINUS_EXPR)
|
||||
&& TREE_CODE (type) == INTEGER_TYPE
|
||||
&& TREE_CODE (ct) == INTEGER_TYPE
|
||||
&& TYPE_PRECISION (type) > TYPE_PRECISION (ct)
|
||||
&& TYPE_OVERFLOW_UNDEFINED (ct))
|
||||
res = fold_build2 (TREE_CODE (chrec), type,
|
||||
|
Loading…
x
Reference in New Issue
Block a user