[PATCH] Fix PR C++/28302, ICE with bitwise NOT and vectors (and C++)

Andrew Pinski pinskia@physics.uc.edu
Tue Aug 15 16:20:00 GMT 2006


The problem here is that we try to call perform_integral_promotions on a
vector type which causes a crash.  The way to fix this is to avoid the
call for non integral types.  We have already diagnostic invalid
operands to the expression by the time we get to calling
perform_integral_promotions so avoiding the call is the best way.
Also UNARY_MINUS_EXPR and PLUS_EXPR are handled this way.

OK? Bootstrapped and tested on i686-linux-gnu with no regressions.

:ADDPATCH C++:

Thanks,
Andrew Pinski

cp/ChangeLog:
	* typeck.c (build_unary_op <case BIT_NOT_EXPR:>): Don't call
	perform_integral_promotions for non integral types.

testsuite/ChangeLog:
	* g++.dg/ext/vector3.C: New test.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix28302.diff.txt
Type: text/x-patch
Size: 809 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20060815/09cd02f7/attachment.bin>


More information about the Gcc-patches mailing list