OR in Generic or Gimple
Andrew Haley
aph@redhat.com
Tue Apr 19 17:00:00 GMT 2011
On 04/19/2011 05:48 PM, charfi asma wrote:
> Hello,
> In my front end I would like to translate to generic the OR operation (if ( y
> =a) || (y=b)) ...
> I tried to look at the gimple generated from this C++ program
>
> int main()
> {
> int x=6;
> int y = x+10;
> if ((y == 1) || (y==0))
> return 10;
> else
> return 0;
> }
>
>
> I found this:
>
>
> int main() ()
> {
> unsigned int y.0;
> unsigned int D.2070;
> int D.2073;
>
> {
> int x;
> int y;
>
> x = 6;
> y = x + 10;
> y.0 = (unsigned int) y;
> D.2070 = y.0 + 4294967295;
> if (D.2070 <= 1) goto <D.2071>; else goto <D.2072>;
> <D.2071>:
> D.2073 = 10;
> return D.2073;
> <D.2072>:
> D.2073 = 0;
> return D.2073;
> }
> D.2073 = 0;
> return D.2073;
> }
>
> I do not really understand how gimple is generated for the OR test.
I don't understand it either. I think it's a bug. I get:
int main() ()
{
unsigned int y.0;
int D.2099;
{
int x;
int y;
x = 6;
y = x + 10;
y.0 = (unsigned int) y;
if (y.0 <= 1) goto <D.2097>; else goto <D.2098>;
<D.2097>:
D.2099 = 10;
return D.2099;
<D.2098>:
D.2099 = 0;
return D.2099;
}
D.2099 = 0;
return D.2099;
}
Andrew.
More information about the Gcc-help
mailing list