This is the mail archive of the 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: [PATCH] REG_EQUAL notes on cond_jumps.

Hi Roger,

> For example, doesn't support comparison with large immediate
> constants in a single instruction.  As a result code such as the
> following (reduced from 20010119-1.c) was failing to be optimized:
> void foo()
> {
>   int a = 10;
>   int b = 20000;
>   if (a > b)
>     link_error();
> }

This is an over simplification of the problem.  The above testcase
doesn't fail on 3.[3-4] at -O1, -O2 or -O3.  The if is optimized away
in the cse pass.

20010119-1.c doesn't fail at -O1.  The jump is simplified in the cse
pass.  It does fail at -O2.  The difference might be:

(insn 24 67 25 3 7afd0270 (set (reg:SI 100)
        (high:SI (constant_p_rtx:SI (reg/v:SI 95 [ a ])))) -1 (nil)

(insn 25 24 26 3 7afd0270 (set (reg:SI 99)
	(lo_sum:SI (reg:SI 100)
	    (constant_p_rtx:SI (reg/v:SI 95 [ a ])))) -1 (nil)


(insn 25 67 26 1 7afd1330 (set (reg:SI 99)
        (constant_p_rtx:SI (reg/v:SI 95 [ a ]))) 37 {*} (nil)

The cse pass generates the latter form for insn 25 but possibly
it doesn't know how to use it for jump simplification.  Anyway, it
is a puzzle why cse can simplify the jump in 20010119-1.c at -O1
but not at -O2.

J. David Anglin                        
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)

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