This is the mail archive of the gcc-bugs@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]

[Bug target/33755] Gcc 4.2.2 broken for mips linux kernel builds



------- Comment #10 from ddaney at avtrex dot com  2007-10-14 02:02 -------
Subject: Re:  Gcc 4.2.2 broken for mips linux kernel builds

rsandifo at gcc dot gnu dot org wrote:
> ------- Comment #9 from rsandifo at gcc dot gnu dot org  2007-10-13 10:47 -------
> The problem comes from dbr_schedule, although it's not really a bug there.
> We have:
>
>         bne     $5,$0,L1        # A
>         ...stuff...
> L1:
>         bne     $5,$0,L2        # B
>         ...printk call...
> L2:
>
> and nothing before dbr_schedule has managed to thread A to L2.
> dbr_schedule first fills B's delay slot with an lui from the printk
> block, then steal_delay_list_from_target realises that A can steal B's
> delay slot and branch directly to L2.  There is no other path to L1,
> so the rest of the printk call is now dead.
>
> For most targets, this is at worst a missed optimisation; we should have
> threaded A to L2 much earlier than dbr_schedule, and deleted the whole
> printk block as dead.  I don't think the MIPS port can rely on that
> happening for correctness.  So (alas!) I think the upshot is simply
> that we need to add some special code to mips_reorg to delete high-part
> relocations that have no matching lows.
>
> I'll have a poke.
>
>   
That makes sense, however it is a bit strange because... IIRC when I 
compiled the .i file with a fairly recent 4.3 build, the printk  in 
question was not optimized away.  So if 4.2.2 can validly optimize away 
the printk, then we have an optimization regression in 4.3

David Daney


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33755


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