This is the mail archive of the gcc@gcc.gnu.org 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: How to replace -O1 with corresponding -f's?


Andrew Pinski <pinskia@physics.uc.edu> writes:

> On Jun 20, 2005, at 10:04 AM, Andrew Haley wrote:
> >> How one finds out what optimization pass misbehaves?
> >
> > Look at the dumps.  If you use the gcc option -da you'll get a full
> > set of RTL dump files.
>
> And -fdump-tree-all for the tree dumps.

The last const.c.t69.final_cleanup is exactly the same in both cases and
doesn't have any useful information anyway:


;; Function osvf (osvf)

osvf ()
{
<bb 0>:
  return 3.14314314e+8;

}

In fact, at the RTL level the difference is that non-optimized code


(insn 8 6 9 1 (set (reg:DF 118 [ D.1144 ])
        (mem/u/i:DF (symbol_ref:SI ("osv") [flags 0x6] <var_decl 0x401ab32c osv>
    (nil))

(insn 9 8 10 1 (set (reg:DF 119 [ <result> ])
        (reg:DF 118 [ D.1144 ])) -1 (nil)
    (nil))

gets replaced with "optimized" one:

(insn 10 9 11 1 (set (reg:SI 121)
        (high:SI (symbol_ref/u:SI ("*.LC0") [flags 0x2]))) -1 (nil)
    (nil))

(insn 11 10 12 1 (set (reg/f:SI 120)
        (lo_sum:SI (reg:SI 121)
            (symbol_ref/u:SI ("*.LC0") [flags 0x2]))) -1 (nil)
    (expr_list:REG_EQUAL (symbol_ref/u:SI ("*.LC0") [flags 0x2])
        (nil)))

(insn 12 11 13 1 (set (reg:DF 118 [ <result> ])
        (mem/u/i:DF (reg/f:SI 120) [0 S8 A64])) -1 (nil)
    (expr_list:REG_EQUAL (const_double:DF 3.14314314e+8 [0x0.95e0725p+29])
        (nil)))

so SYMBOL_FLAG_SMALL (flags 0x6 vs 0x2) is somehow being missed when -O1
is turned on. Seems to be something at tree-to-RTX conversion time.
Constant folding?

-- 
Sergei.


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