aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-10-09 17:28:49 +0200
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-10-09 17:28:49 +0200
commit0c6896f449e857baf10371301fe28dfb125a3208 (patch)
tree6845aa72ebc8d80531f73ca79761315011987d1a
parent26f670cfb6941221acd19b5ed542a6bba60e963c (diff)
parenta28fcdabb7cf5828caa061f69b30c889f49b18e0 (diff)
downloadsparse-0c6896f449e857baf10371301fe28dfb125a3208.tar.gz
Merge branch 'misc'
-rw-r--r--Makefile2
-rw-r--r--lib.h2
-rw-r--r--opcode.def2
-rw-r--r--simplify.c6
-rw-r--r--validation/optim/canonical-mul.c2
5 files changed, 5 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index 09726ebb..ec576354 100644
--- a/Makefile
+++ b/Makefile
@@ -273,7 +273,7 @@ version.h: FORCE
check: all
$(Q)cd validation && ./test-suite
-validation/%: $(PROGRAMS)
+validation/%: $(PROGRAMS) FORCE
$(Q)validation/test-suite $*
diff --git a/lib.h b/lib.h
index b35debc8..0b1d4492 100644
--- a/lib.h
+++ b/lib.h
@@ -44,7 +44,7 @@
#define ARRAY_SIZE(x) (sizeof(x)/sizeof((x)[0]))
#endif
-#ifndef PATH_MAX
+#ifdef __gnu_hurd__
#define PATH_MAX 4096 // Hurd doesn't define this
#endif
diff --git a/opcode.def b/opcode.def
index 7959efaf..1401d988 100644
--- a/opcode.def
+++ b/opcode.def
@@ -33,8 +33,6 @@ OPCODE(FMUL, BADOP, BADOP, BADOP, 2, OPF_TARGET)
OPCODE(FDIV, BADOP, BADOP, BADOP, 2, OPF_TARGET)
/* Logical */
-OPCODE(AND_BOOL, BADOP, BADOP, BADOP, 2, OPF_TARGET)
-OPCODE(OR_BOOL, BADOP, BADOP, BADOP, 2, OPF_TARGET)
OPCODE(AND, BADOP, BADOP, BADOP, 2, OPF_TARGET)
OPCODE(OR, BADOP, BADOP, BADOP, 2, OPF_TARGET)
OPCODE(XOR, BADOP, BADOP, BADOP, 2, OPF_TARGET)
diff --git a/simplify.c b/simplify.c
index 76c05588..15452a58 100644
--- a/simplify.c
+++ b/simplify.c
@@ -1311,13 +1311,11 @@ static int simplify_unop(struct instruction *insn)
struct instruction *def;
case OP_NOT:
- def = insn->src->def;
- if (def && def->opcode == OP_NOT)
+ if (DEF_OPCODE(def, insn->src) == OP_NOT)
return replace_with_pseudo(insn, def->src);
break;
case OP_NEG:
- def = insn->src->def;
- if (def && def->opcode == OP_NEG)
+ if (DEF_OPCODE(def, insn->src) == OP_NEG)
return replace_with_pseudo(insn, def->src);
break;
default:
diff --git a/validation/optim/canonical-mul.c b/validation/optim/canonical-mul.c
index 3ae9e3a6..0c14226f 100644
--- a/validation/optim/canonical-mul.c
+++ b/validation/optim/canonical-mul.c
@@ -7,7 +7,7 @@ uint xtc_umul_ytc(uint x, uint y) { return (x * 3) * (y * 2); }
* check-description:
* 1) verify that constants in mul chains are
* pushed at the right of the whole chain.
- * For example '(a * 3) * b' must be canonicalized into '(a * b) * 1'
+ * For example '(a * 3) * b' must be canonicalized into '(a * b) * 3'
* This is needed in general for constant simplification;
* for example, for:
* '(a * 3) * (b * 2)'