This is the mail archive of the gcc-bugs@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]

[Bug c++/24439] [3.4/4.0/4.1 Regression] ICE with invert conditional containing throw



------- Comment #11 from mark at codesourcery dot com  2005-10-19 22:14 -------
Subject: Re:  [3.4/4.0/4.1 Regression] ICE with  invert conditional
 containing throw

rguenth at gcc dot gnu dot org wrote:
> ------- Comment #10 from rguenth at gcc dot gnu dot org  2005-10-19 21:51 -------
> Ok, I'll see how big the middle-end change would get.  The easiest way would
> be to change invert_truthvalue to ignore void types and do nothing for them.
> Like
> 
> +  if (VOID_TYPE_P (TREE_TYPE (arg)))
> +    return arg;
>    gcc_assert (TREE_CODE (TREE_TYPE (arg)) == BOOLEAN_TYPE);
>    return build1 (TRUTH_NOT_EXPR, type, arg);
> 
> but auditing all other places we look at COND_EXPR is a big task.

Yes, that looks like the right change to invert_truthvalue, or you could
even bury that in the COND_EXPR case, since that's the only place we
expect that.

To be clear, I have no problem whatsoever with adding the *((T*) 0)
stuff during gimplification, and that will protect all the optimizers
from this case.  But, invert_truthvalue has to operate on more than just
GENERIC/GIMPLE; it's designed to be called from the front ends, so it
has to be tolerant of front-end stuff.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24439


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