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

Re: More front end type mismatch problems


> 
> This is happening in gcc.dg/tree-ssa/20040121-1.c.  The test
> specifically tests that (p!=0) + (q!=0) should be computed as
> int:
> 
> char *foo(char *p, char *q) {
>     int x = (p !=0) + (q != 0);
>     ...
> }
> 
> During VRP, we get this IL
> 
>   D.1294_10 = first_8 != 0B;
>   D.1295_11 = last_9 != 0B;
>   x_12 = D.1294_10 + D.1295_11;
For me (on the mainline as of last night),
both D.1294 and D.1295 are of type int so it
looks like a bug in VRP assuming the resulting
type of a comparison will a boolean type.

Thanks,
Andrew Pinski


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