https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104901
--- Comment #11 from Segher Boessenkool ---
$ cat vcc.c
int f(int x) { return x == 31 && x == 42; }
-Wlogical-op gives
vcc.c: In function 'f':
vcc.c:1:31: warning: logical 'and' of mutually exclusive tests is always false
[-Wlogical-op]
1
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104901
--- Comment #10 from Andreas Schwab ---
The values depend on the target, but they are genuine compile time constants.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104901
--- Comment #9 from David Binderman ---
(In reply to Andreas Schwab from comment #7)
> I think it would still be worthwhile to avoid the antipattern (v == c1 && v
> == c2).
+1
I haven't got a rs6000 box, but I suspect our old friend -Wlogical-
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104901
--- Comment #8 from Segher Boessenkool ---
Sure, but c1 as well as c2 are not constants here!
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104901
--- Comment #7 from Andreas Schwab ---
I think it would still be worthwhile to avoid the antipattern (v == c1 && v ==
c2).
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104901
Segher Boessenkool changed:
What|Removed |Added
Status|UNCONFIRMED |RESOLVED
Resolution|---
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104901
pc at gcc dot gnu.org changed:
What|Removed |Added
CC||pc at gcc dot gnu.org
--- Commen
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104901
Segher Boessenkool changed:
What|Removed |Added
CC||segher at gcc dot gnu.org
--- Comm
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104901
--- Comment #3 from Richard Biener ---
It's a way to say a == b == c, no? Not sure if that was intended of course,
but it seems so since we follow with
if (__alignment < __vec_align)
__alignment = __vec_align;
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104901
--- Comment #2 from Andreas Schwab ---
Already present in the first commit 281de9c2d56.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104901
David Binderman changed:
What|Removed |Added
CC||pc at us dot ibm.com
--- Comment #1 f
11 matches
Mail list logo