Skip to content
Snippets Groups Projects
Commit c7274165 authored by Marek Polacek's avatar Marek Polacek Committed by Marek Polacek
Browse files

fold-const.c (fold_negate_expr): Don't fold INTEGER_CST if that overflows when...

fold-const.c (fold_negate_expr): Don't fold INTEGER_CST if that overflows when SANITIZE_SI_OVERFLOW is on.

	* fold-const.c (fold_negate_expr): Don't fold INTEGER_CST if
	that overflows when SANITIZE_SI_OVERFLOW is on.  Guard -(-A)
	folding with TYPE_OVERFLOW_SANITIZED.

	* c-c++-common/ubsan/overflow-negate-3.c: New test.

From-SVN: r217556
parent 4088b790
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment