Bug 33691 - [4.3 Regression] Type checking error with bitwise and/or
Summary: [4.3 Regression] Type checking error with bitwise and/or
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.3.0
: P3 normal
Target Milestone: 4.3.0
Assignee: Richard Biener
URL:
Keywords: ice-checking, ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2007-10-08 09:46 UTC by Richard Biener
Modified: 2007-10-08 14:44 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2007-10-08 09:46:29


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Biener 2007-10-08 09:46:15 UTC
unsigned int mgaSetTexImages(int i)
{
    return ((i | 0x40) & 0xffffffc0);
}

mga_texstate.c:67: error: type mismatch in binary expression
unsigned int

int

unsigned int

D.24173 = D.24172 & 63
Comment 1 Richard Biener 2007-10-08 09:46:28 UTC
Mine.
Comment 2 Richard Biener 2007-10-08 14:44:35 UTC
Subject: Bug 33691

Author: rguenth
Date: Mon Oct  8 14:44:14 2007
New Revision: 129128

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=129128
Log:
2007-10-08  Richard Guenther  <rguenther@suse.de>

	PR middle-end/33691
	PR middle-end/33694
	PR middle-end/33696
	* fold-const.c (fold_binary): Use the correct types when
	folding (A | CST1) & CST2 to (A & CST2) | (CST1 & CST2).
	(fold_binary): Use the correct types when folding
	(-A) - B to (-B) - A.
	(fold_unary): Use the correct types when folding ~(X).

	* gcc.dg/pr33691.c: New testcase.
        * gcc.dg/pr33694.c: Likewise.
        * gcc.dg/pr33696.c: Likewise.

Added:
    trunk/gcc/testsuite/gcc.dg/pr33691.c
    trunk/gcc/testsuite/gcc.dg/pr33694.c
    trunk/gcc/testsuite/gcc.dg/pr33696.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/fold-const.c
    trunk/gcc/testsuite/ChangeLog

Comment 3 Richard Biener 2007-10-08 14:44:44 UTC
Fixed.