aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/expand
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-06-20 23:52:14 +0200
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-08-06 18:30:44 +0200
commit9aa1c8656be5fee7394cb242a80d7ea8eed32385 (patch)
tree499fd2c3b3154ac371873dae541798cab2e021c0 /validation/expand
parentc2a5bd264187f42564b7055bce4cf72a7985cbc5 (diff)
downloadsparse-dev-9aa1c8656be5fee7394cb242a80d7ea8eed32385.tar.gz
bad-shift: wait dead code elimination to warn about bad shifts
Sparse complains when a shift amount is too big for the size of its operand or if it's negative. However, it does this even for expressions that are never evaluated. It's especially annoying in the kernel for type generic macros, for example the ones in arch/*/include/asm/cmpxchg.h So, remove all warnings done at expansion time and avoid any simplifications of such expressions. Same, at linearization and optimization time but in this case mark the instructions as 'tainted' to inhibit any further simplifications. Finally, at the end of the optimization phase, warn for the tainted instructions. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'validation/expand')
-rw-r--r--validation/expand/bad-shift.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/validation/expand/bad-shift.c b/validation/expand/bad-shift.c
index 22c4341f..b68866c2 100644
--- a/validation/expand/bad-shift.c
+++ b/validation/expand/bad-shift.c
@@ -56,9 +56,9 @@ rneg:
* check-output-end
*
* check-error-start
-expand/bad-shift.c:5:18: warning: shift too big (32) for type int
-expand/bad-shift.c:10:18: warning: shift count is negative (-1)
-expand/bad-shift.c:15:18: warning: shift too big (32) for type int
-expand/bad-shift.c:20:18: warning: shift count is negative (-1)
+expand/bad-shift.c:5:21: warning: shift too big (32) for type int
+expand/bad-shift.c:10:21: warning: shift count is negative (-1)
+expand/bad-shift.c:15:21: warning: shift too big (32) for type int
+expand/bad-shift.c:20:21: warning: shift count is negative (-1)
* check-error-end
*/