summaryrefslogtreecommitdiff
path: root/gcc/enquire.c
diff options
context:
space:
mode:
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1998-04-04 13:32:39 +0000
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1998-04-04 13:32:39 +0000
commit997d68fef349f244932d14a82f06cbfe26e344f6 (patch)
tree6743f11e58bd7a933b08900d973d89026cd11c43 /gcc/enquire.c
parent68215e49a61b9179c353b5edd9b5796b04acdba0 (diff)
downloadgcc-997d68fef349f244932d14a82f06cbfe26e344f6.tar.gz
* Check in merge from gcc2. See ChangeLog.11 and ChangeLog.12
for details. * haifa-sched.c: Mirror recent changes from gcc2. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@18984 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/enquire.c')
-rw-r--r--gcc/enquire.c49
1 files changed, 35 insertions, 14 deletions
diff --git a/gcc/enquire.c b/gcc/enquire.c
index e8adb038c0d..bb5ea0be604 100644
--- a/gcc/enquire.c
+++ b/gcc/enquire.c
@@ -1412,21 +1412,42 @@ int cprop() {
c=0; char_max=0;
c++;
- if (setjmp(lab)==0) { /* Yields char_max */
- while (c>char_max) {
- char_max=c;
- c++;
- }
+ if (bits_per_byte <= 16) {
+ if (setjmp(lab)==0) { /* Yields char_max */
+ while (c>char_max) {
+ char_max=c;
+ c++;
+ }
+ } else {
+ Vprintf("%sCharacter overflow generates a trap!%s\n",
+ co, oc);
+ }
+ c=0; char_min=0;
+ c--;
+ if (setjmp(lab)==0) { /* Yields char_min */
+ while (c<char_min) {
+ char_min=c;
+ c--;
+ }
+ }
} else {
- Vprintf("%sCharacter overflow generates a trap!%s\n", co, oc);
- }
- c=0; char_min=0;
- c--;
- if (setjmp(lab)==0) { /* Yields char_min */
- while (c<char_min) {
- char_min=c;
- c--;
- }
+ /* An exhaustive search here is impracticable ;-) */
+ c = (1 << (bits_per_byte - 1)) - 1;
+ char_max = c;
+ c++;
+ if (c > char_max)
+ char_max = ~0;
+ c = 0;
+ char_min = 0;
+ c--;
+ if (c < char_min) {
+ c = (1 << (bits_per_byte - 1)) - 1;
+ c = -c;
+ char_min = c;
+ c--;
+ if (c < char_min)
+ char_min = c;
+ }
}
if (c_signed && char_min == 0) {
Vprintf("%sBEWARE! Chars are pseudo-unsigned:%s\n", co, oc);