Bug 21134

Summary: Make gengenrtl emit mode checks aborting on VOIDmode
Product: gcc Reporter: Hans-Peter Nilsson <hp>
Component: middle-endAssignee: Not yet assigned to anyone <unassigned>
Status: NEW ---    
Severity: enhancement CC: gcc-bugs
Priority: P3 Keywords: internal-improvement
Version: 4.1.0   
Target Milestone: ---   
Host: Target: cris-*
Build: Known to work:
Known to fail: Last reconfirmed: 2006-02-13 03:54:03

Description Hans-Peter Nilsson 2005-04-20 23:14:06 UTC
See <URL:http://gcc.gnu.org/ml/gcc-patches/2005-04/msg02223.html> #4.
See also PR 20413 comment #9.
Only CONST_INT should have VOIDmode, and it's not generated by gengenrtl,
so a patch for this enhancement seems simple.
Comment 1 Andrew Pinski 2005-04-21 01:00:00 UTC
Comment 2 Hans-Peter Nilsson 2005-04-23 14:44:31 UTC
Note a list of exceptions is needed, for example
Comment 3 roger 2005-04-23 14:49:42 UTC
The list of exceptions, in addition to those mentioned in the e-mail above, also
needs to include compare, if_then_else and all binary comparison operators; eq,
ne, lt, gt, le, ge.

I'm not opposed to adding checks where appropriate, but clearly the sweeping
statement that the only place we need VOIDmode is const_int, is perhaps an over
simplification.  :-)
Comment 4 Hans-Peter Nilsson 2005-04-23 15:14:22 UTC
In response to comment #2:
Any and all SET_SRC/SET_DEST mode-exceptions must be considered to be added
to genpreds and genrecog as well, for possible omission of the automatically
added mode checks.  The sweeping statement humorousely referred to, seems to
be a common delusion, shared with at least those programs.  Things don't break
until there's a (match_operand:P "predicate" x) where x is one of those
exceptions (without genpreds/genrecog modified as per const_int).
That then causes the predicate to return false.