This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/69614] [6 Regression] wrong code with -Os -fno-expensive-optimizations -fschedule-insns -mtpcs-leaf-frame -fira-algorithm=priority @ armv7a
- From: "ktkachov at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 08 Feb 2016 16:11:24 +0000
- Subject: [Bug target/69614] [6 Regression] wrong code with -Os -fno-expensive-optimizations -fschedule-insns -mtpcs-leaf-frame -fira-algorithm=priority @ armv7a
- Auto-submitted: auto-generated
- References: <bug-69614-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69614
--- Comment #6 from ktkachov at gcc dot gnu.org ---
-mtpcs-frame or -mapcs seem to help exposing some other issue that I'm having
trouble tracking down.
-mtpcs-frame or -mapcs affect the behaviour of
TARGET_CONDITIONAL_REGISTER_USAGE on arm. In arm.c in
arm_conditional_register_usage:
if (TARGET_APCS_FRAME || TARGET_CALLER_INTERWORKING
|| TARGET_TPCS_FRAME || TARGET_TPCS_LEAF_FRAME)
{
fixed_regs[ARM_HARD_FRAME_POINTER_REGNUM] = 1;
call_used_regs[ARM_HARD_FRAME_POINTER_REGNUM] = 1;
if (TARGET_CALLER_INTERWORKING)
global_regs[ARM_HARD_FRAME_POINTER_REGNUM] = 1;
}
Commenting out that block 'fixes' this testcase.
So it restricts the number of registers available for free use, so IRA makes
very different decisions. Similarly -fschedule-insns enables pre-reload sched1
that moves the insns in such a way so as to trigger the right combination of
live ranges.
The ira and reload dumps look very different between any two good and bad
invocations (I tried leaving out each option to get the 'good' compilation) but
from IRA onwards the dumps are very different, so it's hard for me to see
exactly where things go wrong.
Perhaps a bug with the priority algorithm in IRA?