Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
8813f50d
Commit
8813f50d
authored
Jun 07, 2017
by
Bin Cheng
Committed by
Bin Cheng
Jun 07, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* tree-affine.c (tree_to_aff_combination): Handle (T1)(X + X).
From-SVN: r248956
parent
1b92ccde
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
10 deletions
+21
-10
gcc/ChangeLog
+4
-0
gcc/tree-affine.c
+17
-10
No files found.
gcc/ChangeLog
View file @
8813f50d
2017-06-07 Bin Cheng <bin.cheng@arm.com>
* tree-affine.c (tree_to_aff_combination): Handle (T1)(X + X).
2017-06-07 Bin Cheng <bin.cheng@arm.com>
(aff_combination_expand): Move (T1)(X *+- CST) simplification to ...
(tree_to_aff_combination): ... here.
...
...
gcc/tree-affine.c
View file @
8813f50d
...
...
@@ -375,17 +375,24 @@ tree_to_aff_combination (tree expr, tree type, aff_tree *comb)
if
((
icode
==
PLUS_EXPR
||
icode
==
MINUS_EXPR
||
icode
==
MULT_EXPR
)
&&
TREE_CODE
(
itype
)
==
INTEGER_TYPE
&&
TREE_CODE
(
otype
)
==
INTEGER_TYPE
&&
TYPE_PRECISION
(
otype
)
>
TYPE_PRECISION
(
itype
)
&&
TYPE_OVERFLOW_UNDEFINED
(
itype
)
&&
TREE_CODE
(
TREE_OPERAND
(
inner
,
1
))
==
INTEGER_CST
)
&&
TYPE_PRECISION
(
otype
)
>
TYPE_PRECISION
(
itype
))
{
/* Convert (T1)(X *+- CST) into (T1)X *+- (T1)CST if X's type has
undefined overflow behavior. */
tree
op0
=
fold_convert
(
otype
,
TREE_OPERAND
(
inner
,
0
));
tree
op1
=
fold_convert
(
otype
,
TREE_OPERAND
(
inner
,
1
));
expr
=
fold_build2
(
icode
,
otype
,
op0
,
op1
);
tree_to_aff_combination
(
expr
,
type
,
comb
);
return
;
tree
op0
=
TREE_OPERAND
(
inner
,
0
),
op1
=
TREE_OPERAND
(
inner
,
1
);
/* If inner type has undefined overflow behavior, fold conversion
for below two cases:
(T1)(X *+- CST) -> (T1)X *+- (T1)CST
(T1)(X + X) -> (T1)X + (T1)X. */
if
(
TYPE_OVERFLOW_UNDEFINED
(
itype
)
&&
(
TREE_CODE
(
op1
)
==
INTEGER_CST
||
(
icode
==
PLUS_EXPR
&&
operand_equal_p
(
op0
,
op1
,
0
))))
{
op0
=
fold_convert
(
otype
,
op0
);
op1
=
fold_convert
(
otype
,
op1
);
expr
=
fold_build2
(
icode
,
otype
,
op0
,
op1
);
tree_to_aff_combination
(
expr
,
type
,
comb
);
return
;
}
}
}
break
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment