projects
/
libfirm
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
88f356d
)
Bugfix: Added special case for x mod 1.
author
Sebastian Buchwald
<Sebastian.Buchwald@kit.edu>
Fri, 19 Aug 2011 12:07:11 +0000
(14:07 +0200)
committer
Sebastian Buchwald
<Sebastian.Buchwald@kit.edu>
Fri, 19 Aug 2011 12:07:43 +0000
(14:07 +0200)
ir/ir/irarch.c
patch
|
blob
|
history
diff --git
a/ir/ir/irarch.c
b/ir/ir/irarch.c
index
ad1841c
..
7b30379
100644
(file)
--- a/
ir/ir/irarch.c
+++ b/
ir/ir/irarch.c
@@
-1051,7
+1051,13
@@
ir_node *arch_dep_replace_mod_by_const(ir_node *irn)
k = tv_ld2(tv, n);
}
- if (k >= 0) {
+ /* k == 0 i.e. modulo by 1 */
+ if (k == 0) {
+ ir_graph *irg = get_irn_irg(irn);
+
+ res = new_r_Const(irg, get_mode_null(mode));
+ }
+ else if (k > 0) {
ir_graph *irg = get_irn_irg(irn);
/* division by 2^k or -2^k:
* we use "modulus" here, so x % y == x % -y that's why is no difference between the case 2^k and -2^k