This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix PR tree-opt/22484, invalid conditional operand


The problem is two fold. First set_rhs does not reject invalid conditional operand.
The second problem if we don't want to lose optimizations, fold_stmt_inplace does
not strip useless type conversions. Either alone will fix the problem but fixing
in both places makes sure that we don't lose optimizations and we don't ICE later
for an invalid conditional operand.


OK? Bootstrapped and tested on powerpc-darwin with no regressions.

Thanks,
Andrew Pinski

ChangeLog:

	* tree-ssa-ccp.c (fold_stmt_inplace): Strip useless type conversions
	after fold.
	* tree-ssa-propagate.c (set_rhs): Reject invalid conditional operands.

testsuite/ChangeLog:
	* testsuite/g++.dg/opt/loop2.C: New test.

Attachment: t6.diff.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]