This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: fix for execute/991221-1.c -O1 failure
- To: Joern Rennecke <amylaar at cygnus dot co dot uk>
- Subject: Re: fix for execute/991221-1.c -O1 failure
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Wed, 29 Dec 1999 21:09:25 -0700
- cc: gcc at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org, kenner at vlsi1 dot ultra dot nyu dot edu, amylaar at pasanda dot cygnus dot co dot uk
- Reply-To: law at cygnus dot com
In message <199912240645.GAA16571@phal.cygnus.co.uk>you write:
> Hmmm, I forgot to re-generate the patch after I fixed this to actually
> use TYPE.
>
> But I have a different problem here: the bootstrap fails when compiling
> reload. It encounters a pointer_type, and this has no min nor max value.
>
> (gdb) call debug_tree(type)
> <pointer_type 0x4028c280
> type <integer_type 0x4001a300 short int
> permanent HI
> size <integer_cst 0x40019320 constant permanent 16>
> align 16 symtab 8 alias set 24 precision 16
> min <integer_cst 0x400194a0 constant permanent -32768>
> max <integer_cst 0x400194c0 constant permanent 32767>
> pointer_to_this <pointer_type 0x4028c280>>
>
> unsigned permanent SI
> size <integer_cst 0x40019560 type <integer_type 0x4001b580 unsigned int
> > constant permanent 32>
> align 32 symtab 352 alias set 93>
>
> Should I get the limits from somewhere else? Or should pointers be
> treated as having indeed no bounds?
Treating the pointer type as having no bounds is certainly a safe thing to
do. Finding the range of a pointer type is somewhat complicated by the
signed vs unsigned issues.
Note instead of:
! sgn0 = (upper0_p
! ? (! arg0 || operand_equal_p (arg0, TYPE_MAX_VALUE (type), 1)
! ? 1 : 0)
! : (! arg0 || operand_equal_p (arg0, TYPE_MIN_VALUE (type), 1)
! ? -1 : 0));
It might be better to write
sgn0 = (! arg0 || operand_equal_p (arg0, TYPE_MAX_VALUE (type), 1)
? (upper0_p ? 1 : -1) : 0);
Similarly for the other instances of similar code.
jeff