projects
/
gcc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a81fee5
)
(shorten_compare): Do nothing if both args constant.
author
Richard Stallman
<rms@gnu.org>
Sun, 31 Oct 1993 03:13:52 +0000
(
03:13
+0000)
committer
Richard Stallman
<rms@gnu.org>
Sun, 31 Oct 1993 03:13:52 +0000
(
03:13
+0000)
From-SVN: r5954
gcc/c-common.c
patch
|
blob
|
history
diff --git
a/gcc/c-common.c
b/gcc/c-common.c
index a6e78260841a3e60760f23c81b811a8a62153605..37d0458e769045ba7faac31391f66a57c10c181e 100644
(file)
--- a/
gcc/c-common.c
+++ b/
gcc/c-common.c
@@
-1259,6
+1259,13
@@
shorten_compare (op0_ptr, op1_ptr, restype_ptr, rescode_ptr)
tree primop0, primop1;
enum tree_code code = *rescode_ptr;
+ /* Don't do anything if both args are constant.
+ This avoids confusing warnings. The caller will fold properly. */
+ if ((TREE_CODE (op0) == INTEGER_CST || TREE_CODE (op0) == REAL_CST)
+ &&
+ (TREE_CODE (op1) == INTEGER_CST || TREE_CODE (op1) == REAL_CST))
+ return 0;
+
/* Throw away any conversions to wider types
already present in the operands. */